-
-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Job run failing. connection timeout #30
Comments
Hi @macintosh-HD! This error means that the server cannot access your Redis host. Please ensure that you have allowed your server's IP through the Redis firewall. |
Hey @jdmcd thanks for the fast response. |
@macintosh-HD hmm yeah it definitely should. Can you try |
Ok @jdmcd I now changed the queues provider like this: try app.queues.use(.redis(url: "redis://127.0.0.1")) In my logs of both Vapor and Redis I can detect that there is some initial traffic between the two:
Redis:
But then I receive a top-level error in Vapor:
|
I'm having the same issue. 😢 |
@maximedegreve @macintosh-HD unfortunately that error is unrelated to the Queues package, it's generated by RediStack while attempting to connect to your Redis instance |
This bug started from release 1.0.0-rc.4.1. |
Hi @johnil - this error is unrelated to anything in the queues package and means that it cannot connect to your Redis instance. |
any one fixed this issue I have same issue I have connected look in WARNING MSG please
|
This seems to be due to a very short default timeout in RediStack (10ms!!). You can specify a longer timeout (thanks to Mads for that suggestion): try app.queues.use(
.redis(.init(url: redisURL ?? "redis://127.0.0.1:6379",
pool: .init(connectionRetryTimeout: .seconds(60)))) |
@JetForMe I appreciate you sharing this! Was tearing my hair out trying to figure out why I couldn't connect to my Redis instance. Thanks! |
Thank you @JetForMe I was about losing my hair LOL |
Since this seems to be related to the short timeout, I'm going to close this. Feel free to reopen if it's still an issue |
@0xTim is the default timeout going to be changed? I just had to increase it again in my newest project. |
@JetForMe thats a RediStack issue I believe - worth creating an issue on that repo for discussion |
@JetForMe I'm happy to accept a PR to here as well to default to 60s |
It would be a helluva design choice, so hopefully it’s considered a bug. I hope they accept the PR, although it’s been two days without any feedback, a month since the last commit. There are three open PRs, mine and two from mid-2023. I don't know how to tell who's in charge of a repo on Github. |
@JetForMe feel free to PR a fix into this library |
I just came across this issue myself, and I would love to contribute a different default value to the Vapor code. But before I do so, I wonder why you chose 60 seconds? Isn't that a lot? I'm using 2 seconds now which also fixes this bug for me: try app.queues.use(
.redis(
RedisConfiguration(
url: Environment.get("REDIS_TLS_URL")!,
pool: .init(connectionRetryTimeout: .seconds(2))
)
)
) I wonder what the reasoning is behind 60 seconds. If connecting to a database takes longer than a second (both in development and production), I'd already be concerned and would love to see a warning. But 10ms seems a bit too low, at least during development, which is where I ran into this… |
No idea what an appropriate timeout should be. But RediStack has both 60 seconds and 10 ms (which I think is an error in the way default parameters are set up). |
Every time I start my server the job that is supposed to start immediately is failing with the error:
[ ERROR ] Job run failed: RedisConnectionPoolError(baseError: RediStack.RedisConnectionPoolError.BaseError.timedOutWaitingForConnection) (Queues/QueuesCommand.swift:122)
When I enable debug logging the error is surrounded by endless messages like this one:
I initialised queues like this:
Afterwards I added my jobs and then dispatched one job that should start immediately at the end of my
configure.swift
file:Has anyone an idea why the job is failing or what the error means exactly?
Environment
Vapor Framework version: 4.53.0
Vapor Toolbox version: 18.3.3
OS version: MacOS 12.1
Redis: 5.0.5
Queues: 1.8.1
Queues Redis Driver: 1.0.3
The text was updated successfully, but these errors were encountered: