From 02a568fb97c83e4d1c1e28524cb99eabd429ea29 Mon Sep 17 00:00:00 2001 From: Frank Date: Sat, 31 Oct 2026 03:41:22 -0700 Subject: [PATCH] docs(media): the Jellyfin scan 401 was curl-config quoting, not the server MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Corrects the lesson written an hour ago, which said a non-204 was transient and should simply be re-issued. It is reproducible and mechanical: `printf` with `\"` inside the single-quoted format string drops the backslash, curl then ends the quoted value at the first bare quote, and Jellyfin receives `Authorization: MediaBrowser Token=` with an empty key. Both forms were run against the host in one pass — `\\"` answers 204, `\"` answers 401 — so the block's double backslashes are load-bearing, and the handoff script that deviated left a 58k-move library unscanned for 40 minutes. Also the trap that diagnosis walked into: a second accepted refresh while a scan is running moves `Scan Media Library` to `Cancelling` and the pass starts over. One accepted request is the procedure; wait it out. --- serverAppConfigs-docs/Dankserver/Media Relayout.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/serverAppConfigs-docs/Dankserver/Media Relayout.md b/serverAppConfigs-docs/Dankserver/Media Relayout.md index 5c747e0..8ff15ed 100644 --- a/serverAppConfigs-docs/Dankserver/Media Relayout.md +++ b/serverAppConfigs-docs/Dankserver/Media Relayout.md @@ -100,8 +100,8 @@ podman exec -i plex sh -c 'read -r T [[Jellyfin]]'s scan key lives in `~/.config/secrets/jellyfin` (mode 600; the same value is `JELLYFIN_API_KEY` in the ignored `dankserver/.env`). It rides a -mode-600 curl config, never a header argument, and it must use the -`MediaBrowser` form — Jellyfin 12.4 refuses a bare `X-Emby-Token` for any key: +mode-600 curl config, never a header argument, in the `MediaBrowser` form — +Jellyfin 12.4 refuses a bare `X-Emby-Token`, and the backslashes below matter: ```bash umask 077 @@ -113,7 +113,7 @@ curl -s -K /tmp/jf.hdr -o /dev/null -w "jellyfin scan: %{http_code}\n" shred -u /tmp/jf.hdr ``` -`204` is acceptance — anything else is no scan queued, `401` included (a handoff logged `401` with the same key and form that answered `200` seconds later), so re-issue rather than diagnose. The scan then runs on the server's own schedule. +`204` is acceptance; anything else queued no scan, so re-issue it. A `401` from a key that answers `200` on a hand-typed request is this block's quoting, not the server: bash `printf` collapses `\"` to `"`, curl ends the quoted string at that quote, and Jellyfin receives `Authorization: MediaBrowser Token=` with nothing after it. Both forms were run against this host: `\\"` answers `204`, `\"` answers `401`. One accepted refresh is the whole procedure — a second one while a scan runs moves `Scan Media Library` to `Cancelling` and the pass starts over, so wait it out instead of poking it. ### Proving the move landed