testcontainers-java: "No such image: testcontainers/ryuk:0.3.0"

Testcontainers 1.15.0 on Docker Engine 20.10/Docker for Mac 2.5.4 fails with the following stacktrace:

org.testcontainers.containers.ContainerLaunchException: Container startup failed

	at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:327)
	at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:308)
	at org.testcontainers.spock.TestcontainersMethodInterceptor.startContainers_closure3(TestcontainersMethodInterceptor.groovy:83)
	at groovy.lang.Closure.call(Closure.java:405)
	at groovy.lang.Closure.call(Closure.java:421)
	at org.testcontainers.spock.TestcontainersMethodInterceptor.startContainers(TestcontainersMethodInterceptor.groovy:80)
	at org.testcontainers.spock.TestcontainersMethodInterceptor.interceptSetupSpecMethod(TestcontainersMethodInterceptor.groovy:25)
	at org.spockframework.runtime.extension.AbstractMethodInterceptor.intercept(AbstractMethodInterceptor.java:36)
	at org.spockframework.runtime.extension.MethodInvocation.proceed(MethodInvocation.java:97)
	at org.spockframework.spring.SpringInterceptor.interceptSetupSpecMethod(SpringInterceptor.java:37)
	at org.spockframework.runtime.extension.AbstractMethodInterceptor.intercept(AbstractMethodInterceptor.java:36)
	at org.spockframework.runtime.extension.MethodInvocation.proceed(MethodInvocation.java:97)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
	at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
	at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:220)
	at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:53)
Caused by: org.testcontainers.containers.ContainerFetchException: Can't get Docker image: RemoteDockerImage(imageName=couchdb:1.7.2, imagePullPolicy=DefaultPullPolicy())
	at org.testcontainers.containers.GenericContainer.getDockerImageName(GenericContainer.java:1278)
	at org.testcontainers.containers.GenericContainer.logger(GenericContainer.java:612)
	at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:317)
	... 16 more
Caused by: com.github.dockerjava.api.exception.NotFoundException: Status 404: {"message":"No such image: testcontainers/ryuk:0.3.0"}

	at org.testcontainers.shaded.com.github.dockerjava.core.DefaultInvocationBuilder.execute(DefaultInvocationBuilder.java:241)
	at org.testcontainers.shaded.com.github.dockerjava.core.DefaultInvocationBuilder.post(DefaultInvocationBuilder.java:125)
	at org.testcontainers.shaded.com.github.dockerjava.core.exec.CreateContainerCmdExec.execute(CreateContainerCmdExec.java:33)
	at org.testcontainers.shaded.com.github.dockerjava.core.exec.CreateContainerCmdExec.execute(CreateContainerCmdExec.java:13)
	at org.testcontainers.shaded.com.github.dockerjava.core.exec.AbstrSyncDockerCmdExec.exec(AbstrSyncDockerCmdExec.java:21)
	at org.testcontainers.shaded.com.github.dockerjava.core.command.AbstrDockerCmd.exec(AbstrDockerCmd.java:35)
	at org.testcontainers.shaded.com.github.dockerjava.core.command.CreateContainerCmdImpl.exec(CreateContainerCmdImpl.java:595)
	at org.testcontainers.utility.ResourceReaper.start(ResourceReaper.java:91)
	at org.testcontainers.DockerClientFactory.client(DockerClientFactory.java:203)
	at org.testcontainers.LazyDockerClient.getDockerClient(LazyDockerClient.java:14)
	at org.testcontainers.LazyDockerClient.listImagesCmd(LazyDockerClient.java:12)
	at org.testcontainers.images.LocalImagesCache.maybeInitCache(LocalImagesCache.java:68)
	at org.testcontainers.images.LocalImagesCache.get(LocalImagesCache.java:32)
	at org.testcontainers.images.AbstractImagePullPolicy.shouldPull(AbstractImagePullPolicy.java:18)
	at org.testcontainers.images.RemoteDockerImage.resolve(RemoteDockerImage.java:66)
	at org.testcontainers.images.RemoteDockerImage.resolve(RemoteDockerImage.java:27)
	at org.testcontainers.utility.LazyFuture.getResolvedValue(LazyFuture.java:17)
	at org.testcontainers.utility.LazyFuture.get(LazyFuture.java:39)
	at org.testcontainers.containers.GenericContainer.getDockerImageName(GenericContainer.java:1276)
	... 18 more

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 28
  • Comments: 61 (24 by maintainers)

Commits related to this issue

Most upvoted comments

Ok, “filter by image name” query parameter in /images/json got removed, and now this condition fails: https://github.com/testcontainers/testcontainers-java/blob/d135a2605401f6c663aab4e7edc6d6d76716f930/core/src/main/java/org/testcontainers/DockerClientFactory.java#L330

I just submitted #3575 with a fix, will be included in 1.15.1

released in 1.15.1 🎉

I confirm that after upgrading to test containers 1.15.1 I no longer have this issue

Thanks @bsideup for the quick fix!

@mderouet the release is expected for later today (tsss 😉)

404 and {"message":"No such image: testcontainers/ryuk:0.3.0"} is what we actually get from the API.

Also, testcontainers/* images are exempt from rate limiting, or at least that’s what they told us 😃

@bsideup Thank you for your response! Sorry, it was my fault. Thanks to your response I’ve dug deeper into the project and I’ve realised that we were using another Testcontainers dependency, org.testcontainers:selenium that was not updated. So now, both dependencies has been updated to the latest version (1.15.3) and it’s properly working 😉

Thank you and I apologise for the inconvenience.

In my case, it’s passing locally on Mac with latest Docker for Mac stable (but I have those images in my cache though) and failing on GitLab.

just pull it manualy by console “docker pull testcontainers/ryuk:0.3.0”

@davoutuk with Testcontainers 1.15.1? There was a bug that got fixed in 1.15.1, there isn’t such prerequisite

It works, thanks

I suppose that the 404 is the local Docker Engine and no lookup to any registry is made. In this case I don’t use any private registry, the engine is directly connecting to the Docker Hub. Manual testcontainers/ryuk:0.3.0 fixes the issue.

I got an update from Docker today, and I got Docker desktop-3.0.1 (50773).

Now I get an error while running Test container.

...... <<< ERROR! org.testcontainers.containers.ContainerLaunchException: Container startup failed Caused by: org.testcontainers.containers.ContainerFetchException: Can't get Docker image: RemoteDockerImage(imageName=postgres:11.7, imagePullPolicy=DefaultPullPolicy()) Caused by: com.github.dockerjava.api.exception.NotFoundException: {"message":"No such image: testcontainersofficial/ryuk:0.3.0"}

I assumed you fixed it. I also disabled the Use gRPC FUSE for file sharing option, but it didn’t help.

How can I fix this ?

@jdelucaa yes, this Docker API change applies to most of Testcontainers versions.

@DaspawnW this is not junit specific and, once released, will work with any type of integration (junit4, junit jupiter, spock, manual container lifecycle)

@gesellix we definitely pull the image if it is not available.

The other thing I suspected was maybe we’re hitting the Docker Hub pull limits?

In that case, an error would differ (unless the Docker Hub team have decided that 404 is a perfect http status code for a rate limited response, which should be 5xx instead)

That’s what I was worried about, yea. But I’m not sure if that’s what’s going on or not yet.