Skip to content

Chore: add Dockerfile HEALTHCHECK and debug-log silent catch blocks#11478

Merged
vincentkoc merged 5 commits intoopenclaw:mainfrom
U-C4N:main
Mar 2, 2026
Merged

Chore: add Dockerfile HEALTHCHECK and debug-log silent catch blocks#11478
vincentkoc merged 5 commits intoopenclaw:mainfrom
U-C4N:main

Conversation

@U-C4N
Copy link
Contributor

@U-C4N U-C4N commented Feb 7, 2026

Summary

Added HEALTHCHECK to the Dockerfile and added debug logging to silent catch blocks in 3 files. No behavior changes.

lobster-biscuit

Why This Matters

HEALTHCHECK lets container orchestrators (Docker Compose, Swarm, K8s) detect an unresponsive gateway and restart it automatically. Uses Node 22 native
fetch() against the /health endpoint every 30s.

Silent catch blocks were making debugging harder. They now log via getLogger().debug() — crash behavior unchanged.

Tests

  • pnpm build and pnpm check pass
  • No new tests — logging-only and Dockerfile changes

Manual Testing

  1. docker build -t openclaw-test . then docker inspect shows HEALTHCHECK
  2. Debug logs only appear when actual errors occur during gateway operation

Evidence

  • Dockerfile — added HEALTHCHECK
  • src/infra/update-startup.ts — log update check failures
  • src/agents/model-auth.ts — log auth profile resolution failures
  • src/gateway/server-close.ts — log shutdown cleanup failures (pluginServices, configReloader, browserControl)

Telegram catch blocks (withTelegramApiErrorLogging already handles logging), media-understanding speculative JSON parse blocks, and cleanup/finally
blocks were intentionally left unchanged.

Greptile Overview

Greptile Summary

This PR adds a Dockerfile HEALTHCHECK that probes the gateway’s /health endpoint via Node’s built-in fetch(), and replaces a few silent catch {} blocks with getLogger().debug(...) calls in the auth profile resolver, gateway shutdown handler, and update check scheduler. The logging changes are localized and keep control flow the same; the main behavioral impact is the new container health probe, which will affect how orchestrators classify the service as healthy/unhealthy.

Confidence Score: 3/5

  • This PR is mostly safe, but the Docker HEALTHCHECK may mark containers unhealthy depending on gateway /health auth behavior.
  • The code changes are small and limited to logging, but the Dockerfile HEALTHCHECK introduces a new runtime contract with orchestrators. If /health requires auth under the default container config, the container will flap unhealthy and be restarted despite the gateway running normally.
  • Dockerfile

(2/5) Greptile learns from your feedback when you react with thumbs up/down!

@openclaw-barnacle openclaw-barnacle bot added gateway Gateway runtime docker Docker and sandbox tooling agents Agent runtime and tooling labels Feb 7, 2026
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@openclaw-barnacle
Copy link

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle bot added stale Marked as stale due to inactivity and removed stale Marked as stale due to inactivity labels Feb 21, 2026
@openclaw-barnacle openclaw-barnacle bot removed gateway Gateway runtime agents Agent runtime and tooling labels Mar 2, 2026
@vincentkoc
Copy link
Member

Rebased this PR branch onto current main and resolved the healthcheck concern directly.

What changed:

  • Rewrote PR head branch to current base (it was stale/no merge base with current main).
  • Updated Dockerfile healthcheck to use the built-in unauthenticated HTTP probe endpoint:
    • GET http://127.0.0.1:18789/healthz

Current diff is now a single, mergeable Dockerfile change.

@openclaw-barnacle openclaw-barnacle bot added the docs Improvements or additions to documentation label Mar 2, 2026
@vincentkoc vincentkoc merged commit d2472af into openclaw:main Mar 2, 2026
26 checks passed
safzanpirani pushed a commit to safzanpirani/clawdbot that referenced this pull request Mar 2, 2026
…penclaw#11478)

* Docker: add /healthz-based container HEALTHCHECK

* Docs/Docker: document built-in image HEALTHCHECK

* Changelog: note Dockerfile healthcheck probe

* Docs/Docker: explain HEALTHCHECK behavior in plain language

* Docker: relax HEALTHCHECK interval to 3m

---------

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
steipete pushed a commit to Sid-Qin/openclaw that referenced this pull request Mar 2, 2026
…penclaw#11478)

* Docker: add /healthz-based container HEALTHCHECK

* Docs/Docker: document built-in image HEALTHCHECK

* Changelog: note Dockerfile healthcheck probe

* Docs/Docker: explain HEALTHCHECK behavior in plain language

* Docker: relax HEALTHCHECK interval to 3m

---------

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
hanqizheng pushed a commit to hanqizheng/openclaw that referenced this pull request Mar 2, 2026
…penclaw#11478)

* Docker: add /healthz-based container HEALTHCHECK

* Docs/Docker: document built-in image HEALTHCHECK

* Changelog: note Dockerfile healthcheck probe

* Docs/Docker: explain HEALTHCHECK behavior in plain language

* Docker: relax HEALTHCHECK interval to 3m

---------

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
execute008 pushed a commit to execute008/openclaw that referenced this pull request Mar 2, 2026
…penclaw#11478)

* Docker: add /healthz-based container HEALTHCHECK

* Docs/Docker: document built-in image HEALTHCHECK

* Changelog: note Dockerfile healthcheck probe

* Docs/Docker: explain HEALTHCHECK behavior in plain language

* Docker: relax HEALTHCHECK interval to 3m

---------

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
dawi369 pushed a commit to dawi369/davis that referenced this pull request Mar 3, 2026
…penclaw#11478)

* Docker: add /healthz-based container HEALTHCHECK

* Docs/Docker: document built-in image HEALTHCHECK

* Changelog: note Dockerfile healthcheck probe

* Docs/Docker: explain HEALTHCHECK behavior in plain language

* Docker: relax HEALTHCHECK interval to 3m

---------

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
sachinkundu pushed a commit to sachinkundu/openclaw that referenced this pull request Mar 6, 2026
…penclaw#11478)

* Docker: add /healthz-based container HEALTHCHECK

* Docs/Docker: document built-in image HEALTHCHECK

* Changelog: note Dockerfile healthcheck probe

* Docs/Docker: explain HEALTHCHECK behavior in plain language

* Docker: relax HEALTHCHECK interval to 3m

---------

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
zooqueen pushed a commit to hanzoai/bot that referenced this pull request Mar 6, 2026
…penclaw#11478)

* Docker: add /healthz-based container HEALTHCHECK

* Docs/Docker: document built-in image HEALTHCHECK

* Changelog: note Dockerfile healthcheck probe

* Docs/Docker: explain HEALTHCHECK behavior in plain language

* Docker: relax HEALTHCHECK interval to 3m

---------

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
zooqueen pushed a commit to hanzoai/bot that referenced this pull request Mar 6, 2026
…penclaw#11478)

* Docker: add /healthz-based container HEALTHCHECK

* Docs/Docker: document built-in image HEALTHCHECK

* Changelog: note Dockerfile healthcheck probe

* Docs/Docker: explain HEALTHCHECK behavior in plain language

* Docker: relax HEALTHCHECK interval to 3m

---------

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docker Docker and sandbox tooling docs Improvements or additions to documentation size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants