-
Notifications
You must be signed in to change notification settings - Fork 867
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
kue (reds?) creates always a Redis connection to localhost when requiring #54
Comments
I'm confused - are you using Kue or reds? I haven't used reds, but in looking at the package.json, it doesn't look like it uses Kue. If we just focus on Kue and look at your example, you're requiring the node.js Redis client, but not actually overriding the Kue function that creates the client. Try the following to create a Kue instance (named
|
I'm using Kue and Kue uses Reds under the hood. As I stated, it doesn't help if you override the creator function in kue. Your code fails with the same error. |
What version of Kue are you using? I just ran the above code using Kue 0.2.0 without issue. Your code (and subsequent stack trace) wasn't overriding the Kue creator function - can you provide code that overrides the creator function and the stack trace? |
I'm using Kue master from Github. Is there a Redis instance running on your localhost when you tested the code? |
I'll get this if I use the code you posted (just changed the server and port):
|
Also if add an another Redis instance to my localhost: Both Redis instances, remote and the local, will get connected when I run your code and I won't get the error. Obviously. |
Ok, I see what's happening now. I was looking at the 0.2.0 release, not master. I have a workaround - it's not pretty, but it works :)
|
In order for this to work, you'll need to make sure reds is installed for your application (with |
haha the joys of trying to share config like this blah. Yeah, we'll definitely need a reasonable solution for this in the next release. We dont have much choice other than to do |
The thing that makes this tricky is that This change updates |
it's ideal as far as simplicity goes but yeah im fine with changing it for this |
@davidwood merged I wish we could do it with less of a hack, but I can't think of anything off hand |
I'm with you - it works, but doesn't feel quite right |
hi, the problem still exists, with version 0.3.2 :/ is there any fix now? i'm trying to use kue on different machines with one redis server :) Update: switched to 0.3.1. - everything working fine... |
I don't understand the assertion that Kue uses Reds under the hood when Reds was written to emulate Kue? |
@ntresch huh? reds is full-text search, nothing more |
@visionmedia "I'm using Kue and Kue uses Reds under the hood.", was said by @epeli. I don't believe that this is true, and I don;t understand the assertion, hence the question. |
it is true, Kue uses Reds for the search |
That makes more sense, with the qualification "for the search", and I see it now in the source. Thanks! |
This is still an issue for 0.4.0: Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED |
Yep same with 0.5.0 |
Pretty sure this is still happening, I can't stop the connection to localhost |
Still an issue with 0.7.5. Any chance of seeing a fix for this soon? |
@schonfeld would you provide the code for reproducing this? |
@schonfeld !!!!???? |
I wandered over from Google, but this is happening to me in a standard node/redis/express app (bare bones..). Running on locahost connecting to a remote redis server (Elasticache on AWS) works fine, but from my EC2 server that doesn't have redis installed I can't seem to connect, since it tries to connect to localhost first even though I have config specific for the remote server running. Sorry for off-topic, but this was one of few places I found this issue. |
would u please provide the stack trace of connection error? |
We forked awhile ago (0.5.0) and updated locally: https://github.com/floored/kue/commit/ec021e07b6ceea9f77bb9556ac2fb8035a880620. Never did a pull request because we assumed it would get fixed "for real". |
should be fixed in 0.8 |
I'm trying to connect with Redis that is deployed on Heroku and I used the example @davidwood provided but I am still receiving the Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED. Any other ideas on how to fix this? |
@rvbsanjose make sure if you are calling createQueue(...) before accessing |
@behrad I feel like a dummy. I was following along with the tutorials and never bothered to read the full doc on connecting. Once I read further down the doc page and followed the instructions, it worked just fine. Sorry for the inconvenience. |
What was the solution? I am getting this problem after a successful connect to a non-localhost url. |
I've been beating my head against this wall for a full day now. I'm running kue version 0.11 and node 4.5 but still cannot connect to a remote host. here is what my connection looks like:
No matter what I try I get the same error back:
I have tried every example I can find and still nothing.. :( Any help is greatly appreciated. |
@eaglevision20 closest thing I could find: #875 If I have time I'll fork and look.. Maybe check the Pull Requests |
Still facing the same issue. Tried all the examples and pull requests too. Please help. Its still creating queue with local redis. Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED 127.0.0.1:6379 |
@ganeshcse2991 as was said in comment earlier #54 (comment) Problem is requiring app from kue before creating a queue. Something like this: |
@behrad thanks for the input about
|
Don't know if this is kue or reds issue, but it certainly affects kue. Tested on kue master.
Consider following:
It dies immediately after kue is required in the timeout:
Creates a second connection to localhost?
I think the reason is here:
A search is created on require
https://github.com/LearnBoost/kue/blob/b2cd5d3393d12e4bdd1c2e654a3ef5eb45e5bf11/lib/queue/job.js#L27
which means new Search on Reds
https://github.com/visionmedia/reds/blob/156c046803df6b96fa40e90be26b933f7d324d01/lib/reds.js#L68
which then again means a new Redis client which connects to localhost
https://github.com/visionmedia/reds/blob/156c046803df6b96fa40e90be26b933f7d324d01/lib/reds.js#L236
This happens also if you override the createClient function in kue.
The text was updated successfully, but these errors were encountered: