Repository navigation
fix: recover the local stack after a port clash - #4
Merged
Merged
Conversation
Docker Engine 29.2 leaves a container whose port could not be bound without its network. Every later start of that container has loopback only, even once the port is free. Only a new container recovers. For the Local course that meant: - Lab 0 step 2: after `Bind for 0.0.0.0:8080 failed`, running local/engine.sh again (what --check says to do) failed with `registry-1 exited (1)`, and stopping the other program did not help. - Lab 0 step 1: after stopping the other program, `up` exited 0 and the step's check listed six services, but the container had no published port. local/engine.sh now removes the engine's containers that are not running before `ork local start`. The engine's data is in volumes. A rerun gives the same bind error while the port is taken, and a working engine once it is free. Troubleshooting gives a recovery that works for both stacks, covers a doctor that cannot reach a container that lost its network, and has a row for a missing python/.venv on the CLI path. Lab 0 steps 1 and 2 point to it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
local/engine.shremoves the Agent Engine's containers that are not running beforeork local start, so a start never reuses one that Docker left without a network.Why
Found while taking the Local course on the CLI path with port 8080 held by another container.
On Docker Engine 29.2.1, a container whose port could not be bound is left without its network. Every later start of that same container has loopback only, even after the port is free. Only a new container recovers.
local/engine.shstops withBind for 0.0.0.0:8080 failed: port is already allocated.local/engine.sh --checkthen printsfix: local/engine.sh, and that rerun fails withregistry-1 exited (1)(getaddrinfo EAI_AGAIN postgresin its log). Stopping the other program does not help. Changing the port worked only because Compose builds a new container.upagain exits 0 and the step's check lists all six services, but the MCP container has no published port and cannot be reached.Changes
local/engine.sh,local/lib.sh: beforeork local start, remove the engine's containers that are created, exited or dead. Running containers and other projects' containers are left alone. The engine's data is in volumes.local/tests/run.sh: two tests for that, a fakeork, and a fix for the//that aTMPDIRending in/leaves in the test path on macOS.labs/local/troubleshooting.md:local/down.sh, thenupagain.local/engine.shagain, or move the registry withORCA_LOCAL_REGISTRY_PORT. Names the second port the engine publishes, 18082.local/down.shand start again..venv/bin/python: No such file or directoryon the CLI path.labs/local/00-set-up.md: steps 1 and 2 point to Troubleshooting for a port clash.Test plan
local/tests/run.sh: 43 passed. The two new tests fail against the previousengine.shandlib.sh(41 passed, 2 failed).local/,cli/andscripts/,scripts/check-labs.sh,scripts/tests/run.sh(25),cli/tests/run.sh(151), TypeScript tests (226) and typecheck.registry-1 exited (1), and stillexited (1)after the port was free.PASSlines once it is free.true.local/down.sh, thenupagain, publishes the MCP port again.python/.venvin the checkout). No Python file changed, and CI runs them.Not verified: a program that is not a container holding the port. The troubleshooting row says "if it is a container" for that reason.