-
Notifications
You must be signed in to change notification settings - Fork 848
Connection to host errors with stack test/repl and docker #2962
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
Comments
That's not necessarily the correct expectation. Especially with Using Recommended replacement: replace BTW, the command is passing before Also, your "reproduction" isn't really self-contained enough to try this out. There might be a million reasons the problem happens. |
Closing for now, just to avoid leaving it open in case nothing happens. However, please reopen or comment if I turn out to be wrong, troubleshooting suggests further issues, or if the Stack documentation could be improved. |
Those Stack Docker settings allow I've used |
Oh I see you're on Mac. So Docker is creating containers inside a separate Linux virtual machine. Still, not enough logs to troubleshoot this, nor a reproduction. In particular, it's far from clear Also: what kind of IP is being used to connect to the database? I'm reopening for further investigation, but I'm still not sure stack can do much. |
Coming back to this particular project, I find the database is being connected to. I'm going to put it down to an unforeseen consequence of unrelated system noodling for other work. To round out the information for posterity, I still have errors for those integration tests when run via Docker, but I anticipate those to be something for me to deal with, and I'll close this issue. Thx for your help, @Blaisorblade |
Whilst
stack exec
is able to connect back to my host DB when docker is enabled,stack test
andstack repl
give a connection refused error.Steps to reproduce
Have an integration test using a database connection.
Setup stack.yaml:
Run command
stack test
.Expected
I expected the tests to pass, as they do when running locally with
stack --no-docker test
.Actual
I see errors of type
uncaught exception: IOException of type NoSuchThing (connect: does not exist (Connection refused))
.Here's the underlying
docker create
command:Stack version
Method of installation
Homebrew install.
Other versions
Docker: Version 1.13.0 (15072)
Docker image: fpco/stack-build:lts-7.18
OS: macOS Sierra
DB: MongoDB v3.4.1 using port 27017, bound to all interfaces.
The text was updated successfully, but these errors were encountered: