Skip to content

[bug] Jellyfin play sessions expire after 6 hours although the router intends 24 #2899

Closed

Description

@Quick104

What happened

Jellyfin play sessions stop working 6 hours after PlaybackInfo, while the code intends them to last 24 hours. Every follow-up URL that authenticates by PlaySessionId alone then returns 401. That covers the HLS master and child playlists, segments, and font attachments. A Jellyfin client paused overnight, or playing long content, loses its stream.

internal/jellycompat/router.go sets the compat playback store's lifetime to playback.MaxTokenTTL (24 h). Its comment explains that 6 h expired long and paused-overnight sessions while the stream token was still valid. The router only uses that default when jellyfin_compat.playback_session_ttl is zero or unset, though. Every database is seeded with 6h, so 6 h is what runs. Expiry is absolute from creation.

Reproduced 1 of 1 on a Silo dev deployment.

Steps to reproduce

  1. Start from a database at the default settings, where jellyfin_compat.playback_session_ttl is the seeded 6h.
  2. Sign in on the Jellyfin port with POST /Users/AuthenticateByName.
  3. POST /Items/<movie-id>/PlaybackInfo with direct play and direct stream turned off and an HLS transcoding profile.
  4. Look up the new row in jellycompat_playback_sessions. expires_at - created_at is 05:59:59.999861.
  5. Request the returned TranscodingUrl with every credential stripped, leaving only PlaySessionId and MediaSourceId. It returns 200.
  6. To simulate 6 h 1 m passing, shift the row's created_at and expires_at, and the CreatedAt, UpdatedAt, and ExpiresAt fields in its JSON, back by 6 h 1 m. Restart the server so the session is reloaded from Postgres.
  7. Request the same URL again. It returns 401 {"Error":"Unauthorized","Message":"Missing authentication token"}.

Expected behavior

A compat play session lasts as long as the router intends, 24 hours, matching the absolute stream-token lifetime (playback.MaxTokenTTL). Step 7 should return 200. An administrator who chose their own jellyfin_compat.playback_session_ttl should keep it.

Silo version / commit

main at d00462089; no build number on the dev build. Latest applied migration: 20261019222507.

Deployment

Local dev build

Area

Jellyfin-compatible clients

Clients affected

Jellyfin-compat client (Infuse, Findroid, ...)

Client app and device

curl against the Jellyfin API. Any Jellyfin client whose HLS follow-up requests carry only PlaySessionId is affected.

Relevant logs

The same master playlist URL, fresh and then after the simulated 6 h 1 m (item and source IDs and client address redacted):

time=2026-10-22T12:49:15.835Z level=INFO msg="jellycompat request" component=jellycompat request_id=94b2157d4dd9/HEdIBGX0bI-000004 method=GET path=/Videos/<item-id>/audio-v2/master.m3u8 original_path=/Videos/<item-id>/audio-v2/master.m3u8 query="MediaSourceId=<source-id>&PlaySessionId=fbd4d85e-3da1-5bd6-88f2-8860c757b58b" route=/Videos/{id}/audio-v2/master.m3u8 status=200 duration_ms=181 remote_addr=<redacted> user_agent=curl/8.5.0 content_length=0 auth_kind=none
time=2026-10-22T12:49:30.652Z level=INFO msg="jellycompat request" component=jellycompat request_id=94b2157d4dd9/6RQS5UcHBD-000001 method=GET path=/Videos/<item-id>/audio-v2/master.m3u8 original_path=/Videos/<item-id>/audio-v2/master.m3u8 query="MediaSourceId=<source-id>&PlaySessionId=fbd4d85e-3da1-5bd6-88f2-8860c757b58b" route=/Videos/{id}/audio-v2/master.m3u8 status=401 duration_ms=0 remote_addr=<redacted> user_agent=curl/8.5.0 content_length=0 auth_kind=none

Technical notes

The 6 h value lives in five places, and the router's 24 h default only wins when the setting is not positive:

  • migrations/sql/001_schema.sql seeds ('jellyfin_compat.playback_session_ttl', '6h').
  • internal/config/config.go (setDefaults), internal/config/db_loader.go (durationOr fallback), and internal/config/admin_settings.go (adminSettingDefaults) all default to 6h.
  • NewDurableCompatPlaybackStore falls back to 6 h, while NewPlaybackSessionStore falls back to playback.MaxTokenTTL.

A fix needs a migration that moves stored 6h values to 24h, because existing databases carry the seed. Silo can't tell a seeded 6h from one an administrator typed, so the migration should only touch rows that still equal the seed.

AI harness

Claude Code (via T3 Code)

AI tool(s)

Claude Code, GitHub CLI

AI model(s)

claude-opus-5-5

AI involvement

AI-assisted

Independent or adversarial review

n/a

Confirmations

  • I searched open and recently closed issues and pull requests, and this is not already reported
  • I reproduced this myself on a real deployment
  • Any logs provided are raw apart from marked redactions and are not AI-summarized; if none were available, I said so above

Source: internal code audit of main

Activity

  1. added
    bug
    on Oct 22, 2026
  2. self-assigned this
    on Oct 22, 2026
  3. Quick104 commented on Oct 22, 2026

    @Quick104
    ContributorAuthor

    🤖 AI agent claim. Claude Code (claude-opus-5-5) is working on a fix for this issue on behalf of @Quick104, who is assigned.

    A pull request will link here when the fix is ready. If the work stops without a fix, the assignment and this comment are removed.

    Planning to work on this, or have context to add? Reply here and mention @Quick104.

  4. added a commit that references this issue on Oct 22, 2026
    4042544
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions