Skip to content

fix(compose): tunnel sidecar healthcheck used pgrep, absent from the image - #151

Merged
omarsy merged 1 commit into
mainfrom
fix/sidecar-healthcheck
Oct 28, 2026
Merged

omarsy merged 1 commit into
mainfrom
fix/sidecar-healthcheck

Conversation

@omarsy

@omarsy omarsy commented Oct 28, 2026

Copy link
Copy Markdown
Member

The healthcheck exec'd pgrep, which the sidecar image doesn't ship — unhealthy from the first probe while the tunnel was actually up (control channel established). Scan /proc cmdlines with grep (present; dumb-init keeps rathole a direct child). Verified live: the same check reports healthy on the running sidecar.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-28T07:12:59.100142Z 541fa0c PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 541fa0c16e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docker-compose.yml Outdated
# control channel was established the whole time). dumb-init keeps
# the rathole process a direct child, so its cmdline is always in
# the /proc scan.
test: ["CMD-SHELL", "grep -q rathole /proc/[0-9]*/cmdline"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Prevent the healthcheck from matching its own command line

When the sidecar is waiting for /config/client.toml, no rathole process exists, but this probe still succeeds: /bin/sh -c includes the literal rathole in its own /proc/<pid>/cmdline, which the glob includes. Thus the sidecar reports healthy even before the client starts. I reproduced this with an otherwise unused, randomly generated search token: the same probe returned 0. As local grep --help states, it searches for patterns in each supplied file, including the probe shell's cmdline here. Exclude the probe itself, for example by using [r]athole as the pattern, or check the actual client process explicitly.

Useful? React with 👍 / 👎.

…age does not ship

The exec healthcheck failed with 'pgrep: executable file not found'
from the first probe — a permanently-unhealthy container over a
healthy tunnel (the control channel was established the whole time;
found live in the F7 tunnel e2e bring-up). Probe /proc comm with grep
(present in the image): comm carries only the executable name, so the
probe's own command line (which contains the word rathole) cannot
satisfy it — a cmdline scan would report an unconfigured sidecar as
healthy while the entrypoint is still waiting for client.toml (codex
review). dumb-init keeps the rathole process a direct child, so its
comm is always in the scan.
@omarsy
omarsy force-pushed the fix/sidecar-healthcheck branch from 541fa0c to a1dbe16 Compare October 28, 2026 07:14
@omarsy
omarsy merged commit a494ea5 into main Oct 28, 2026
1 check failed
@omarsy
omarsy deleted the fix/sidecar-healthcheck branch October 28, 2026 07:14
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.

1 participant