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.
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
Yeah I guess that is probably the cause but we can't find anything that could possibly be replacing the PATH.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.