-
-
Notifications
You must be signed in to change notification settings - Fork 256
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
InvalidOperationException cannot hijack chunked ... stream
(Rancher Desktop, Docker Desktop 4.10.0)
#431
Comments
any update on this? I'd really like to use this library but it's not possible with Rancher Desktop |
With the latest changes (in the |
So I tried the latest changes in Develop, to no avail, however I have made a local hack that at least allows this to work.. static Func<Task<IDbConnection>> GetDockerizedDb = async () =>
{
var pw = "tmpTest(!)Password123";
var dbConfig = new MsSqlTestcontainerConfiguration("mcr.microsoft.com/mssql/server:2019-latest");
dbConfig.Password = pw;
var testcontainersBuilder = new TestcontainersBuilder<MsSqlTestcontainer>().WithDatabase(dbConfig);
var containers = testcontainersBuilder.Build();
await containers.StartAsync();
var conn = new SqlConnection(containers.ConnectionString.Replace("localhost,", "127.0.0.1,"));
await conn.OpenAsync();
await conn.ExecuteAsync(File.ReadAllText("SharedTests/sundb.setup.sql"));
return conn;
}; |
Update: I have an open PR to that repo that adds an option to the configuration that will allow this project to specify the http version |
@HofmeisterAn Could we have a discussion about how you would best like to integrate the changes required in this library? I had hoped to make as non-intrusive a change as possible for backwards compatibility but I've gone down a rabbit hole of changes in order to include it in the configuration, and the issue is that the instance of the dockerclient that is used is currently pulled in by calling a new DotNet.Testcontainers.Configurations.Windows Basically the client is instantiated in DockerEndpointAuthenticationConfiguration in the method, and the HttpVersion (configured by the user, or the context detecting that rancher desktop is being run ) would be have to be configured there, but because its internal, the end user has no access / control over that.. public DockerClientConfiguration GetDockerClientConfiguration()
{
return new DockerClientConfiguration(this.Endpoint) { HttpVersion = this.HttpVersion };
} Initially I just wanted to add a public Version HttpVersion { get; } to that DockerEndpointAuthenticationConfiguration , but as it is all called internally by the TestcontainersContainer constructor via the TestcontainersClient, the changes I was making were starting to sprawl. How would be your preferred way of solving this issue? Autodetect the runtime / api that is running? Some kind of extension method like the following? dbConfig.Password = pw;
var testcontainersBuilder = new TestcontainersBuilder<MsSqlTestcontainer>()
.WithHttpVersion(new(1, 0))
.WithDatabase(dbConfig); Just need some guidance here so I don't waste a whole bunch of everybody's time.. |
I know this is an important issue for anyone that can't use Docker. I haven't had enough time to take a close look into the issue yet, but I prepared a test environment and read the I don't think, changing the HTTP version to
|
I'm glad I asked! =) Thanks for the update, I guess meanwhile we'll internally use this workaround, but I look forward to hearing your thoughts on how you'd like to solve this issue when you find the time. Obviously, whatever help I can give is yours. Great project btw! |
Since this issue specifically mentions Rancher, I'm not sure if this is the place to mention this or not. But immediately after upgrading to Docker Desktop 4.10, I started seeing the same "cannot hijack chunked or content length stream" exception. I uninstalled 4.10, reinstalled 4.9, and everything works again. |
I can confirm. It's broken for Docker Desktop for Windows (4.10.0) too. We need a fix in dotnet/Docker.DotNet#554. |
cannot hijack chunked ... stream
(Rancher Desktop, Docker Desktop for Windows 4.10.0)
Same on Docker Desktop for Mac (4.10.0) it seems, downgrading to 4.9.1 makes the error go away.
|
cannot hijack chunked ... stream
(Rancher Desktop, Docker Desktop for Windows 4.10.0)cannot hijack chunked ... stream
(Rancher Desktop, Docker Desktop 4.10.0)
Getting this bug as well after updating to 4.10. |
Quick update because I know a couple of devs waiting for a fix. We’re trying to contact the maintainers. If that somehow won’t work we'll fork and fix it. |
Getting this bug as well. We're using TestContainers quite heavily for integration testing. Hoping for a quick fix. |
@Jejuni Your devs can downgrade to 4.9.1. The patch I'm suggesting works fine on my environment. I just need to get it to the upstream. I'll think about how we could mange this with a fork in the meantime. |
I've emailed the @dotnet-foundation and asked if they can help us, or if I can get access to the repository. I prefer a fix in the upstream. A fork should be the last option. |
@HofmeisterAn just coming across this. I also reached out to the .NET Foundation Maintainers committee on the Discord & Slack to see if pinging there might help move it along. In a way, I'm relieved -- was testing Testcontainers for the first time (LOVE the idea!) and thought I'd done something wrong 😅 |
@SeanKilleen Thanks, for reaching out too. I hope we find a way to fix the upstream soon. Especially, because I have a patch and it's a bad first impression using the latest Docker Desktop version. |
@HofmeisterAn another thought -- many of us, including me, now pay for Docker Pro. Since this changed as of 4.10, perhaps we can open a support request / issue and see if docker has any flexibility on their end? I know it doesn't seem to be a "breaking change" in the classical sense, but given the impact, maybe they'd consider options. |
Just to update the group here -- the maintainer responded and So I think as soon as we get a new release of testcontainers-dotnet with the updated |
I've deployed a snapshot version |
I just updated to Great job (Y) I'm running Windows |
works like a charm. |
Worked for me too! 🎉 |
We can also confirm that Thank you for the great work, and great to see the amount of support and activity around this project! |
I can also confirm that using Thanks all! |
Awesome 🥳 I'll publish a release version later that day. Thanks for your response. |
The version Tried out using docker desktop version Thank you!! |
I can confirm that using 2.1.0-beta.2698157448 works on Mac OSX Arm64 and on windows with Rancher desktop 1.4.1 |
Former was deprecated and replaced by latter. Ran into issue detailed testcontainers/testcontainers-dotnet#431 Slight change in when ConnectionString is assigned for postgres container led to change in DlcsDatabaseFixture
Describe the bug
Please see this bug reported by someone else in Docker DotNet:
dotnet/Docker.DotNet#554
My own response to this:
dotnet/Docker.DotNet#554 (comment)
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Unit test passes
Desktop (please complete the following information):
Workaround
2.1.0-beta.2698157448
4.9.x
The text was updated successfully, but these errors were encountered: