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

Issue with connecting to Mongodb #20

Open
ssriram1 opened this issue Mar 14, 2017 · 2 comments
Open

Issue with connecting to Mongodb #20

ssriram1 opened this issue Mar 14, 2017 · 2 comments

Comments

@ssriram1
Copy link

Hi,
I just installed cyclotron on OSX El Capitan and I am trying to run app.js from inside cyclotron-svc. I keep getting this error related to connecting to port 27017. I have checked using netstat that mongod is running and listening on port 27017.

Thanks in advance!

Needs latest SSL Root Certificate Authority data /Users/sriram/Documents/dashboards/cyclotron/cyclotron-svc/node_modules/ssl-root-cas/ssl-root-cas-latest.js
Loading latest certificates from https://mxr.mozilla.org/nss/source/lib/ckfw/builtins/certdata.txt?raw=1
Cyclotron running on port 8077

/Users/sriram/Documents/dashboards/cyclotron/cyclotron-svc/node_modules/mongoose/node_modules/mongodb/lib/server.js:242
        process.nextTick(function() { throw err; })
                                      ^
Error: connect ECONNREFUSED ::1:27017
    at Object.exports._errnoException (util.js:1033:11)
    at exports._exceptionWithHostPort (util.js:1056:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1105:14)```
@baumandm
Copy link
Collaborator

Hi @ssriram1, I think this is related to #13, with the service binding to IPv6 instead of IPv4. Can you try making the following change at the very bottom of cyclotron-svc/app.js:

app.listen(port, '0.0.0.0', function(){
    console.log('Cyclotron running on port %d', port);
});

@baumandm
Copy link
Collaborator

Hi @ssriram1, I'm looking at this again and I realized I totally misread your issue. I saw ::1:27017 which looks like an IPv6 issue, and thought it was the same as the other issue.

Maybe localhost isn't resolving on your machine, so you can try updating the Mongo config in config/config.js with the actual IP address:

mongodb: 'mongodb://127.0.0.1:27017/cyclotron',

Does the Mongo shell connect successfully as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants