Skip to content

fix: remove stale devbox container on restart#1043

Merged
pingsutw merged 3 commits into
mainfrom
fix-devbox-restart-conflict
May 8, 2026
Merged

fix: remove stale devbox container on restart#1043
pingsutw merged 3 commits into
mainfrom
fix-devbox-restart-conflict

Conversation

@pingsutw

@pingsutw pingsutw commented May 7, 2026

Copy link
Copy Markdown
Member

Summary

Screenshot 2026-05-07 at 10 37 54 AM
  • Fix container name "/flyte-devbox" is already in use error when running flyte start devbox after the container exists in a stopped/exited state (e.g. after Docker Desktop or machine restart).
  • _container_is_running only checks running containers via docker ps, so a stopped container would fall through to docker run and fail on the name conflict.
  • Always run docker rm -f flyte-devbox (with check=False) before starting, so any leftover container — running or stopped — is cleared. The "already running" prompt is preserved.

Test plan

  • flyte start devbox, then restart Docker, then flyte start devbox again — should start cleanly instead of erroring.
  • flyte start devbox while one is already running, answer y to the prompt — should remove and recreate.
  • Fresh machine with no existing container — should start normally.

pingsutw added 3 commits May 7, 2026 10:32
Fix 'container name already in use' error when starting devbox after
the container exists in a stopped/exited state (e.g. after Docker or
devbox restart). Previously _container_is_running only checked running
containers via 'docker ps', so a stopped container would fall through
to 'docker run' and fail on the name conflict.

Add _container_exists helper using 'docker ps -a' and remove any
existing container before starting a new one. Also switch the
'already running' path from 'docker stop' to 'docker rm -f' to free
the name.

Signed-off-by: Kevin Su <pingsutw@apache.org>
Signed-off-by: Kevin Su <pingsutw@apache.org>
Simplifies the stop+wait sequence into a single force-remove command.

Signed-off-by: Kevin Su <pingsutw@apache.org>
@pingsutw pingsutw merged commit 1c9d07e into main May 8, 2026
36 checks passed
@pingsutw pingsutw deleted the fix-devbox-restart-conflict branch May 8, 2026 17:48
AdilFayyaz pushed a commit that referenced this pull request May 12, 2026
Signed-off-by: Kevin Su <pingsutw@apache.org>
Signed-off-by: M. Adil Fayyaz <62440954+AdilFayyaz@users.noreply.github.com>
samhita-alla pushed a commit that referenced this pull request May 13, 2026
Signed-off-by: Kevin Su <pingsutw@apache.org>
Signed-off-by: Samhita Alla <aallasamhita@gmail.com>
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