Skip to content

[bug] 'complete' item refresh on a series fails with 'no rebuilt content found in refresh scope' and leaves the show unmatched with orphaned episodes #934

Closed

Description

@jkristoph

What happened

POST /api/v1/admin/items/{series id}/refresh-metadata {"mode":"complete"} on 31 series (after applying matches) failed on every one with no rebuilt content found in refresh scope, and left each show unmatched with its old ids and all episodes orphaned (161 episode files detached). Movies in the same batch refreshed fine. Recovery needed three steps: retry the library match queues (…/metadata-match-queue/retry), re-apply the matches, then quick refreshes.

Steps to reproduce

  1. A matched series with episodes (TVDB-anchored in our case).
  2. POST /api/v1/admin/items/{series id}/refresh-metadata {"mode":"complete"}.
  3. Job errors with no rebuilt content found in refresh scope; the series row is now unmatched and its episodes have no content link.

Expected behavior

complete should either rebuild the series and re-link its episodes, or fail without having destroyed the existing links. At minimum the destructive step should not run before the rebuild is known to succeed.

Silo version / commit

90b5c0f

Deployment

Docker

Clients affected

  • Other/not client-specific

Relevant logs

level=ERROR … item refresh failed mode=complete content_id=series-tvdb-… error="no rebuilt content found in refresh scope" (31 occurrences in one batch, one per series; every movie in the batch succeeded)

Technical notes

From reading internal/adminjob/item_refresh.go: complete mode clears the episodes' content links and re-ingests from the files, but series roots are rebuilt asynchronously by the scanner/match queue, so the synchronous "find rebuilt content" step runs before the root exists and the job errors after the destructive step has already committed. quick mode re-anchors correctly and is what we use now.

AI harness

Claude Code

AI tool(s)

Claude (Anthropic) — investigation and this report; a human operator reviewed before filing.

Activity

  1. added
    bug
    triaged
    and removed
    triaged
    on Sep 20, 2026
  2. added theissue type on Sep 20, 2026
  3. removed
    bug
    on Sep 20, 2026
  4. zZebrahz commented on Nov 2, 2026

    @zZebrahz
    Contributor

    Still reproduces on build 1804 · cc851494, and it reaches further than the series refresh in the report. Found while validating #1210 and #1211 C2 (parent #1209) on a test sandbox: the maintainer ran the refreshes from the web admin, and Claude Code read the resulting admin jobs, server logs and catalog rows.

    • Seasons and single episodes fail too. Complete Refresh on a matched series, on one of its seasons, and on one episode each ended with resolve rebuilt item: no rebuilt content found in refresh scope. Quick Refresh at all three levels completed.
    • The show was not left broken this time. Unlike the original report, the series stayed matched, and its episode file was linked again later without any intervention.
    • Until the files are linked again, the item can't be refreshed. POST /api/v2/admin/items/{id}/refresh-metadata returned 409 conflict for the series shortly after each failed Complete Refresh. The source points to the files having no content link at that moment: the resolver refuses a scope with no present files (firstPresentFileInLibrary in internal/adminjob/item_refresh.go), and Complete Refresh clears the links before it fails (prepareCompleteRefresh).
    • Reset to Provider is half-applied in that window. Edit Metadata → Reset to Provider first sends a PATCH that clears the locks, then requests a Quick Refresh. The PATCH succeeded and the refresh got the 409, so the series kept its manually edited title and overview with no locks until a later Quick Refresh replaced them.

    AI-assisted: drafted with Claude Code (claude-opus-5-5) and GitHub CLI at the maintainer's direction, from the maintainer's web admin run and Claude Code's reading of the job records, logs and source.

  5. added a commit that references this issue on Nov 14, 2026
    db18946
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions