v0.31.11
Fixed
-
lager box config applyno longer reports success while applying nothing.
applyrunsstart_box.shon the box as the login user, and its four
box-config renderers create files in/etc/lager(box_config.docker.sh,
user_requirements.txt,cargo_packages.txt,npm_packages.txt). Creating a
file needs write permission on the directory, andlager installleft
/etc/lagerowned by the container user only (33:33, mode755) — so every
render failed withEACCES. Renders are soft-failed by design (the container
must always come up), which turned this into a silent no-op: the install steps
read files that were never written, soapplyskipped them, stamped the
applied-hash, and printed "Applied box config". Everypip/cargo/npm
package, mount, volume, and env var added throughlager box configwas
quietly dropped on any box whose last provisioning step was an install.
/etc/lageris now33:<box-user-group>mode2775(setgid), so the
container (owner) andstart_box.sh(group) can both write it. -
/etc/lageris no longer world-writable.lager updategranted the box
user write access by runningchmod 777on the directory, which also gave it
to every other local account — enough to replacebox_config.json,
saved_nets.json, or the org secrets. It now gets the same owner/group/setgid
treatment as above, which is what the two writers actually need and nothing
more. This is also why the breakage above was invisible for so long: an
updated box ended up world-writable and rendered fine, while a freshly
installed box was owner-only and silently applied nothing — the two paths
disagreed. -
A box-config render failure is now loud, and no longer poisons the retry.
A failed render printed a one-line warning and a raw Python traceback. It now
reports which file could not be written, why, and how to repair it.
start_box.shexits3— a new code meaning "the container is up, but the
config on disk was not applied to it" — andapplyneither stamps the
applied-hash nor rolls back on it. Not stamping the hash is the load-bearing
half: it previously did, so the retry after a fix short-circuited on "Config
unchanged since last apply; skipping restart" and the config could never be
applied. Rolling back is wrong here because the container is healthy and the
fault is environmental — restoring the previous config and re-bouncing would
fail identically. A genuine bounce failure (container possibly down) still
rolls back exactly as before. A failed in-containerpip/cargo/npm
install now exits3for the same reason — those steps run after
docker run, so they already reported "container is up but ... may be
incomplete" while exiting1and triggering a rollback of a healthy
container. -
An uncaught exception in a script run inside the box container no longer
buries the real error.lager_excepthookreadLAGER_HOST_MODULE_FOLDER
withos.environ[...]in order to rewrite host paths out of tracebacks. That
variable is set bylager python; anything else that execs a script into the
container leaves it unset, so the exception handler raisedKeyError—
Python then printed "Error in sys.excepthook:" followed by a traceback from
inside lager, and only after that the user's actual exception. A one-line
ModuleNotFoundErrorarrived buried under a stack trace pointing at lager
internals. With no host paths to rewrite, the traceback is now printed
unchanged.