fix(runtime): preserve entrypoint log across restarts (#110) - #1323
Open
ptone wants to merge 1 commit into
Open
Conversation
Change the .scion-entrypoint.log redirect from > (truncate) to >> (append) so that a restart preserves the previous run's diagnostic output. Add a timestamped run-delimiter line at the start of each run to make boundaries unambiguous in appended output. This file is the ONLY record of failures that occur before, around, or outside sciontool's own logger — shell-level errors such as "command not found", exec failures, and any diagnostic written to stdout/stderr without going through log.go. Those failures produce a bare exit code in the UI and nothing else; this file is where the explanation lives. A truncating open on restart destroys that explanation at the exact moment the operator retries. The sister diagnostic agent.log (opened O_APPEND at pkg/sciontool/log/log.go:144) already appends without rotation in the same directory. This change makes the two consistent. Growth is unbounded across restarts, matching agent.log. If disk pressure from diagnostic logs becomes a concern, rotation should be added to both files together — that data does not exist yet. This fix does not help the current live instance (sn-harness-lab, image scion-omni:f99a818, built 2026-08-26). Deploying new code requires a redeploy, which on this tier destroys every project and agent — including the evidence this fix is designed to preserve. This protects the next operator, not the current one.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.scion-entrypoint.logredirect from>(truncate) to>>(append) so restarts preserve the previous run's crash diagnostic--- entrypoint start <ISO8601> ---) at each start so appended runs are unambiguousentrypointLogFileconstant comment to correctly describe the file's unique value and name Converge 'hub-native' naming to 'hub-managed' #110Context
Discovered during #109 investigation: two agents died on the live instance (exit 127 and exit 1). The operator's natural recovery — restart the agent — would have truncated the only file that explains why the previous run failed.
.scion-entrypoint.logcaptures shell-level errors, exec failures, and diagnostics written outside sciontool's logger. Those failures produce a bare exit code in the UI and nothing else.The sister diagnostic
agent.logalready appends without rotation (O_APPENDatpkg/sciontool/log/log.go:144). Both files were introduced in the same commit (ea35abf), in the same directory, with opposite retention semantics and no comment referencing the other. The asymmetry was an unowned default, not a decision.What this does NOT do
This fix does not help the current live instance (
sn-harness-lab, imagescion-omni:f99a818). Deploying new code requires a redeploy, which on this tier destroys every project and agent on the instance. This protects the next operator, not the current one.Test plan
go vet ./pkg/runtime/...— cleangofmt— cleangolangci-lint run ./pkg/runtime/...— 0 issuesgo test ./pkg/runtime/... -count=1— all pass.scion-entrypoint.logcontains both runs with delimiter between them