Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Bitbucket self-hosted runner failed to create shim task: OCI runtime create failed

Yves Verrette
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 24, 2023

We have runners that work fine and every few days we get this error and they completely stop working. 

 

An error occurred whilst starting container(id: 40436d4a064dbf00c0067e1ed38bc5f2ba5506a09bb517b5b12c9e00206f0a35, name: 0377585c-9fd7-5568-9fa5-99a2679abd6a_a3361eab-e986-4945-aa07-038c57d386cc_build).
com.github.dockerjava.api.exception.BadRequestException: Status 400: {"message":"failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting \"/tmp/0377585c-9fd7-5568-9fa5-99a2679abd6a/docker\" to rootfs at \"/usr/bin/docker\": mount /tmp/0377585c-9fd7-5568-9fa5-99a2679abd6a/docker:/usr/bin/docker (via /proc/self/fd/6), flags: 0x5001: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type"}

 

Each time we have to manually remove the docker container and replace them by new ones. There seems to be a relation between time (~number of built or quantity of work) and this problem occurence. 

 

1 answer

1 accepted

1 vote
Answer accepted
Norbert Csupka
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 25, 2023

Hi Yves,

Thank you for reaching out to Atlassian Community, I'm Norbert and it's nice to meet with you!

Based on my observation the /tmp/runner_id/docker is an empty directory instead of this containing the docker executable file. We've created a document explaining this behavior: https://confluence.atlassian.com/bbkb/docker-command-not-found-error-while-running-docker-commands-in-self-hosted-runner-1206785605.html

To resolve this behavior, can we ask you to run these steps and let us know if it helps?

Solution

In this case, in order to resolve this issue, first confirm your local runner contains an empty docker folder:

$ ls -l /tmp/<docker_uuid>

Once you confirmed the directory is already there, stop the Runner and remove the local folder:

$ rm -r /tmp/<docker_uuid>/docker

Restart the Runner and confirm that in the Runners' logs you can see the following message:

Copying Docker cli to working directory.

 

We're looking forward to hear from you

Yves Verrette
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 3, 2023

Thanks Norbert that seems to be working fine. 

Like Norbert Csupka likes this
Norbert Csupka
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 11, 2023

You're most welcome Yves, I'm glad to hear I was able to help :). 

Have a great day and take care!

Norbert

Jefferson Fermo
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 30, 2024

hi @Norbert Csupka though this workaround works, it still keeps happening and usually on the most unfortunate times: weekends, middle of the night, holiday and is becoming very annoying. I assume the runner is using --volume to bind/mount binary 'docker' into the runner w/c creates this unexpected empty docker directory when binary docker does not exist yet. Can this be to --mount as mentioned here changed https://github.com/moby/moby/issues/13121#issuecomment-336186993 so that this does not happen.

Norbert Csupka
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 30, 2024

Hi @Jefferson Fermo 

I'd like to inform you that I've created a support ticket as I need a a link for a build, but I can't ask for those links here due to privacy reasons.

I'll contact you through a support ticket shortly.

Like Jefferson Fermo likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events