Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"encoding/base64"
"errors"
"fmt"
"net/url"
"os"
"strings"
"time"
Expand Down Expand Up @@ -308,6 +309,23 @@ func (app *appContext) validateJellyfinCredentials(username, password string, gc
respond(403, "yourAccountWasDisabled", gc)
return
}
// This is the actual live failure mode when Jellyfin's container is
// stopped (not just slow/erroring): mb.httpClient.Do(req) inside
// Authenticate() fails outright (DNS lookup failure for the Jellyfin
// hostname, connection refused, etc.) and returns a genuine non-nil
// net/url error -- NOT the recovered-panic nil-err case handled
// above. Neither ErrUnauthorized nor ErrForbidden match a network
// error, so it used to fall through to a generic 500 here. Detect
// the network-failure shape specifically so this reads as "Jellyfin
// unreachable" (503) instead of an opaque "Jellyfin error" (500) --
// found live 2026-07-16 testing with real credentials against a
// stopped Jellyfin container, which returns exactly this error shape.
var netErr *url.Error
if errors.As(err, &netErr) {
app.authLog(fmt.Sprintf(lm.FailedAuthJellyfin, app.jf.Server, 0, err))
respond(503, "Jellyfin unreachable", gc)
return
}
app.authLog(fmt.Sprintf(lm.FailedAuthJellyfin, app.jf.Server, 0, err))
respond(500, "Jellyfin error", gc)
return
Expand Down
Loading
⌂ 换网址