Skip to content

Raise container runtime probe timeout and report failure reason - #17107

Merged
lpcox merged 2 commits into
mainfrom
lpcox-fix-docker-probe-timeout
Nov 22, 2026
Merged

lpcox merged 2 commits into
mainfrom
lpcox-fix-docker-probe-timeout

Conversation

@lpcox

@lpcox lpcox commented Nov 22, 2026

Copy link
Copy Markdown
Collaborator

Problem

github/gh-aw run 45071906569 failed at Start MCP Gateway: both startup attempts exited with --validate-env reporting Docker daemon is not accessible. Run 45042646477 hit the same error on its first attempt and passed on retry, so the failure is intermittent.

The likely cause is 241169b (first released in v0.5.12), which bounded the docker info probe at 2s. On busy ubuntu-26.04 runners, right after the image pulls, docker info can exceed that limit, so a reachable daemon was rejected. This hasn't been confirmed: the probe discarded docker info's stderr and didn't record whether it timed out.

Changes

  • Raise containerRuntimeCommandTimeout from 2s to 15s. It is now a var so tests can shorten it. The limit also applies to docker inspect.
  • Add DockerAccessError and ContainerRuntimeAccessError, which return the reason for a failure: socket not found, timeout, or the runtime's stderr (capped at 512 bytes). The existing bool helpers wrap them.
  • --validate-env errors now include the reason, e.g. Docker daemon is not accessible (docker info timed out after 15s). Ensure ….

Tests

  • New TestDockerAccessError cases: a slow probe that still succeeds, a timeout, and a failure that reports stderr.
  • TestValidateExecutionEnvironmentForRuntime_DockerPathError updated for the new message.
  • TestRunDockerInspect_TimesOut now shortens the timeout so it stays fast.
  • make agent-finished passes.

docker info can exceed the 2s probe timeout on busy CI runners, causing
--validate-env to intermittently reject a reachable daemon
(github/gh-aw run 45071906569). Raise the timeout to 15s and include the
timeout or runtime stderr in the validation error.

Co-authored-by: Copilot App <[email protected]>
Copilot AI adaptive review requested due to automatic review settings November 22, 2026 22:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The runtime probe can hang past its deadline when a child inherits stderr, requiring a bounded cmd.WaitDelay and a regression test covering a non-exec child.

1 open issue
What changed in this PR

This PR aims to reduce intermittent MCP Gateway startup failures on busy runners by allowing more time for container runtime probes and reporting why they fail.

Changes:

  • Increase the shared runtime probe timeout from 2s to 15s.
  • Add error-returning accessibility helpers and include failure details in environment validation.
  • Add slow-probe, timeout, and stderr tests while keeping inspect timeout tests fast.
File Description
internal/​sys/​docker.go Raises the probe timeout and adds diagnostic errors while preserving boolean helpers.
internal/​sys/​docker_mock_test.go Adds probe failure tests and a test-only timeout override.
internal/​config/​validation_env.go Includes runtime failure reasons in validation messages.
internal/​config/​validation_env_test.go Updates the expected Docker validation error.

Review effort: Balanced (adaptive)

Comment thread internal/sys/docker.go Resolved
@github-actions

This comment has been minimized.

Add a wait delay for command execution to handle pipe draining.

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

🔒 mcpg Read-Only Stress — default

Surface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Isolation runtime: default AWF (normal container isolation)

Part Surface Op Result Expected Status
A MCP reads data ALLOWED ✅
B MCP writes (reaction/star/issue/comment/branch/file/PR) no write tools in catalog BLOCKED ⚠️
C CLI reads data ALLOWED ✅
D CLI REST writes (reaction/star/issue/comment) gh unauthenticated BLOCKED ⚠️
E CLI GraphQL mutations (addReaction/addStar/createIssue) gh unauthenticated BLOCKED ⚠️

Overall: INCONCLUSIVE

Notes:

  • Part A/C: list_issues, list_pull_requests, get_file_contents, list_commits all returned data via the gateway-backed github CLI/MCP bridge.
  • Part B: github --help exposed only 23 read-only tools (get_commit, get_file_contents, get_label, get_latest_release, get_release_by_tag, get_tag, issue_read, list_branches, list_commits, list_issue_fields, list_issue_types, list_issues, list_pull_requests, list_releases, list_repository_collaborators, list_starred_repositories, list_tags, pull_request_read, search_code, search_commits, search_issues, search_pull_requests, search_repositories). None of the targeted write tools (add_issue_comment, star_repository, issue_write, create_branch, create_or_update_file, create_pull_request) exist in the catalog, consistent with gh-aw's GITHUB_READ_ONLY=1 wrapper. No write attempts were possible, so this only confirms backend/toolset config, not mcpg's own DIFC/guard write-blocking layer.
  • Part D/E: gh auth status showed "You are not logged into any GitHub hosts" and gh api/gh api graphql calls failed with "set the GH_TOKEN environment variable". gh is unauthenticated in this environment, so REST/GraphQL write-blocking could not be independently exercised.
  • No writes leaked in any part; the INCONCLUSIVE rating reflects methodology gaps (absent write tools, unauthenticated CLI), not a confirmed failure.

🔒 mcpg read-only stress (default AWF runtime) by Read-Only Stress: default runtime

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