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

"No such image: testcontainers/ryuk:0.3.0"

Open gesellix opened this issue 5 years ago • 62 comments

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

gesellix avatar Dec 09 '20 20:12 gesellix

released in 1.15.1 🎉

bsideup avatar Dec 11 '20 17:12 bsideup

It works, thanks

telapo avatar Dec 14 '20 12:12 telapo

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 ?

alex-sky-cloud avatar Dec 14 '20 16:12 alex-sky-cloud

@alex-sky-cloud this is another issue, unrelated to the file sharing, and it is fixed in 1.15.1, please update.

bsideup avatar Dec 14 '20 16:12 bsideup

I'm sorry. What should I update ?

alex-sky-cloud avatar Dec 14 '20 16:12 alex-sky-cloud

@alex-sky-cloud the project you're reporting to - Testcontainers :D

bsideup avatar Dec 14 '20 16:12 bsideup

I have the latest version of docker.

Which project should I update ?

I executed the

docker system prune-af

command and only after that the error disappeared.

So, is this how you will need to do it every time ?

alex-sky-cloud avatar Dec 14 '20 16:12 alex-sky-cloud

@alex-sky-cloud No. Just use the latest (1.15.1) version of Testcontainers.

bsideup avatar Dec 14 '20 16:12 bsideup

This issue is still live for me when I tried using this on a Spring Boot/Postgres app. The fix of separating downloading the 'testcontainer' docker image works.
I would suggest adding a note to the docs to explain that this is a pre requiste

davoutuk avatar Dec 19 '20 21:12 davoutuk

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

bsideup avatar Dec 19 '20 21:12 bsideup

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

AlexeyPashchenko avatar Dec 21 '20 15:12 AlexeyPashchenko

i understand this might not work for every case but what fixed for me was to clean purge data and reset to factory settings

is this the best way? i dont know as i am new to docker and test containers.

image

hafizali05 avatar Dec 31 '20 10:12 hafizali05

@hafizali05 this is not usually needed, unless your images cache is corrupted.

bsideup avatar Dec 31 '20 11:12 bsideup

@hafizali05 this is not usually needed, unless your images cache is corrupted.

i cant reproduce this bit again so if this persist again i might try to find out a way to only clear image cache. this ofcourse removed all my images and containers. @bsideup

hafizali05 avatar Dec 31 '20 12:12 hafizali05

I confirm that after upgrading to test containers 1.15.1 we no longer have this issue on apache/james-project

jeantil avatar Dec 31 '20 12:12 jeantil

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

jeffnyauke avatar Jan 15 '21 07:01 jeffnyauke

In my case, I have solved this problem cleaning all my docker-images.

However, upgrading, my POM.XML, to test containers 1.15.1, already, is a solution to his trouble.

CodeGTDLearn avatar Jan 16 '21 22:01 CodeGTDLearn

Hi. It seems that this error is happening again. With the following versions:

  • Docker Desktop for Mac 3.3.1.
  • Docker engine 20.10.5
  • Testcontiners 1.15.3
  • Gradle 5.4

It's failing with the same error:

java.lang.RuntimeException: Could not create new instance of class org.jboss.arquillian.test.impl.EventTestRunnerAdaptor
	at org.jboss.arquillian.test.spi.SecurityActions.newInstance(SecurityActions.java:146)
	at org.jboss.arquillian.test.spi.SecurityActions.newInstance(SecurityActions.java:89)
	at org.jboss.arquillian.test.spi.TestRunnerAdaptorBuilder.build(TestRunnerAdaptorBuilder.java:49)
	at org.jboss.arquillian.junit.AdaptorManager.initializeAdaptor(AdaptorManager.java:21)
	at org.jboss.arquillian.junit.ArquillianTestClassLifecycleManager.beforeTestClassPhase(ArquillianTestClassLifecycleManager.java:24)
	at org.jboss.arquillian.junit.ArquillianTestClass$1.evaluate(ArquillianTestClass.java:39)
	at org.spockframework.runtime.extension.builtin.ClassRuleInterceptor.intercept(ClassRuleInterceptor.java:39)
	at org.spockframework.runtime.extension.MethodInvocation.proceed(MethodInvocation.java:97)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.runTestClass(JUnitTestClassExecutor.java:110)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:58)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:38)
	at org.gradle.api.internal.tasks.testing.junit.AbstractJUnitTestClassProcessor.processTestClass(AbstractJUnitTestClassProcessor.java:62)
	at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:51)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
	at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
	at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:118)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
	at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:175)
	at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:157)
	at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:404)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.reflect.InvocationTargetException
	at org.jboss.arquillian.test.spi.SecurityActions.newInstance(SecurityActions.java:144)
	... 28 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 com.adaptavist.testfixtures.testcontainers.TestHostApplicationContainerProvider.<init>(TestHostApplicationContainerProvider.groovy:23)
	at com.adaptavist.testfixtures.application.BaseTestHostApplication.<init>(BaseTestHostApplication.groovy:18)
	at com.adaptavist.testfixtures.application.JiraCoreTestHostApplication.<init>(JiraCoreTestHostApplication.groovy:9)
	at com.adaptavist.arquillian.TestHostApplicationInstanceRegistrar.registerScriptRunnerFixture(TestHostApplicationInstanceRegistrar.groovy:20)
	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
	at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:103)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:90)
	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:133)
	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:105)
	at org.jboss.arquillian.core.impl.ManagerImpl.start(ManagerImpl.java:253)
	at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.<init>(EventTestRunnerAdaptor.java:61)
	... 29 more

I've tried to downgrade Docker Desktop and it was failing until Docker Desktop Community 2.5.0.1, which is using Docker engine 19.03.13. So with this last version (and keeping the same Testcontainers versions) is working.

Also, I've applied the workaround of manually downloading the image testcontainers/ryuk:0.3.0 and with this workarodund is working for the last Docker Desktop version (3.3.1).

So please, if someone else is facing the same problem, maybe it's worth to have a look if something has broken with this last Docker version.

Thank you!

MiguelAngel82 avatar Apr 27 '21 12:04 MiguelAngel82

@MiguelAngel82 Testcontainers 1.15.3 depens on Ryuk 0.3.1, meaning that you're still using an older version of Testcontainers

bsideup avatar Apr 27 '21 12:04 bsideup

@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.

MiguelAngel82 avatar Apr 28 '21 06:04 MiguelAngel82