Repository navigation
fix: recover arr logins after an aborted install (v1.2.1) - #7
Conversation
An install that fails at docker compose pull or the health gate stops before the wiring steps. The containers can be started by hand and answer health checks, but no Sonarr/Radarr/Prowlarr user was ever created, so the password in admin.txt is rejected. `arrstack update` now seeds a missing arr admin user from admin.txt, and never overwrites credentials the user changed in the UI. `arrstack doctor` flags state.json without install_completed_at so the incomplete install, not the password, is visible as the cause. Docs get the failure signature and the `arrstack install --resume` recovery path.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
The unreachable-API tests relied on connection-refused errors being non-retryable. On GitHub's runners the error matched withRetry's retry predicate, so each test burned the full 15.5s backoff and tripped the 5s test timeout. Mock fetch instead: failure and 403 paths are now deterministic and cannot hit a real arrstack install.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6b8405fdbd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // admin user, so the password in admin.txt cannot log in. Seed any arr that | ||
| // has no user yet. Best-effort: never fail an update over this. | ||
| const seedStart = d.now(); | ||
| await reseedArrAdmins(installDir, state, d.seedArrAdmin, logAndEcho); |
There was a problem hiding this comment.
Restrict login recovery to interrupted installs
On every update of a completed installation, this unconditionally runs the recovery path, and seedArrAdmin interprets blank username/password fields as an aborted install. A user who intentionally configured an arr service for external or disabled authentication and cleared those fields will therefore have the next update overwrite that configuration with forms authentication and the credentials from admin.txt. Gate this recovery on the existing !state.install_completed_at signal (or otherwise distinguish an interrupted install) so updates preserve intentional authentication settings.
Useful? React with 👍 / 👎.
| const username = text.match(/^username:\s*(.+)$/m)?.[1]?.trim(); | ||
| const password = text.match(/^password:\s*(.+)$/m)?.[1]?.trim(); |
There was a problem hiding this comment.
Keep credential parsing on the current line
When admin.txt contains an empty password field, which is one of the incomplete-file cases this helper promises to reject, \s* consumes the newline and (.+) captures the following generated: line as the password. The update recovery path can then seed the arr account with that unintended value while the file still shows no usable password. Match only horizontal whitespace after the colon so an empty field returns null.
Useful? React with 👍 / 👎.
| 2. Re-renders `docker-compose.yml` and `Caddyfile` from the current binary's templates, so installer fixes reach an existing install. | ||
| 3. Runs `docker compose pull` against the generated `docker-compose.yml` so every enabled service fetches its latest image. | ||
| 4. Runs `docker compose up -d`, which recreates only the containers whose images changed. | ||
| 5. Health-checks every enabled service and seeds a missing Sonarr, Radarr, or Prowlarr admin user from `admin.txt`. This repairs arr logins left behind by an install that aborted before its wiring steps. |
There was a problem hiding this comment.
Limit the documented health checks to HTTP services
This now promises that update health-checks every enabled service, but runHealthChecks explicitly filters to services whose catalog health type is http. Enabled services such as Caddy and Recyclarr are therefore not checked, so an update may report completion even when one of them is unavailable while users are told it was verified. Either add checks for the remaining service health types or document the HTTP-only scope.
Useful? React with 👍 / 👎.
What
Fixes the login failure reported in #6 and releases v1.2.1.
arrstack updatenow seeds a missing Sonarr/Radarr/Prowlarr admin user fromadmin.txtafter the health gate. This repairs installs that aborted atdocker compose pulland were started manually, where the containers are healthy but no admin user exists.seedArrAdminonly writes when the instance has no username/password. It no longer resets credentials the user changed in the UI.arrstack doctorreports an incomplete install whenstate.jsonhas noinstall_completed_at, with thearrstack install --resumefix.Why
Issue #6: an aborted install writes
admin.txtbefore Docker, then never reaches the wiring steps. Manually runningdocker compose up -dstarts healthy containers with no login user.How it was tested
bun test: 330 pass.bun run typecheck: clean.lscr.io/linuxserverSonarr 4.0.19, Radarr, and Prowlarr containers: seeding returnedseeded,curl -X POST /loginreturned 302 with an auth cookie, wrong password redirected tologinFailed=true, and a second seed returnedexists.ghcr.io/recyclarr/recyclarr:8resolves;:latestdoes not.Checklist
bun testpassestsc --noEmitpasses