fix: print docker logs of mongodb container on startup timeout - #2
Merged
Merged
Conversation
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
This was referenced Sep 12, 2026
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
Error response from daemon: container ... is not runningwithout any indication of why the container died (e.g.mongodcrashing right after start).entrypoint.shnow dumpsdocker logs mongodbbefore exiting, so CI runs that hit this failure surface the actualmongoderror instead of just the generic "not running" noise.Context
Found while investigating recent failed
docker-mongodb"Publish Docker image" runs (e.g. runs34645577006and32824380985), where the "Start MongoDB" step consuming this action aborted with "Did not initialize MongoDb within 30 seconds. Exit." and no further diagnostics.Test plan
docker logs mongodboutput appears before the exit.🤖 Generated with Claude Code
https://claude.ai/code/session_019xjEKspAqewffzFkNCQsv8
Generated by Claude Code