1. A sync bug that burned a CPU core for six days
- Situation
- On Jellyfin 12.1, the server sat at one full CPU core and the logs filled with errors (about 6,000 an hour). Nothing alerted anyone, so it ran for six days.
- What I did
- I read the logs and traced it. On 12.1, reading one playlist with an API key answers 400, so jhub’s fallback concluded that every playlist was shared, and then deleted and re-created 123 of 125 mapped playlists on every pass. Jellyfin appended a "1" to each re-created folder name until names hit 255 characters and creation failed. The fix took two passes: edit playlists in place and remake only when sharing is confirmed, at most once a day (D92), then handle the next quirks that showed in the live worker log (D92b). I also had the agents write a cleanup script that runs as a dry run first. Then I added a daily health check at 03:00 so a silent failure cannot run for days again (D93): Jellyfin error volume, CPU while idle, playlist count against what jhub maps, an API contract probe, repeated worker warnings.
- Result
- The folders went from 377 to 130 (248 junk playlists removed), Jellyfin errors from about 6,000 an hour to 0, and idle CPU to about 0.1%. The health check’s first dry run over the old logs flagged 76,500 errors in 24 hours, so it would have caught this on day one.
The skill here is reading logs and finding the real trigger, not the first one that looks plausible.