Container log not found error with Linux Docker Runners

Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.

Summary

Often, you might run into a "Container log not found" error when using Linux Docker runners. This document covers when or why this error might occur and the fix for the problem.

Diagnosis

  • When you create a Linux docker runner in the UI as per the instructions in our document, you'll get a docker run ` command that you need to execute on the machine/server where the runner is being setup. For instance, the default command to setup a Linux Docker Runner is -

1 2 3 4 docker container run -it -v /tmp:/tmp -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker/containers:/var/lib/docker/containers:ro -e ACCOUNT_UUID={<account-UUID>} -e REPOSITORY_UUID={<repository-UUID} -e RUNNER_UUID={runner-UUID} -e RUNTIME_PREREQUISITES_ENABLED=true -e OAUTH_CLIENT_ID=<Oauth-ID> -e OAUTH_CLIENT_SECRET=<Oauth-=Secret> -e WORKING_DIRECTORY=/tmp --name runner-<Runner-UUID> docker-public.packages.atlassian.com/sox/atlassian/bitbucket-pipelines-runner:1

  • In the above command, there are multiple volumes - /var/run/docker.sock, /var/lib/docker/containers, /tmp. It is essential to use these default paths in the command.

  • The working directory can be changed if required. To change the directory, you can follow the steps provided here (under "Changing the working directory of the Runner"). In the above command, you must replace /tmp:/tmp with /<local-directory>:/<runner-directory> and WORKING_DIRECTORY=/tmp to WORKING_DIRECTORY=/<runner-directory>. Make sure that the second part of the first command matches the WORKING_DIRECTORY Parameter.

Changes to any other volume path in the command will fail the build with the below error.

1 Container log not found: /var/lib/docker/containers/********-json.log

Solution

Ensure that only the working directory is changed in the docker run command if required. Changes to other volumes' path - /var/run/docker.sock, /var/lib/docker/containers, /tmp. will result in an error.

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.