Skip to content
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

Please help.. I get process.nextTick(function() { throw err; }) #2861

Closed
mithralaya opened this issue Apr 10, 2015 · 17 comments
Closed

Please help.. I get process.nextTick(function() { throw err; }) #2861

mithralaya opened this issue Apr 10, 2015 · 17 comments
Labels
can't reproduce Mongoose devs have been unable to reproduce this issue. Close after 14 days of inactivity. help This issue can likely be resolved in GitHub issues. No bug fixes, features, or docs necessary

Comments

@mithralaya
Copy link

Versions I am using

Ubuntu 14.04
MongoDB 3.0.1 with --storageEngine wiredtiger enabled
Mongoose 4.0.1
Node JS 0.12.2

My Dev environment is Mac and everything works good. I pointed my dev environment to live mongoDB and it works.

But when I try the same in my staging with the above versions I get the below error after a while.

/home/ShopWaveServices/api/Up/CoreDB/node_modules/mongoose/node_modules/mongodb/lib/server.js:228
        process.nextTick(function() { throw err; })
                                            ^
Error
    at Object.<anonymous> (/home/ShopWaveServices/api/Up/CoreDB/node_modules/mongoose/node_modules/mongodb/node_modules/mongodb-core/lib/error.js:42:24)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/home/ShopWaveServices/api/Up/CoreDB/node_modules/mongoose/node_modules/mongodb/node_modules/mongodb-core/index.js:2:17)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)

Please help.

I tried setting up auth in mongod, Ports are open for all the required IP addresses.

Please help me fix this.

Many thanks,
Karthik

@vkarpov15
Copy link
Collaborator

How are you connecting with mongoose? If the mongod server uses auth, are you specifying auth credentials when you connect?

@vkarpov15 vkarpov15 added the help This issue can likely be resolved in GitHub issues. No bug fixes, features, or docs necessary label Apr 10, 2015
@vkarpov15 vkarpov15 added this to the 4.0.2 milestone Apr 10, 2015
@mithralaya
Copy link
Author

Thank you for your fast response. It doesn't work even without --auth in mongod.

I get the same error. :)

Thank you..

@vkarpov15
Copy link
Collaborator

How are you connecting with mongoose? Can you connect using the shell?

@mithralaya
Copy link
Author

Yes I can connect it with the shell. Also I can connect mongoose without auth credentials in my Dev MacOS machine.

Same code doesnt work in Ubuntu. I also uninstalled and reinstalled mongoose just in the Ubuntu Machine.

Currently I connect without --auth like in my local and it works..

var path = 'mongodb://' + _config.mongoDB.dbHost + ':27017/' + _config.mongoDB.dbName;
        try
        {
            connect = mongoose.connect(path);
            //mongoose.set('debug', true);
        }
        catch(e)
        {
            console.log(e);
        }

I hope I understood your question properly.

Many thanks,
Karthik

@vkarpov15
Copy link
Collaborator

Hmm can you connect using the mongodb shell on the ubuntu machine? Also, can you make sure the path that you're passing to mongoose.connect() is correct?

@vkarpov15 vkarpov15 added the can't reproduce Mongoose devs have been unable to reproduce this issue. Close after 14 days of inactivity. label Apr 13, 2015
@vkarpov15 vkarpov15 modified the milestones: 4.0.3, 4.0.2 Apr 16, 2015
@vkarpov15
Copy link
Collaborator

No response for a couple weeks and can't repro. Re-open if still its an issue.

@vkarpov15 vkarpov15 removed this from the 4.0.3 milestone Apr 24, 2015
@luqman523
Copy link

This is still reproducible in 4.0.0 module.

@vkarpov15
Copy link
Collaborator

Please provide steps to repro @luqman523

@aug2uag
Copy link

aug2uag commented Sep 3, 2015

The matter in discussion can easily be debugged by inspecting the url/uri, and decreasing your timeout. If you find yourself with a timeout error at 1 - 10 ms, it serves as a good sanity check. Otherwise, what you are experiencing is likely due to an improper URL or import that you may also try to substitute as a connection string. In my experience this is not an issue.

@ishneetdua
Copy link

I am still getting the same problem
process.nextTick(function() { throw err; })
^
Error: connect ECONNREFUSED 165.225.138.63:27017
at Object.exports._errnoException (util.js:874:11)
at exports._exceptionWithHostPort (util.js:897:20)
at TCPConnectWrap.afterConnect as oncomplete

Using modulus.io mongodb

@vkarpov15
Copy link
Collaborator

Can you connect using the mongodb shell?

@azlanjamal
Copy link

Make sure you turn on mongodb by running 'mongod' inside your teminal or command line.

@anispy211
Copy link

Same issue :(

process.nextTick(function() { throw err; })
^
Error: getaddrinfo ENOTFOUND localhost
at errnoException (dns.js:44:10)
at GetAddrInfoReqWrap.onlookup as oncomplete

@anispy211
Copy link

Mongo server status:
waiting for connections on port 27017

@vkarpov15
Copy link
Collaborator

Try 127.0.0.1 instead of localhost

@CarlosMed
Copy link

@vkarpov15 Is there a reason why 127.0.0.1 works but not localhost?

@vkarpov15
Copy link
Collaborator

Not sure, DNS is up to your OS, mongoose and mongodb don't do anything with that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
can't reproduce Mongoose devs have been unable to reproduce this issue. Close after 14 days of inactivity. help This issue can likely be resolved in GitHub issues. No bug fixes, features, or docs necessary
Projects
None yet
Development

No branches or pull requests

8 participants