Uh oh!
There was an error while loading. Please reload this page.
fix(installer): run the network-FS guard before the log dir is created - #441
Merged
Conversation
#432) setup_log_file mkdirs HOST_DATA_DIR and tees the whole session's output onto it BEFORE run_preflight fires — so on the exact machine the network-FS guard was built for (NFS home + sudo + root_squash), the unguarded mkdir failed with a bare error, or the log dir landed squashed/nobody-owned, before the friendly named failure could print. New early_data_dir_guard runs right after validate_config and before setup_log_file: same filesystem classification (extracted as the shared _pf_is_network_fstype), console-only, silent on local/undetermined filesystems, defers to the full check's warning under TRACEBLOC_ALLOW_NETWORK_FS. The call is declare -F-guarded so a stale bootstrap without the new helper proceeds as before. Closes#432 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
LukasWodka
commented
Jul 27, 2026
ContributorAuthor
bugbot run |
Uh oh!
There was an error while loading. Please reload this page.
…#441) The guard advised HOST_DATA_DIR=/local/path, but validate_config requires the data dir under $HOME (Bugbot #384 hardening) — so the exact audience this guard exists for (network home) was pointed at a fix that fails validation on re-run. The copy now states the real constraint and the two workable paths (local-home user, or the explicit TRACEBLOC_ALLOW_NETWORK_FS=1 override with its risk), and notes that datasets may stay on network storage via HOST_DATASET_DIR. Test asserts the impossible advice stays gone. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
LukasWodka
commented
Jul 27, 2026
ContributorAuthor
bugbot run |
Uh oh!
There was an error while loading. Please reload this page.
… r2) The early guard's job is protecting the pre-log mkdir; an existing data dir has no at-risk mkdir, and a healthy machine's re-run must keep reaching the assess hand-off exactly as it did when the network-FS check lived only in run_preflight. Existing dir -> silent pass; the full preflight guard still classifies network storage for real (re)installs. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
LukasWodka
commented
Jul 27, 2026
ContributorAuthor
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit e4642d6. Configure here.
saadqbal
approved these changes
Jul 27, 2026
Uh oh!
There was an error while loading. Please reload this page.
1 task
shujaatTracebloc added a commit
that referenced
this pull request
Jul 31, 2026
…isn't writable (#512) #432's documented core — running the network-FS guard before the log dir is created in the FULL install — already shipped in #441 (early_data_dir_guard runs before setup_log_file; validate_config before it only validates, never mkdirs). This closes the remaining path #441 didn't cover: prepare-host calls setup_log_file BEFORE any guard, and setup_log_file did a bare `mkdir -p "$HOST_DATA_DIR"` + tee — so on an NFS home under sudo + root_squash (the exact scenario #432 names) it failed with a cryptic error before any friendly message. setup_log_file now chooses its path via _choose_log_file: HOST_DATA_DIR when it's creatable AND writable, else a temp file (the scope's "start logging in a temp location" option) — so no install path dies on a bare mkdir/tee. The full install's early_data_dir_guard still refuses a network DATA dir before this runs, unchanged. (Also: the temp template uses trailing X's — BSD mktemp on macOS rejects a suffix after XXXXXX.) Tests: _choose_log_file returns a path under a writable HOST_DATA_DIR, and falls back to a temp path (never a bare failure) when the dir is uncreatable/unwritable. Closes#432
This was referenced Jul 31, 2026
Closed
shujaatTracebloc added a commit
that referenced
this pull request
Jul 31, 2026
…hare the good one (#518) _pf_storage_type told operators to set HOST_DATA_DIR="$HOME/.tracebloc", but on a network HOME that path is still NFS (the very problem), and validate_config rejects paths OUTSIDE $HOME — so the printed fix could never work. early_data_dir_guard (#441) already had a followable remedy for exactly this. Extract that remedy into a shared _pf_network_fs_remedy and use it in BOTH _pf_storage_type and early_data_dir_guard, so they can't drift: name the options that actually work (install as a user whose home is on a local disk, or TRACEBLOC_ALLOW_NETWORK_FS=1), and note datasets may stay on network storage via HOST_DATASET_DIR. Tests: _pf_storage_type NFS now prints the followable remedy and NOT the old ~/.tracebloc advice; a consistency test asserts both callers emit the same remedy. Closes#479
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 freeto 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
The NFS/root-squash guard is good — but it fires after
setup_log_filehas alreadymkdir'dHOST_DATA_DIRand redirected the session's output onto it. On the exact machine the guard exists for (NFS home,sudo,root_squash), the install dies on a baremkdirerror — or leaves a squashed/nobody-owned log dir — before the guard's friendly, named failure can print.Change
_pf_is_network_fstype— the filesystem classification extracted from_pf_storage_type(shared, single list; the full check's user-visible strings are byte-identical).early_data_dir_guard— runs right aftervalidate_config, beforesetup_log_file: silent on local/undetermined filesystems, refuses network filesystems with the named fix (HOST_DATA_DIR=/local/path), and defers to the full preflight warning whenTRACEBLOC_ALLOW_NETWORK_FS=1.declare -F-guarded (same stale-bootstrap pattern as the assess/host_audit gates).setup_log_fileinmain());manifest.sha256regenerated.Independent of the #437→#440 stack (different manifest lines) — mergeable in any order relative to it.
Type
Bug fix
Test plan
Full bats suite green locally (incl. copy catalog — no golden drift);
bash -n+shellcheck --severity=errorclean;gen-manifest.sh --checkclean.🤖 Generated with Claude Code
Note
Low Risk
Installer-only ordering and messaging change with regression tests; no runtime cluster or auth behavior changes.
Overview
Moves the NFS/network-home failure earlier so users see a clear refusal instead of a bare
mkdirerror or a root-squashed log dir whensetup_log_filecreatesHOST_DATA_DIRbefore preflight runs.Adds
early_data_dir_guardinpreflight.sh, invoked frominstall-k8s.shright aftervalidate_configand beforesetup_log_file(with the samedeclare -Fstale-bootstrap pattern as other gates). Network filesystem types are centralized in_pf_is_network_fstype, reused by the existing_pf_storage_typecheck (behavior unchanged there). The early guard skips when the data directory already exists so healthy re-runs still reach assess (#441), honorsTRACEBLOC_ALLOW_NETWORK_FS, and uses remediation text that fitsHOST_DATA_DIRunder$HOME(no bogus/local/pathadvice).Six new bats cases cover classification, pass/fail paths, and install ordering;
manifest.sha256is updated.Reviewed by Cursor Bugbot for commit e4642d6. Bugbot is set up for automated code reviews on this repo. Configure here.