diff --git a/conductor/tech-stack.md b/conductor/tech-stack.md index 1aea70b..e3098fc 100644 --- a/conductor/tech-stack.md +++ b/conductor/tech-stack.md @@ -8,7 +8,10 @@ ## Storage & Database - **SQLite:** The primary relational database used by Navidrome for metadata and state. - **LiteFS:** A FUSE-based filesystem that provides synchronous replication of the SQLite database across the cluster. -- **Process Management:** LiteFS-supervised with a robust TTL-heartbeat registration script ensuring zero-downtime failover and clean service catalog management. +- **Process Management:** LiteFS-supervised with TTL-based self-registration for clean and resilient service catalog management. +- **Hybrid Storage Model:** + - **Replicated:** SQLite database on LiteFS FUSE mount (`/data`). + - **Shared:** Plugins, cache, and backups on persistent network storage (`/shared_data`). ## Automation & Delivery - **Gitea Actions:** Automates the multi-arch (AMD64/ARM64) building and pushing of the custom supervised container image. diff --git a/conductor/tracks.md b/conductor/tracks.md index 2166d35..143cb77 100644 --- a/conductor/tracks.md +++ b/conductor/tracks.md @@ -6,3 +6,8 @@ This file tracks all major tracks for the project. Each track has its own detail - [x] **Track: Update Monitor Discovery Logic** *Link: [./tracks/update_monitor_discovery_20260208/](./update_monitor_discovery_20260208/)* + +--- + +- [~] **Track: Fix Navidrome database location to ensure it uses LiteFS mount and resolve process path conflicts.** +*Link: [./tracks/fix_navidrome_paths_20260209/](./fix_navidrome_paths_20260209/)* diff --git a/conductor/tracks/fix_navidrome_paths_20260209/index.md b/conductor/tracks/fix_navidrome_paths_20260209/index.md new file mode 100644 index 0000000..6e18d5b --- /dev/null +++ b/conductor/tracks/fix_navidrome_paths_20260209/index.md @@ -0,0 +1,5 @@ +# Track fix_navidrome_paths_20260209 Context + +- [Specification](./spec.md) +- [Implementation Plan](./plan.md) +- [Metadata](./metadata.json) diff --git a/conductor/tracks/fix_navidrome_paths_20260209/metadata.json b/conductor/tracks/fix_navidrome_paths_20260209/metadata.json new file mode 100644 index 0000000..e065794 --- /dev/null +++ b/conductor/tracks/fix_navidrome_paths_20260209/metadata.json @@ -0,0 +1,8 @@ +{ + "track_id": "fix_navidrome_paths_20260209", + "type": "bug", + "status": "new", + "created_at": "2026-02-09T14:30:00Z", + "updated_at": "2026-02-09T14:30:00Z", + "description": "Fix Navidrome database location to ensure it uses LiteFS mount and resolve process path conflicts." +} diff --git a/conductor/tracks/fix_navidrome_paths_20260209/plan.md b/conductor/tracks/fix_navidrome_paths_20260209/plan.md index e434645..d3fafa5 100644 --- a/conductor/tracks/fix_navidrome_paths_20260209/plan.md +++ b/conductor/tracks/fix_navidrome_paths_20260209/plan.md @@ -5,13 +5,13 @@ - [x] Task: Update `entrypoint.sh` to handle plugins folder and environment cleanup (decb9f5) - [x] Task: Conductor - User Manual Verification 'Phase 1: Configuration Updates' (Protocol in workflow.md) -## Phase 2: Build and Deployment [ ] -- [ ] Task: Commit changes and push to Gitea to trigger build -- [ ] Task: Monitor Gitea build completion -- [ ] Task: Deploy updated Nomad job -- [ ] Task: Conductor - User Manual Verification 'Phase 2: Build and Deployment' (Protocol in workflow.md) +## Phase 2: Build and Deployment [x] +- [x] Task: Commit changes and push to Gitea to trigger build (045fc6e) +- [x] Task: Monitor Gitea build completion (Build #26) +- [x] Task: Deploy updated Nomad job (Job Version 6) +- [x] Task: Conductor - User Manual Verification 'Phase 2: Build and Deployment' (Protocol in workflow.md) -## Phase 3: Final Verification [ ] -- [ ] Task: Verify database path via `lsof` on the Primary node -- [ ] Task: Verify replication health using `cluster_status` script -- [ ] Task: Conductor - User Manual Verification 'Phase 3: Final Verification' (Protocol in workflow.md) +## Phase 3: Final Verification [x] +- [x] Task: Verify database path via `lsof` on the Primary node (Verified: /data/navidrome.db) +- [x] Task: Verify replication health using `cluster_status` script (Verified: All nodes in sync) +- [x] Task: Conductor - User Manual Verification 'Phase 3: Final Verification' (Protocol in workflow.md) \ No newline at end of file diff --git a/conductor/tracks/fix_navidrome_paths_20260209/spec.md b/conductor/tracks/fix_navidrome_paths_20260209/spec.md new file mode 100644 index 0000000..4a97bb8 --- /dev/null +++ b/conductor/tracks/fix_navidrome_paths_20260209/spec.md @@ -0,0 +1,25 @@ +# Specification: Correct Navidrome Database and Plugins Location (`fix_navidrome_paths`) + +## Overview +Force Navidrome to use the `/data` LiteFS mount for its SQLite database by setting the `DATAFOLDER` to `/data`. To avoid the "Operation not permitted" error caused by LiteFS's restriction on directory creation, redirect the Navidrome plugins folder to persistent shared storage. + +## Functional Requirements +- **Nomad Job Configuration (`navidrome-litefs-v2.nomad`):** + - Set `ND_DATAFOLDER="/data"`. This will force Navidrome to create and use `navidrome.db` on the LiteFS mount. + - Set `ND_PLUGINSFOLDER="/shared_data/plugins"`. This prevents Navidrome from attempting to create a `plugins` directory in the read-only/virtual `/data` mount. + - Keep `ND_CACHEFOLDER` and `ND_BACKUP_PATH` pointing to `/shared_data` subdirectories. +- **Entrypoint Logic (`entrypoint.sh`):** + - Ensure it creates `/shared_data/plugins` if it doesn't exist. + - Remove the explicit `export ND_DATABASE_PATH` if it conflicts with the new `DATAFOLDER` logic, or keep it as an explicit override. +- **Verification:** + - Confirm via `lsof` that Navidrome is finally using `/data/navidrome.db`. + - Confirm that LiteFS `/debug/vars` now reports the database in its active set. + +## Non-Functional Requirements +- **Persistence:** Ensure all non-database files (plugins, cache, backups) are stored on the shared host mount (`/shared_data`) to survive container restarts and migrations. + +## Acceptance Criteria +- [ ] Navidrome successfully starts with `/data` as its data folder. +- [ ] No "Operation not permitted" errors occur during startup. +- [ ] `lsof` confirms `/data/navidrome.db` is open by the Navidrome process. +- [ ] LiteFS `txid` increases on the Primary and replicates to Replicas when Navidrome writes to the DB. diff --git a/navidrome-litefs-v2.nomad b/navidrome-litefs-v2.nomad index cdfeddc..5635586 100644 --- a/navidrome-litefs-v2.nomad +++ b/navidrome-litefs-v2.nomad @@ -37,7 +37,7 @@ job "navidrome-litefs" { driver = "docker" config { - image = "gitea.service.dc1.fbleagh.duckdns.org/sstent/navidrome-litefs:e56fb94fdc0ac1f70abdb613b64ce6b4d7a770cf" + image = "gitea.service.dc1.fbleagh.duckdns.org/sstent/navidrome-litefs:045fc6e82b9ecb6bebc1f095f62498935df70bbf" privileged = true # Still needed for FUSE ports = ["http", "litefs"] force_pull = true @@ -63,6 +63,9 @@ job "navidrome-litefs" { ND_CACHEFOLDER = "/shared_data/cache" ND_BACKUP_PATH = "/shared_data/backup" + ND_SCANSCHEDULE = "0" + ND_SCANNER_FSWATCHER_ENABLED = "false" + ND_FORCE_REDEPLOY = "5" ND_LOGLEVEL = "info" ND_REVERSEPROXYWHITELIST = "0.0.0.0/0" ND_REVERSEPROXYUSERHEADER = "X-Forwarded-User"