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

[Bug]: Error (501) Reason: connection reset by peer #1248

Closed
meysamhadeli opened this issue May 28, 2023 · 5 comments
Closed

[Bug]: Error (501) Reason: connection reset by peer #1248

meysamhadeli opened this issue May 28, 2023 · 5 comments
Labels
bug An issue with the library

Comments

@meysamhadeli
Copy link

meysamhadeli commented May 28, 2023

Testcontainers version

v0.15.0

Using the latest Testcontainers version?

Yes

Host OS

Windows

Host arch

X64

Go version

1.19

Docker version

Docker Desktop 4.16.3
OS/Arch: linux/amd64

What happened?

Hi,
I get this error sometime in my GitHub action pipeline in my tests and for example connection for RabbitMQ and Postgres with test-container couldn't be established.
I don't have any problem to run my test with test-container in my local machine. But I get sometime this error connection reset by peer in my GitHub action test pipeline!, And sometimes it would be passed!

Could you give me some help?
Thanks.

@meysamhadeli meysamhadeli added the bug An issue with the library label May 28, 2023
@mdelapenya
Copy link
Member

Hi @meysamhadeli 👋 ! From the bug report I see you are using tc-go v0.15.0, which is a very outdated one. Could you try with latest released version, which is v0.20.1?

In the meantime, could you share a link to the GH action run so we can lookup the logs?

@meysamhadeli
Copy link
Author

Hi @meysamhadeli 👋 ! From the bug report I see you are using tc-go v0.15.0, which is a very outdated one. Could you try with latest released version, which is v0.20.1?

In the meantime, could you share a link to the GH action run so we can lookup the logs?

Hi @mdelapenya, thanks for response. Ok, I will check this issue with latest version and come back :)
Yes, If I had some problem again with latest version, I will share my logs in GitHub action.

@meysamhadeli
Copy link
Author

meysamhadeli commented May 29, 2023

I upgraded the version of test-container to v0.20.1 and now I get this error protocol not available, failed to create Docker provider for all of my containers!

This is a simple test that I executed for test new version v0.20.1 of test-container:

package mongodb

import (
	"context"
	"github.com/testcontainers/testcontainers-go"
	"github.com/testcontainers/testcontainers-go/wait"
	"testing"
)

func TestMongoDB(t *testing.T) {
	ctx := context.Background()

	req := testcontainers.ContainerRequest{
		Image:        "mongo:5",
		ExposedPorts: []string{"27017/tcp"},
		WaitingFor: wait.ForAll(
			wait.ForLog("Waiting for connections"),
			wait.ForListeningPort("27017/tcp"),
		),
	}
	
	container, err := testcontainers.GenericContainer(ctx, testcontainers.GenericContainerRequest{
		ContainerRequest: req,
		Started:          true,
	})

	if err != nil {
		t.Fatal(err)
	}

	// Clean up the container after the test is complete
	t.Cleanup(func() {
		if err := container.Terminate(ctx); err != nil {
			t.Fatalf("failed to terminate container: %s", err)
		}
	})
}

also for sample test in test-container project, I get the same error.

@mdelapenya
Copy link
Member

Ok, so it seems an issue with Windows and how we are bootstrapping the Docker client.

I think this issue has been already reported in #1249, so if you agree, let me close this so that we can continue in that one 🙏

@meysamhadeli
Copy link
Author

Ok, After fix this bug in new version, I follow my problem :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue with the library
Projects
None yet
Development

No branches or pull requests

2 participants