Skip to content

fix(docker): show a clear message for a shell into a stopped container#75

Merged
Derssa merged 2 commits into
mainfrom
fix/terminal-stopped-container-message
Jul 19, 2026
Merged

fix(docker): show a clear message for a shell into a stopped container#75
Derssa merged 2 commits into
mainfrom
fix/terminal-stopped-container-message

Conversation

@OthmaneZ05

Copy link
Copy Markdown
Collaborator

Summary of Changes

Two small follow-up fixes on top of the container-ownership work already on main:

  1. Stopped-container terminal message. Docker answers 409 "... is not running" when you exec into a stopped container (terminal, DB explorers/queries). classifyDockerError matched this with its generic 409 branch and returned NAME_CONFLICT ("A container with this name already exists…"), which is nonsensical for a container that simply isn't running. A dedicated branch now maps this case to a new CONTAINER_NOT_RUNNING code with the message "This container is not running. Start it, then try again." This also corrects the same misclassification on the HTTP DB endpoints, which already routed through classifyDockerError.

  2. Neutral test-fixture names. The container-ownership integration test used fixture names carrying a branch-scoped prefix (ownership fixtures). They are renamed to plain, self-descriptive names so no build-scoped identifier ships in the public test suite.

Types of Changes

  • Bug fix (non-breaking change resolving an issue)
  • New feature / node type addition
  • Refactoring / structural cleanup
  • Documentation update

Verification & Testing

Automated Checks

  • npm run lint — clean
  • npm run build — clean (tsc, exit 0)
  • npm test — 298/298 unit tests pass (adds one classifier test for the stopped-container 409)
  • npm run test:integration -- src/modules/containers/containerOwnership.itest.ts — 17/17 pass against a real Docker daemon

Manual Verification

Reproduced the original bug empirically: exec on a stopped container throws statusCode 409 "container … is not running"; running the compiled classifyDockerError on that error returned NAME_CONFLICT before this change and CONTAINER_NOT_RUNNING after. The 17-test ownership integration suite (rogue container + cross-project) stays green with the renamed fixtures.

Checklist

  • My code follows the repository's code style and lint standards
  • I have updated the documentation or instructions if necessary
  • All unit and integration tests are passing

@OthmaneZ05
OthmaneZ05 requested a review from Derssa as a code owner July 19, 2026 01:48
@Derssa
Derssa merged commit 6312889 into main Jul 19, 2026
3 checks passed
@Derssa
Derssa deleted the fix/terminal-stopped-container-message branch July 19, 2026 19:59
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