Jellyfin connector: every theme upload fails with "database table is locked: theme_ownership"

Open
#706 2 comments 1 reaction 1 assignee View on GitHub

Maintainers usually reply within 1 day

@ReenigneArcher is already working on this.

Since Nov 11, 2026.

  • #716 by @ReenigneArcher — open

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
csharp, docker, sqlite
Domain
backend, database

Research direction

Start with connectors/jellyfin/ThemeOwnership.cs and trace how Record() holds its transaction while the writeTheme callback reaches ThemeFiles.State() and Find(); then inspect the related ThemeFiles.Save() flow. Reproduce an upload against Jellyfin 10.11.11 and check the connector logs. Done means uploads write the theme file and record ownership without the SQLite table lock error.

Written by the indexing model from the issue text.

Description

Describe the Bug

Every theme upload to Jellyfin fails. Plex uploads from the same Themerr instance work.

  • Themerr: lizardbyte/themerr:v2026.1108.23838 (Docker)
  • Themerr Connector: 2026.1108.238.38, installed from Themerr's own repository
  • Jellyfin: 10.11.11 (Docker, Linux)

Jellyfin log, on every upload (106 of 106 attempts so far):

[ERR] Themerr.Connector.Controller: Could not access connector theme storage.
Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 6: 'database table is locked: theme_ownership'.
   at Microsoft.Data.Sqlite.SqliteDataReader.NextResult()
   ...
   at Themerr.Connector.ThemeOwnership.Find(Guid itemId)
   at Themerr.Connector.ThemeFiles.State(Guid itemId, String root, Int32 themeSongCount)
   at Themerr.Connector.ThemeFiles.<>c__DisplayClass9_0.<Save>b__0()
   at Themerr.Connector.ThemeOwnership.Record(Guid itemId, String file, String digest, Action writeTheme)
   at Themerr.Connector.ThemeFiles.Save(...)
   at Themerr.Connector.Controller.Upload(Guid itemId, CancellationToken cancellationToken)

Themerr records these items as "Jellyfin could not complete this request." No theme file is written.

The stack points at connectors/jellyfin/ThemeOwnership.cs: Record() opens a read-write context, begins a transaction and calls SaveChanges(), then runs the writeTheme callback before committing. That callback calls ThemeFiles.State() → ThemeOwnership.Find(), which opens a second connection and reads theme_ownership while the first connection still holds the uncommitted write. The code is the same on master.

Expected Behavior

The upload writes the theme file, and ownership is recorded.

Additional Context

Possible fixes: compute the state before Record() opens its transaction, or have the callback reuse Record()'s context instead of opening a new connection.

Library folders are writable by Jellyfin. The connector installs and loads normally, and Themerr's scan finds the Jellyfin items without the "deferred" warning.

Dominant language
Python
Stars
97
Forks
7
Avg merge
16h 30m
Merged PRs (30d)
71

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from LizardByte/Themerr

All issues in LizardByte/Themerr

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.