Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(docker): ensure orphaned contributoor containers can be managed #46

Merged
merged 3 commits into from
Jan 15, 2025

Conversation

mattevans
Copy link
Member

Problem:

Restarting Contributoor
Contributoor is not running, starting contributoor
ERRO[0002] failed to start service: failed to start containers: exit status 1
Output:  sentry Pulling
 sentry Pulled
 Network installer-0035_contributoor  Creating
 Network installer-0035_contributoor  Created
 Container contributoor  Creating
Error response from daemon: Conflict. The container name "/contributoor" is already in use by container "5bd18e54e72b1b9c38678b14dd6688fb67f2df15f705417e0b5f0b9c84b163ca". You have to remove (or rename) that container to be able to reuse that name.`

Our IsRunning() implementation only checks for active containers with the exact configuration it expects, if this has changed (say between versions), then IsRunning() will return false.

Likewise with Stop(). It'll only attempt to stop containers started with the exact configuration it was started with, if this has changed, then it won't stop the container.

IsRunning() + Stop() have been updated to fallback to checking via container name, not just relying on docker compose which expects consistent config.

@mattevans mattevans self-assigned this Jan 15, 2025
@mattevans mattevans merged commit c4bfe45 into master Jan 15, 2025
7 checks passed
@mattevans mattevans deleted the fix/container-name-conflict branch January 15, 2025 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants