Client fails at first start: it does not create its data directory #284
Labels
No labels
Area/Backend
Area/Database
Area/Docs
Area/Frontend
Area/Infra
Area/Security
Area/Tests
Area/Tooling
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Lang/Python
Lang/Rust
Lang/Shell
Lang/SQL
Lang/TypeScript
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Routing
Auto
Routing
Hold
Routing
Human
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Grimoirix/grimoire-of-digital-signage#284
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found while setting up a campus client (board GRI-2146), on
devata61eed0.What happens
On a fresh install (
install.sh client --server https://scryglass.sint-norbertus.be, Ubuntu 26.04), the install finishes without errors, but the player stops about one second after the autologin ofscryglass:The device then never reaches the server, so no pending device shows in the panel. Every new PC fails in this way.
Cause
config.rsresolves the data dir toGRIMOIRIX_SIGNAGE_DATA_DIR, else$XDG_DATA_HOME/grimoirix-signage, else~/.local/share/grimoirix-signage.Store::open(crates/client/src/state.rs) treats a missingclient.dbas an empty state, but nothing creates the directory itself, so the first write (temporary file + rename) fails.cache.rsdoes callcreate_dir_allfor its own directory;state.rsdoes not. The installer does not create the directory for thescryglassuser either.Fix
create_dir_all(data_dir)(mode0700) before the first write. That covers every install path, including theGRIMOIRIX_SIGNAGE_DATA_DIRandXDG_DATA_HOMEcases.Store::open+updateon a data dir that does not exist.Workaround, until it is fixed
Then log the session out, or reboot.
Fixed:
Store::open(crates/client/src/state.rs) now creates the data directory (0700, recursive) before its first write, covering GRIMOIRIX_SIGNAGE_DATA_DIR, XDG_DATA_HOME and the default path alike. Added tests for opening against a data directory that does not exist yet, and for its permissions.cargo test -p client --lib state::passes (13/13) and./scripts/local-gates.sh --rust-onlypasses. Did not change install.sh — the client-side fix already covers every install path, per the issue's own analysis. PR: #287CI on PR #287 is green: cargo clippy, cargo fmt, cargo test, cargo deny, repository boundary and the pre-push hook all passed on
281aede9. Ready for review/merge into dev.Fixed by #287, merged into dev. No deploy to the test servers (PO hold).