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

Always tries to connect to 127.0.0.1:8500 #65

Closed
devth opened this issue Mar 21, 2016 · 10 comments
Closed

Always tries to connect to 127.0.0.1:8500 #65

devth opened this issue Mar 21, 2016 · 10 comments

Comments

@devth
Copy link
Contributor

devth commented Mar 21, 2016

This seems to be a recent problem. When I run git2consul, regardless of my endpoint config, it's trying to hit 127.0.0.1:8500 for some reason:

"err": {"message":"connect ECONNREFUSED 127.0.0.1:8500", ...}

I'm running latest. Verified global.endpoint is correct by logging it.

@calvn
Copy link
Contributor

calvn commented Mar 21, 2016

The only reference (apart from utils/config_seeder.js) on 127.0.0.1 is on #L12. How are you passing in the endpoint option, with -e, --endpoint flag or with the environment variable CONSUL_ENDPOINT?

@devth
Copy link
Contributor Author

devth commented Mar 21, 2016

I've tried all 3. And global.endpoint is correct.

@devth
Copy link
Contributor Author

devth commented Mar 21, 2016

Here's the rest of the err:

{"stack":"Error: connect ECONNREFUSED 127.0.0.1:8500\n    at Object.exports._errnoException (util.js:874:11)\n    at exports._exceptionWithHostPort (util.js:897:20)\n    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1063:14)","code":"ECONNREFUSED"},"msg":"connect ECONNREFUSED 127.0.0.1:8500","time":"2016-03-21T15:30:23.604Z","v":0}

Maybe the problem is on my end. Still investigating...

@devth
Copy link
Contributor Author

devth commented Mar 21, 2016

127.0.0.1 is coming from the consul lib. When it's required here, global is undefined.

@calvn
Copy link
Contributor

calvn commented Mar 21, 2016

Is it because index.js is requiring config_seeder.js and config_reader.js before the variables are being set?

@devth
Copy link
Contributor Author

devth commented Mar 21, 2016

Yes. Happened in d89f571

@calvn
Copy link
Contributor

calvn commented Mar 21, 2016

Going to issue a patch for that, thanks for the report!

@devth
Copy link
Contributor Author

devth commented Mar 21, 2016

Great, thanks!

@calvn
Copy link
Contributor

calvn commented Mar 21, 2016

This should be patched on v0.12.8 now.

@devth
Copy link
Contributor Author

devth commented Mar 21, 2016

@cleung2010 thanks, works now!

@devth devth closed this as completed Mar 21, 2016
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