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

Problem deploying the docker job

ghalia sidi amemou November 9, 2023

hello,

The problem is when we run the plan manually in Bamboo, the build is successfully finalized, but when we run it scheduled, the build fails.

 

Error response from daemon: network with name m2mhubit_net already exists
docker: Error response from daemon: Conflict. The container name "/m2mhubit_redis" is already in use by container "5e8b04b118871c955bc11fe3991b63c08d873b409fa60b5a57b4cadcd9f0373e". You have to remove (or rename) that container to be able to reuse that name.
See 'docker run --help'.
docker: Error response from daemon: Conflict. The container name "/m2mhubit_m2mhub" is already in use by container "78b0a66e9aa8b2fe22af8faa3f9409b6736ef42f942f054df51c346497069080". You have to remove (or rename) that container to be able to reuse that name.
See 'docker run --help'.
Error while starting containers for integration tests


We have checked the trigger configuration, but we still have the same problem.

1 answer

1 vote
Khushboo Gupta
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 19, 2024

Hello @ghalia sidi amemou ,

Welcome to Atlassian community.

The error message "response from daemon: network with name m2mhubit_net already exist" suggests that the build plan is trying to create a Docker network that already exists.

  • Check the scripts in your build plan. If you have a command to create a Docker network, you could modify it to check if the network exists before trying to create it.
  • Add a Cleanup Task: Add a task at the end of your build plan to remove the Docker network after the build is complete. This would ensure that the network doesn't exist when the next build starts.
  • Or, you can add a script that will stop and remove the Docker container before starting a new one. Here's a sample script that you can use:
    docker stop m2mhubit_redis || true && docker rm m2mhubit_redis || true

    This script will first try to stop the container. If the container is not currently running (which would cause the `docker stop` command to fail), it will ignore the error and proceed to the next command (`docker rm`). This will remove the container if it exists. If the container does not exist (which would cause the `docker rm` command to fail), it again ignores the error.

    You can add this script to the beginning of your build plan in Bamboo. This will ensure that any existing or running Docker container with the same name is removed before a new one is started, thereby avoiding the conflict error.

Let me know if this helps!

Regards,

Khushboo Gupta

*please don't forget to Accept the answer if your query was answered**

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events