-
-
Notifications
You must be signed in to change notification settings - Fork 512
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
[Bug]: Failing with "protocol not available, failed to create Docker provider" on Windows #1249
Comments
@mdelapenya I see the breaking change had been introduced with #941. I fear I don't understand the big picture entirely; I see from the commit message that the break in API was intentional:
|
@danielorbach indeed, we had to break that method signature in order to reach to a cleaner state. In #1161 we are doing great progress towards having a consistent strategy to bootstrap the Docker client, discovering the Docker host and docker socket path in a single and deterministic manner. Hopefully it will resolve inconsistencies regarding docker alternatives and different setups in the environment/configuration. Could you give it a try? It was merged past Friday, so I think you could use that commit in your go.mod file |
Thank you for the quick reply!
Tests still fail with the same error as before 😢 I've taken the commit from the pull request: $ go get github.com/testcontainers/testcontainers-go@08a56c9c2999d58db13dacd9b7e445acf3272fdc
go: downloading github.com/testcontainers/testcontainers-go v0.20.2-0.20230526123138-08a56c9c2999
go: downloading golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea
go: upgraded github.com/imdario/mergo v0.3.13 => v0.3.15
go: upgraded github.com/testcontainers/testcontainers-go v0.20.1 => v0.20.2-0.20230526123138-08a56c9c2999
go: upgraded golang.org/x/exp v0.0.0-20230124195608-d38c7dcee874 => v0.0.0-20230510235704-dd950f8aeaea - github.com/testcontainers/testcontainers-go v0.19.0
+ github.com/testcontainers/testcontainers-go v0.20.2-0.20230526123138-08a56c9c2999 |
Can reproduce on Windows 11. If I add I think the protocol part ( |
I still this error |
@mdelapenya I tried the latest Would you like me to propose a pull-request addressing this? |
Hi @danielorbach I'm back from a week on PTO, so I'm basically catching up today. Indeed, but IIRC we were ignoring windows containers, not windows usage... although I could probably have committed a mistake on it. I'm lacking a testing windows instance to perform consistent and repeatable tests for Windows at the moment, but this is something we are working on fixing it asap.
That would be super!
Indeed, we tried to have the docker socket resolution as simple as possible, so you could probably figure it out in a very easy manner |
Wouldn't it make sense in general to expand the GitHub Actions to be run on more than just Ubuntu? For example adding something like this to the test workflows? jobs:
test-postgres:
strategy:
matrix:
go-version: [1.19.x, 1.x]
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }} This would have detected this bug I think: https://github.com/sebastianbuechler/testcontainers-go/actions/runs/5270951017/jobs/9531389308 Btw: I think the pipeline is using the wrong path for the TestSummary action: - name: Test Summary
uses: test-summary/action@4ee9ece4bca777a38f05c8fc578ac2007fe266f7
with:
paths: "**/TEST-postgres*.xml"
if: always() Where in the gotestsum this is logged out: |
Indeed, a Windows worker would have caught it, although GH Windows workers does not support container operations: actions/runner#904 (comment) We are exploring Azure for that, and we will have a working Windows pipeline hopefully soon
Would you mind opening a separate ticket, and if able send a PR with the fix 🙏 ? I'd appreciate that! |
Thanks for the information. Hopefully it will work with the Azure approach 👍 |
v0.19.0
to v0.20.1
failing with "protocol not available, failed to create Docker provider"
Testcontainers version
0.20.1
Using the latest Testcontainers version?
Yes
Host OS
Windows
Host arch
x86
Go version
1.20
Docker version
Client: Cloud integration: v1.0.31 Version: 23.0.5 API version: 1.42 Go version: go1.19.8 Git commit: bc4487a Built: Wed Apr 26 16:20:14 2023 OS/Arch: windows/amd64 Context: default Server: Docker Desktop 4.19.0 (106363) Engine: Version: 23.0.5 API version: 1.42 (minimum version 1.12) Go version: go1.19.8 Git commit: 94d3ad6 Built: Wed Apr 26 16:17:45 2023 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.6.20 GitCommit: 2806fc1057397dbaeefbea0e4e17bddfbd388f38 runc: Version: 1.1.5 GitCommit: v1.1.5-0-gf19387a docker-init: Version: 0.19.0 GitCommit: de40ad0
Docker info
What happened?
I upgraded from
v0.19.0
usinggo get -u
and got the latestv0.20.1
.To my surprise running the same tests that had just passed now fails consistently with the message:
Looking deeper into the changelog of this release I see the error comes from
sockets.ConfigureTransport(transport, c.proto, c.addr)
atgithub.com/docker/[email protected]+incompatible/client/options.go:71
.This option function (
client.WithHost
) is not called by the previous version because of the introduction ofReadConfig()
.Previously, this option is only appended by
NewDockerClient()
only if the user-environment contains a.testcontainers.properties
file that explicitly sets the docker host.Nowadays, this option is always appended by
NewDockerClient()
becauseReadConfig()
always returns constant host, even when not explicitly set by the user-environment.Relevant log output
I've summarized the difference between the two tags (ignoring comments and whitespaces):
Additional information
Eventually, on Windows without any custom configuration,
v0.19.0
used to access the hostnpipe:////./pipe/docker_engine
.Without the
client.WithHost()
option, theDefaultDockerHost
is used correctly for Windows and never overridden.The text was updated successfully, but these errors were encountered: