[GH-ISSUE #174] Conflict: container name already in use #115

Closed
opened 2026-03-01 21:40:18 +03:00 by kerem · 4 comments
Owner

Originally created by @greg0ire on GitHub (Mar 29, 2020).
Original GitHub issue: https://github.com/nektos/act/issues/174

When trying to run act on https://github.com/doctrine/sql-formatter, I'm getting this output:

[Continuous Integration/Static Analysis with Psalm  ] 🚀  Start image=node:12.6-buster-slim
[Continuous Integration/Unit tests-1                ] 🧪  Matrix: map[php-version:7.2]
[Continuous Integration/Unit tests-1                ] 🚀  Start image=node:12.6-buster-slim
[Continuous Integration/Coding Standards            ] 🧪  Matrix: map[php-version:7.2]
[Continuous Integration/Coding Standards            ] 🚀  Start image=node:12.6-buster-slim
[Continuous Integration/Unit tests-2                ] 🧪  Matrix: map[php-version:7.3]
[Continuous Integration/Unit tests-2                ] 🚀  Start image=node:12.6-buster-slim
[Continuous Integration/Unit tests-3                ] 🧪  Matrix: map[php-version:7.4]
[Continuous Integration/Unit tests-3                ] 🚀  Start image=node:12.6-buster-slim
[Continuous Integration/Static Analysis with PHPStan] 🚀  Start image=node:12.6-buster-slim
Error: Error response from daemon: Conflict. The container name "/act-Continuous-Integration-Sta" is already in use by container "a09e515b212dcc32454ee2ddf11e5a8f56556d5179df6af90659f3d0efedde50". You have to remove (or rename) that container to be able to reuse that name.

Note how I have a workflow named Continuous Integration/Static Analysis with Psalm, and another named Continuous Integration/Static Analysis with PHPStan. A fix might be to append a hash of the workflow name to the container name, dunno why it's truncated in the first place though. Is there a limit to the length of docker container names?

Originally created by @greg0ire on GitHub (Mar 29, 2020). Original GitHub issue: https://github.com/nektos/act/issues/174 When trying to run `act` on https://github.com/doctrine/sql-formatter, I'm getting this output: ``` [Continuous Integration/Static Analysis with Psalm ] 🚀 Start image=node:12.6-buster-slim [Continuous Integration/Unit tests-1 ] 🧪 Matrix: map[php-version:7.2] [Continuous Integration/Unit tests-1 ] 🚀 Start image=node:12.6-buster-slim [Continuous Integration/Coding Standards ] 🧪 Matrix: map[php-version:7.2] [Continuous Integration/Coding Standards ] 🚀 Start image=node:12.6-buster-slim [Continuous Integration/Unit tests-2 ] 🧪 Matrix: map[php-version:7.3] [Continuous Integration/Unit tests-2 ] 🚀 Start image=node:12.6-buster-slim [Continuous Integration/Unit tests-3 ] 🧪 Matrix: map[php-version:7.4] [Continuous Integration/Unit tests-3 ] 🚀 Start image=node:12.6-buster-slim [Continuous Integration/Static Analysis with PHPStan] 🚀 Start image=node:12.6-buster-slim Error: Error response from daemon: Conflict. The container name "/act-Continuous-Integration-Sta" is already in use by container "a09e515b212dcc32454ee2ddf11e5a8f56556d5179df6af90659f3d0efedde50". You have to remove (or rename) that container to be able to reuse that name. ``` Note how I have a workflow named `Continuous Integration/Static Analysis with Psalm`, and another named `Continuous Integration/Static Analysis with PHPStan`. A fix might be to append a hash of the workflow name to the container name, dunno why it's truncated in the first place though. Is there a limit to the length of docker container names?
kerem closed this issue 2026-03-01 21:40:18 +03:00
Author
Owner

@mwang87 commented on GitHub (Apr 1, 2020):

I ran into this as well. Basically, there is a fixed length they use for the container name. One solution from my side was to shorten the name of workflow name. Not perfect but does work.

<!-- gh-comment-id:606986070 --> @mwang87 commented on GitHub (Apr 1, 2020): I ran into this as well. Basically, there is a fixed length they use for the container name. One solution from my side was to shorten the name of workflow name. Not perfect but does work.
Author
Owner

@greg0ire commented on GitHub (Apr 1, 2020):

I think the place where to fix this might be in this piece of code:

github.com/nektos/act@4a4bd36cf6/pkg/runner/run_context.go (L276-L298)

Also, this SO question says that images have a max length of 30 (but containers don't have a max length for their name): https://stackoverflow.com/a/42642992/353612

<!-- gh-comment-id:607052297 --> @greg0ire commented on GitHub (Apr 1, 2020): I think the place where to fix this might be in this piece of code: https://github.com/nektos/act/blob/4a4bd36cf65b36bb12ddad4d8379cd24b2384885/pkg/runner/run_context.go#L276-L298 Also, this SO question says that images have a max length of 30 (but containers don't have a max length for their name): https://stackoverflow.com/a/42642992/353612
Author
Owner

@cplee commented on GitHub (Apr 16, 2020):

thanks @albertofem for the PR, merged!

<!-- gh-comment-id:614940886 --> @cplee commented on GitHub (Apr 16, 2020): thanks @albertofem for the PR, merged!
Author
Owner

@displague commented on GitHub (Oct 14, 2020):

I encountered the same error message, but it was due to stale containers and volumes.

Error: Error response from daemon: Conflict. The container name "/act-Acceptance-Tests-Build" is already in use by container "2884e6d63f9d92c9c170fe4398498cb80a433a1a9a980c7ec0b63904ba45dc8e". You have to remove (or rename) that container to be able to reuse that name.

I used docker rm on the container that was cited in the error message, and then
docker system prune --volumes --all to get things back in order.

<!-- gh-comment-id:708462103 --> @displague commented on GitHub (Oct 14, 2020): I encountered the same error message, but it was due to stale containers and volumes. ``` Error: Error response from daemon: Conflict. The container name "/act-Acceptance-Tests-Build" is already in use by container "2884e6d63f9d92c9c170fe4398498cb80a433a1a9a980c7ec0b63904ba45dc8e". You have to remove (or rename) that container to be able to reuse that name. ``` I used `docker rm` on the container that was cited in the error message, and then `docker system prune --volumes --all` to get things back in order.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#115
No description provided.