"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
@keeganwitt Docker's API. Although the query param was deprecated (I wish we could run Docker in a strict API mode - will explore)
Sorry for this. We will release a hotfix ASAP. Meanwhile, consider pre-pulling testcontainers/ryuk:0.3.0 and alpine:3.5 :(
@keeganwitt Docker's API. Although the query param was deprecated (I wish we could run Docker in a strict API mode - will explore)
Sorry for this. We will release a hotfix ASAP. Meanwhile, consider pre-pulling
testcontainers/ryuk:0.3.0andalpine:3.5:(
Yea, I'd thought of that, but I'm not sure it's possible with GitLab's Docker Executor. It should be possible to run it as a script with shell executor instead though I suppose. I'm still confused why it worked locally after deleting the ryuk image though... Maybe different Docker daemon versions?
Thanks @bsideup for the quick fix!
Are you planning to backport this to work also with junit 4?
@DaspawnW this is not junit specific and, once released, will work with any type of integration (junit4, junit jupiter, spock, manual container lifecycle)
@keeganwitt did you ever find a reasonable workaround for builds running in Gitlab? We have been looking at this for a day now without much success. It works if you manually pre-pull the images, but we are using docker-machine to autoscale the runners in EC2, so manual work is not really an option.
@bsideup I am seeing this also in 1.14.0.
@jdelucaa yes, this Docker API change applies to most of Testcontainers versions.
@keeganwitt did you ever find a reasonable workaround for builds running in Gitlab? We have been looking at this for a day now without much success. It works if you manually pre-pull the images, but we are using docker-machine to autoscale the runners in EC2, so manual work is not really an option.
Not really. I have exactly the same setup. For now, we just commented the tests out, since a fix is forthcoming. A few ideas came to mind, but I haven't really thought through them yet.
- Customize the AMI to bake in the images. Not totally sure if that'd work, and seems like a bad idea.
- Put the docker pull commands as a user data script.
- Don't use the Docker Executor, and instead use the Shell Executor and first pull the images. Assuming that works, you'd have to specify the executor on the runner itself, so you'd need a separate set of runners to do this (which is possible, just give those runners a different tag).
- Use DinD (Docker in Docker), and execute your build in a Dockerfile, rather than a script that runs on an image. Might take some fiddling to get the volumes mounted correctly, I've never tried to do that before.
None of these seemed great. If one of them sounds promising, I can explain in a little more detail what I was thinking, though there may be gotchas I haven't thought of. Offhand, the user data script seems like the most promising to me.
We thought about option 1, but quickly discarded that idea. We also tried option 2 but apparently Docker isn’t installed at that point yet, so didn’t really proceed further with that. Neither 3 or 4 felt like a good idea, so I guess we’ll just skip the tests using testcontainers for now.
Thanks for sharing, though.
@arhohuttunen I'm now thinking this broke because we upgraded GL Runners this week, which upgraded Docker version. So downgrading should fix that. Unless others didn't upgrade and still ran into this? I could have sworn we had tests pass after the upgrade, but I'm not sure what else could have changed.
I upgraded Docker for Mac to 3.0 (which has Docker 20.10 in it) this morning, and the tests now fail locally too.
@keeganwitt I think on the runners we are using the docker stable tag, which should still point to 19.03.14 according to this: https://hub.docker.com/layers/docker/library/docker/stable/images/sha256-8f71deccd0856d8a36db659a8c82894be97546b47c1817de27d5ee7eea860162?context=explore
@arhohuttunen Sorry, I didn't mean the runners image, I meant the machines on which the runner image runs (where the daemon lives). We use https://github.com/npalm/terraform-aws-gitlab-runner, which would upgrade that. This applies to private runners, not the shared ones that GL manages. I dunno what schedule those are upgraded on, we don't use them.
I've been talking with another of our engineers and he said userdata isn't the same as ec2-userdata. I didn't realize there were 2.
We use a hard-coded AMI in our runners and haven't changed that lately, so that should not be the root cause in our case.
Actually, some builds passed after our upgrade too, so it shouldn't have been that. I'm confused why yesterday was the breaking day.
I'll take previous comment back because those runners install Docker from official repo which does serve 20.10.
I'm encountering this issue on apaceh CI builds for the apache/james project (https://builds.apache.org/blue/organizations/jenkins/james%2FApacheJames/detail/PR-268/16/pipeline) I tried pulling the image explicitly before running the tests but it still fails. we are very much looking forward to the 1.15.1 hotfix
edit I was misled by a comment above that referred to testcontainersofficial instead of testcontainers I assume this was some kind of custom setup. The tests try to get testcontainers/ryuk:0.3.0 by default no testcontainersofficial/ryuk:0.3.0
@jeantil That's correct, testcontainers is the default, testcontainersofficial was just a misguided thing I attempted early on (overriding the image in testcontainers properties). I saw testcontainersofficial mentioned in an issue where they were discussing Docker Hub and Quay. Sorry for the confusion.
When can we expect to have this 1.15.1 release ? (In order to know whether we need to find a workaround for this or just wait for it)
@mderouet the release is expected for later today (tsss ;))