testcontainers-dotnet icon indicating copy to clipboard operation
testcontainers-dotnet copied to clipboard

SQL Image results in - NotFound, response={"message":"No such image: ghcr.io/psanetra/ryuk:2021.12.20"}

Open mumby0168 opened this issue 2 years ago • 2 comments

Describe the bug Given a configuration to create an azure sql server edge docker container, we get an error stating that NotFound, response={"message":"No such image: ghcr.io/psanetra/ryuk:2021.12.20"

To Reproduce Use the below config and start the container

new TestcontainersBuilder<TestcontainersContainer>()
            .WithImage("mcr.microsoft.com/azure-sql-edge")
            .WithEnvironment("SA_PASSWORD", Password)
            .WithEnvironment("ACCEPT_EULA", "Y")
            .WithPortBinding(Port, Port)
            .WithName(DirectoryApiConstants.Name + ".Tests")
            .WithWaitStrategy(
                Wait.ForUnixContainer()
                    .UntilPortIsAvailable(Port)
                    .UntilOperationIsSucceeded(() =>
                    {
                        try
                        {
                            CreateDatabases();
                        }
                        catch (SqlException e)
                        {
                            Console.WriteLine($"Failed to create DB, retrying. {e.Message}", e);
                            Task.Delay(1000).Wait();
                            return false;
                        }

                        return true;
                    }, 120))
            .Build();

Expected behavior Starts up a instance of the azure sql edge container.

Screenshots

Unhandled exception. Docker.DotNet.DockerImageNotFoundException: Docker API responded with status code=NotFound, response={"message":"No such image: ghcr.io/psanetra/ryuk:2021.12.20"}

   at Docker.DotNet.ContainerOperations.<>c.<.cctor>b__30_1(HttpStatusCode statusCode, String responseBody)
   at Docker.DotNet.DockerClient.HandleIfErrorResponseAsync(HttpStatusCode statusCode, HttpResponseMessage response, IEnumerable`1 handlers)
   at Docker.DotNet.DockerClient.MakeRequestAsync(IEnumerable`1 errorHandlers, HttpMethod method, String path, IQueryString queryString, IRequestContent body, IDictionary`2 headers, TimeSpan timeout, CancellationToken token)
   at Docker.DotNet.ContainerOperations.CreateContainerAsync(CreateContainerParameters parameters, CancellationToken cancellationToken)
   at DotNet.Testcontainers.Clients.DockerContainerOperations.RunAsync(ITestcontainersConfiguration configuration, CancellationToken ct)
   at DotNet.Testcontainers.Clients.TestcontainersClient.RunAsync(ITestcontainersConfiguration configuration, CancellationToken ct)
   at DotNet.Testcontainers.Containers.TestcontainersContainer.Create(CancellationToken ct)
   at DotNet.Testcontainers.Containers.TestcontainersContainer.StartAsync(CancellationToken ct)
   at DotNet.Testcontainers.Containers.ResourceReaper.GetAndStartNewAsync(Guid sessionId, IDockerEndpointAuthenticationConfiguration dockerEndpointAuthConfig, String ryukImage, TimeSpan initTimeout, CancellationToken ct)
   at DotNet.Testcontainers.Containers.ResourceReaper.GetAndStartNewAsync(Guid sessionId, IDockerEndpointAuthenticationConfiguration dockerEndpointAuthConfig, String ryukImage, TimeSpan initTimeout, CancellationToken ct)
   at DotNet.Testcontainers.Containers.ResourceReaper.GetAndStartDefaultAsync(IDockerEndpointAuthenticationConfiguration dockerEndpointAuthConfig, CancellationToken ct)
   at DotNet.Testcontainers.Clients.TestcontainersClient.RunAsync(ITestcontainersConfiguration configuration, CancellationToken ct)
   at DotNet.Testcontainers.Containers.TestcontainersContainer.Create(CancellationToken ct)
   at DotNet.Testcontainers.Containers.TestcontainersContainer.StartAsync(CancellationToken ct)
   at Program.<Main>$(String[] args) in C:\repos\packing\directory-api\tools\Whds.Directory.Up\Program.cs:line 11
   at Program.<Main>(String[] args)

Process finished with exit code -532,462,766.

Desktop (please complete the following information):

  • Version [e.g. 22]

Additional context Add any other context about the problem here.

mumby0168 avatar Jul 26 '22 06:07 mumby0168

I have seen this issue https://github.com/testcontainers/testcontainers-dotnet/issues/487#issue-1280073704 but not sure I followed if there was a fix for it, or if it just went away.

mumby0168 avatar Jul 26 '22 06:07 mumby0168

The same applies here as mentioned in: https://github.com/testcontainers/testcontainers-dotnet/issues/487#issuecomment-1163185930. The image is available.

HofmeisterAn avatar Jul 26 '22 14:07 HofmeisterAn

@mumby0168 could you please test it with one of the latest snapshot versions, like 2.2.0-beta.2835065501?

HofmeisterAn avatar Aug 11 '22 13:08 HofmeisterAn

@HofmeisterAn Hi! Sorry to bother, I am just trying it with the latest snapshot version and trying to create a selenium-hub. I'm getting this:

Docker API responded with status code=NotFound, response={"message":"No such image: testcontainers/ryuk0.3.4"}

Any suggestion?

imartinflores avatar Aug 23 '22 13:08 imartinflores

What Docker engine do you use (docker info)? Do you use a proxy? Private registry? Dose docker pull testcontainers/ryuk0.3.4 work?

HofmeisterAn avatar Aug 23 '22 13:08 HofmeisterAn

I am using Docker Community Engine 19.03.5 - I am under a vpn, can that be the issue ? The private registry is not being set up on this project, so it should not be in use.

docker pull testcontainers/ryuk0.3.4 returns Get https://registry-1.docker.io/v2/: dial tcp read: connection refused

imartinflores avatar Aug 23 '22 13:08 imartinflores

Sorry, there was a typo, it is docker pull testcontainers/ryuk:0.3.4.

HofmeisterAn avatar Aug 23 '22 14:08 HofmeisterAn

No problem. I m getting the same result anyways..

imartinflores avatar Aug 23 '22 14:08 imartinflores

I am under a vpn, can that be the issue ?

Yes. It looks like you are not able to pull images from Docker Hub. I have not found an official list, but Sonatype listing these.

HofmeisterAn avatar Aug 23 '22 14:08 HofmeisterAn

Makes sense, thanks for the quick response. I will try it out without the VPN. Thanks again!

imartinflores avatar Aug 23 '22 14:08 imartinflores

I'll close this issue. Don't hesitate to reopen it again if you have any further questions or problems.

HofmeisterAn avatar Sep 01 '22 18:09 HofmeisterAn

The latest version 2.1.0 fixed this issue for me.

mumby0168 avatar Sep 09 '22 11:09 mumby0168

@mumby0168 I was trying it with 2.2.0-beta, but seems the problem is related to the vpn I am working with.

imartinflores avatar Sep 09 '22 11:09 imartinflores