Commit 2c87ed6
fix(node): always use paths::data_dir() for I/O, not config.storage.path
THE actual root cause of "binary exits after setup completes" — the
single thread connecting every failure mode in the v0.1.20-v0.1.38
saga.
Node::new at runner.rs:57 was constructing the storage_path from
`config.storage.path`, which defaults to `"./data"` (relative). When
fed to PathBuf::from + create_dir_all, that resolves relative to the
process's cwd:
- Start menu shortcut launch → cwd = `C:\Program Files\SourceBox
Sentry CloudNode\` → tries to create `Program Files\...\data\`
→ ERROR_ACCESS_DENIED for non-admin token (UAC-filtered admin
can't write to Program Files even when in the Administrators
group). This is what made the binary exit immediately every
time the user clicked the Start menu shortcut.
- PowerShell launch from System32 → cwd = `C:\Windows\System32` →
tries to create `System32\data\` → admin can write so it works
BUT writes to the wrong location entirely. This is why the user
had a `C:\Windows\System32\data\node.db` file showing up in
earlier diagnostic output.
- cwd = anywhere with a coincidentally-named `data` folder →
silently writes to the wrong place. (This is what caused the
Desktop\data pollution from yesterday's debugging.)
The diagnostic finally surfaced today thanks to v0.1.38's
pause-on-error: the user got a clean look at the error message,
then ran the binary as admin from PowerShell which succeeded but
streamed segments to:
"./data\hls\57db1eac_USB_Webcam\segment_00000.ts"
— relative path, working from System32 cwd. The `./data\` prefix
in that log line was the smoking gun.
Fix: stop trusting `config.storage.path` for I/O. Always use
`crate::paths::data_dir()` which already does correct absolute
resolution (env var → ProgramData on Windows / ./data on
non-Windows). The Node's filesystem layout is now independent of
how the binary was launched.
`config.storage.path` stays in the config struct because it's
exposed in the dashboard's settings page. Updated
`build_settings_info` to surface the actual absolute path
(`paths::data_dir().display().to_string()`) instead of the legacy
config field, so operators see WHERE their data actually lives.
This fixes:
- The Start-menu-shortcut "binary exits with Access denied"
- The "ran as admin from PowerShell so it works but writes to
System32\data" wrong-location problem
- The whole class of relative-path bugs that paths::data_dir
was supposed to insulate against but couldn't because Node
wasn't using paths::data_dir at all
Bumps version to 0.1.39.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent a65a7f9 commit 2c87ed6
3 files changed
Lines changed: 27 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
58 | 78 | | |
59 | 79 | | |
60 | 80 | | |
| |||
71 | 91 | | |
72 | 92 | | |
73 | 93 | | |
74 | | - | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
75 | 98 | | |
76 | 99 | | |
77 | 100 | | |
| |||
0 commit comments