Skip to content

fix(greffer): wire updater compose dir from GREFFER_HOST_CONFIG_DIR (prod remote update) - #92

Closed
omarsy wants to merge 2 commits into
mainfrom
fix/updater-host-config-dir
Closed

omarsy wants to merge 2 commits into
mainfrom
fix/updater-host-config-dir

Conversation

@omarsy

@omarsy omarsy commented Jun 17, 2026

Copy link
Copy Markdown
Member

Bug (hit in the first real prod update)

A manager-triggered update reached the greffer but failed:

remote_update_spawn_failed target=0.3.4 err=greffer has no mount at /app; cannot wire the updater  (HTTP 500)

spawn_updater discovered the host compose-dir path by inspecting the greffer container's /app bind mount. That mount only exists in dev (./:/app). In production the app is baked into the image (COPY . /app, no bind mount), so there's nothing to discover. A container fundamentally can't learn a host path that isn't mounted into it — so remote update was broken on every production greffer.

Fix

Take the host compose dir from GREFFER_HOST_CONFIG_DIR (the v2 design's intent) for the /work mount; fall back to /app-bind discovery when it's unset (dev, unchanged). The /data mount is a named volume — still discoverable in prod — so it's untouched. If neither is available, the error now points the operator at GREFFER_HOST_CONFIG_DIR.

  • settings.greffer_host_config_dir (binds GREFFER_HOST_CONFIG_DIR)
  • controller /update/ route passes it through
  • tests: prod path (no /app, uses host_config_dir), env-overrides-/app, and the improved missing-dir error. Full apps.greffer suite green (554).
  • docs/release-signing.md: GREFFER_HOST_CONFIG_DIR documented as the one required per-host setting on 0.3.4+.

Operator action after deploy

Set in each greffer's env.env: GREFFER_HOST_CONFIG_DIR=/root/.greffer (the dir holding docker-compose.yml), then recreate. (This will also need to ship in the greffer-cli's rendered env/compose so new installs get it.)

🤖 Generated with Claude Code

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

…prod)

spawn_updater discovered the host compose-dir path by inspecting the greffer
container's /app BIND mount. That mount only exists in dev (./:/app); in
production the app is baked into the image (COPY . /app, no mount), so a remote
update failed with "greffer has no mount at /app; cannot wire the updater" (500).
A container can't discover a host path that isn't mounted into it.

Take the host compose dir from GREFFER_HOST_CONFIG_DIR (the v2 design's intent)
for the /work mount; fall back to /app-bind discovery when it's unset (dev). The
/data mount is a named volume, still discoverable in prod, so it's unchanged.
Empty + no /app -> clear error pointing at GREFFER_HOST_CONFIG_DIR.

- settings: greffer_host_config_dir (binds GREFFER_HOST_CONFIG_DIR)
- controller route passes it to spawn_updater
- tests: prod path (no /app, host_config_dir used), override-wins, and the
  improved missing-dir error. Full app suite green (554).
- docs/release-signing.md: GREFFER_HOST_CONFIG_DIR is the one required per-host
  setting on 0.3.4+.

Operator action: set GREFFER_HOST_CONFIG_DIR=/root/.greffer (the dir holding
docker-compose.yml) in env.env.
@omarsy
omarsy force-pushed the fix/updater-host-config-dir branch from bc3e691 to ba40c3c Compare June 17, 2026 15:05
Completes the host-config-dir fix: the remote-update controller needs the host
compose-dir path to mount into the spawned updater, but the greffer can't
discover it (the dir isn't bind-mounted into the container). The CLI renders the
config into that dir, so it's the one component that knows the absolute host
path. write_config now records GREFFER_HOST_CONFIG_DIR=<abs config dir> in
env.env, so a fresh 'greffer up' wires remote update with no manual step.

Existing installs (fast-path, env.env not rewritten) still need the line added
once by hand or a re-init. Test asserts write_config emits it.
@omarsy

omarsy commented Jun 17, 2026

Copy link
Copy Markdown
Member Author

Added the missing production wiring: greffer up (write_config) now records GREFFER_HOST_CONFIG_DIR=<abs config dir> in the generated env.env, so a fresh install wires remote update with no manual step. Without this the setting existed but nothing populated it — the greffer can't discover the host compose-dir path because that dir isn't bind-mounted into the container (/data and the socket are, the compose dir isn't). Existing installs (fast-path, env.env not rewritten) still need the line added once by hand.

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