Skip to content

fix: print docker logs of mongodb container on startup timeout - #2

Merged
QuadStingray merged 1 commit into
mainfrom
claude/docker-daemon-error-logs-fa25ey
Sep 11, 2026
Merged

QuadStingray merged 1 commit into
mainfrom
claude/docker-daemon-error-logs-fa25ey

Conversation

@QuadStingray

Copy link
Copy Markdown
Contributor

Summary

  • When the MongoDB container fails to accept connections within 30s, the polling loop only reported Error response from daemon: container ... is not running without any indication of why the container died (e.g. mongod crashing right after start).
  • On timeout, entrypoint.sh now dumps docker logs mongodb before exiting, so CI runs that hit this failure surface the actual mongod error instead of just the generic "not running" noise.

Context

Found while investigating recent failed docker-mongodb "Publish Docker image" runs (e.g. runs 34645577006 and 32824380985), where the "Start MongoDB" step consuming this action aborted with "Did not initialize MongoDb within 30 seconds. Exit." and no further diagnostics.

Test plan

  • Manually trigger a run where the container fails to start (e.g. bad env var) and confirm docker logs mongodb output appears before the exit.
  • Confirm the happy path (container starts fine) is unaffected.

🤖 Generated with Claude Code

https://claude.ai/code/session_019xjEKspAqewffzFkNCQsv8


Generated by Claude Code

When the container fails to accept connections within 30s (e.g. mongod
crashed right after start), the action only reported "not running"
errors from the polling docker exec calls without showing why the
container died. Dump the container's docker logs before exiting so
failed CI runs surface the actual mongod error.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019xjEKspAqewffzFkNCQsv8
@QuadStingray
QuadStingray merged commit 345f532 into main Sep 11, 2026
66 of 68 checks passed
@QuadStingray
QuadStingray deleted the claude/docker-daemon-error-logs-fa25ey branch September 11, 2026 21:00
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