Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Pipelines that previously worked are now failing with docker: command not found

Eduardo Bueno
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 9, 2023

We have a deploy step that runs the aws-ecs-deploy pipe and as of today, all pipelines started failing with error `bash: docker: command not found`

The base image sha is the same which discards the possibility that the image may have been changed.

1 answer

1 accepted

1 vote
Answer accepted
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 10, 2023

Hello @Eduardo Bueno and welcome to the Community!

Checking for the pipe atlassian/aws-ecs-deploy I see it was last updated in September, so it's very unlikely that an update in the pipe is what has caused the error you are receiving in pipelines.

The "bash: docker: command not found" error is returned when the bash is not able to find the binary for the program you are trying to execute, in this case, the docker binary. There are multiple causes of this error which are discussed in detail in the article Bitbucket Pipelines - Command not found error , and for your particular case I think it's likely related to the PATH variable being modified.

The PATH variable contains all the directories where bash will check for the binaries when you execute a command. If you define a Workspace/Repository/Deployment env variable named PATH, it will overwrite the default PATH which can lead to errors when executing the commands because bash will not be able to find the binaries. In this case, I would suggest checking your workspace/repository/deployment for any environment variable named PATH, and if there's any, rename or remove the variable and try running the pipeline again.

If the error persists, I see you have access to a Premium workspace that is entitled to regular support, so you can open a ticket with us at https://getsupport.atlassian.com/ and we can help to investigate further :)

Thank you, @Eduardo Bueno !

Patrik S

Eduardo Bueno
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 11, 2023

Yeah I guess that is probably the cause but we can't find anything that could possibly be replacing the PATH.

Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 16, 2023

Hello @Eduardo Bueno ,

In case you are using Linux docker self-hosted runners to run your pipeline build, this issue might be caused by a docker directory left behind from a previous pipeline run, which is causing the runner to fail when executing a new build.

What happens is that when the runner starts, the docker binary is automatically copied to the runner's temp directory. However, we have seen that in rare cases, a previous unsuccessful Runner setup can cause a docker directory to not be deleted from the runner's temp folder. Since the docker folder already exists, in the subsequent runs, the Runner fails to mount the new docker directory and the docker binary won't be present during the build. As pipes are essentially a docker container, when the runner tries to start the pipe container using the docker run command it fails to find the docker binary and throws the error bash: docker: command not found.

This is covered in more detail in the article "docker: Command not found" error while running docker commands in self-hosted Runner, where it also contains a Solution which is to remove the docker folder from the runner tmp directory and start the runner again.

You can try the solution proposed in that article and check if it solves the issue.

Thank you, @Eduardo Bueno !

Patrik S

Like Eduardo Bueno likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events