I implemented a simple pipeline that runs in a self-hosted runner, it receives two user input variables and prints them. After a run, any other run after it will result in a "Could not pull image: Already exists", investigating the bitbucket-pipelines-runner logs I found this:
[2024-12-09 22:52:57,765] Getting all artifacts for step.
[2024-12-09 22:52:57,770] Getting SSH private key.
[2024-12-09 22:52:57,773] Getting known hosts.
[2024-12-09 22:52:57,925] SSH private key not found
[2024-12-09 22:52:57,987] Setting up directories.
[2024-12-09 22:52:57,991] Starting log uploader.
[2024-12-09 22:52:57,996] Removing container (name: e8b93fd6-2d3b-5e81-90f8-da0ce7cb931b_35f580c8-532d-4b90-a394-b14bb6b6a427_clone)
[2024-12-09 22:52:58,006] Removing container (name: e8b93fd6-2d3b-5e81-90f8-da0ce7cb931b_35f580c8-532d-4b90-a394-b14bb6b6a427_build)
[2024-12-09 22:52:58,014] Setting up step timeout: PT2H
[2024-12-09 22:52:58,016] Starting websocket listening to STEP_COMPLETED events. [2024-12-09 22:52:58,020] Checking for step completion every PT30S seconds. [2024-12-09 22:52:58,188] Updating step progress to PULLING_IMAGES.
[2024-12-09 22:52:58,406] Pulling image docker-public.packages.atlassian.com/sox/atlassian/bitbucket-pipelines-dvcs-tools:prod-stable.
[2024-12-09 22:52:58,411] Looking for auth in config for image Image{name=docker-public.packages.atlassian.com/sox/atlassian/bitbucket-pipelines-dvcs-tools:prod-stable, runAsUser=None, auth=None} and found auth null
[2024-12-09 22:52:58,690] An error occurred whilst pulling image.
com.github.dockerjava.api.exception.DockerClientException: Could not pull image: Already exists
at com.github.dockerjava.api.command.PullImageResultCallback.checkDockerClientPullSuccessful(PullImageResultCallback.java:97)
at com.github.dockerjava.api.command.PullImageResultCallback.throwFirstError(PullImageResultCallback.java:112)
at com.github.dockerjava.api.async.ResultCallbackTemplate.awaitCompletion(ResultCallbackTemplate.java:93)
at com.atlassian.pipelines.runner.core.service.docker.ImageServiceImpl.lambda$pull$0(ImageServiceImpl.java:59)
at io.reactivex.internal.operators.completable.CompletableFromAction.subscribeActual(CompletableFromAction.java:35)
at io.reactivex.Completable.subscribe(Completable.java:2309)
at io.reactivex.internal.operators.completable.CompletableObserveOn.subscribeActual(CompletableObserveOn.java:34)
at io.reactivex.Completable.subscribe(Completable.java:2309)
at io.reactivex.internal.operators.completable.CompletableSubscribeOn$SubscribeOnObserver.run(CompletableSubscribeOn.java:64) at brave.propagation.CurrentTraceContext$1CurrentTraceContextRunnable.run(CurrentTraceContext.java:264)
at com.atlassian.pipelines.common.trace.rxjava.CopyMdcSchedulerHandler$CopyMdcRunnableAdapter.run(CopyMdcSchedulerHandler.java:74)
at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:608)
at brave.propagation.CurrentTraceContext$1CurrentTraceContextRunnable.run(CurrentTraceContext.java:264)
at com.atlassian.pipelines.common.trace.rxjava.CopyMdcSchedulerHandler$CopyMdcRunnableAdapter.run(CopyMdcSchedulerHandler.java:74)
at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66)
at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
[2024-12-09 22:52:58,693] Removing container (name: e8b93fd6-2d3b-5e81-90f8-da0ce7cb931b_35f580c8-532d-4b90-a394-b14bb6b6a427_build)
[2024-12-09 22:52:58,706] Not uploading caches. (numberOfCaches: 0, resultOrError: FAILED)
[2024-12-09 22:52:58,708] Not uploading artifacts. (numberOfArtifacts: 0, resultOrError: FAILED)
[2024-12-09 22:52:58,713] Updating step progress to PARSING_TEST_RESULTS. [2024-12-09 22:52:58,913] Test report processing complete.
It seems that if any of the following images exists when a new run occurs, the pipeline will fail with the error
atlassian/default-image
docker-public.packages.atlassian.com/sox/atlassian/bitbucket-pipelines-dvcs-tools
docker-public.packages.atlassian.com/sox/atlassian/bitbucket-pipelines-auth-proxy
Removing the images manually solve the problem but isn't that something the bitbucket-pipelines-runner should handle? What can be causing it?
Hi Pablo,
To investigate this further, we'll need to investigate your build logs/YML configuration and also check your runner logs.
To do so - we'll need you to raise a ticket so our system will allow us to grant the access to check the above. I can see you belong to a workspace with a Premium plan, so please raise one using the link below:
If you encounter issues raising a ticket, please let me know your timezone so I can raise one on your behalf.
Cheers!
- Ben (Bitbucket Cloud Support)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.