ci: drop host port mapping for Mongo service container #8
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "ci/fix-mongo-service-port-collision"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The
testjob fails on the runner (Solaria) with:(run 128, job
test, task 269.)Cause
The
services.mongoblock mappedports: 27017:27017, which publishes the container port to host port 27017. That host port is already taken (by amongodrunning on the runner host itself), so Docker can't bind it, the service container fails to schedule, the job network is torn down, and the wholetestjob aborts before any test runs.This is host-specific, not code-specific — it hits every PR, including #6 (Phase A1). My branch reproduces all four jobs green locally.
Fix
Drop the
ports:mapping. The job container doesn't need it: it reaches Mongo over the job's internal network via the service hostname, andMONGODB_URI=mongodb://mongo:27017already usesmongo(notlocalhost). The host port mapping was both unnecessary and the source of the collision.This is the idiomatic GitHub/Forgejo Actions pattern for service containers — only map a host port when an external client needs in, which isn't the case here.
Verification
Side notes from the run log (not addressed here)
'runs-on' key not defined in Lint and Build/clippy/format— the act runner warns aboutruns-on: docker(legacy form). These are warnings, not the failure; leave for a separate cleanup if desired.Once merged, re-run #6's CI to confirm the test job goes green.