You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Plex history import fails from Profile Settings but works from Admin Settings #407
every time tried to import plex watch history, failed tho successful authentication
Reply digest
Plex watch-history import fails (despite successful authentication) when started from Profile Settings, but works from Admin Settings. The two are separate flows: the profile OAuth path POSTs a browser-discovered plex.direct/LAN base URL that the backend (in Docker) frequently can't reach, so FetchLibrarySections errors and the whole run fails; the admin path uses an operator-vetted saved base URL + stored token. Confirmed by the reporter (drahmed86).
Code references
Verified OPEN as of 2026-07-14 against origin/main; #388 (open) adds admin OAuth but does not fix the profile path. Route profile imports through a reachable base URL (remote<->local fallback) or surface the fetch error instead of failing the run.
web/src/pages/settings/HistoryImportSettings.tsx:259-266 — profile OAuth start POSTs a client-discovered plex_base_url (remoteURL||localURL from plex.tv in the browser) + per-server token to /history-imports/runs.
internal/historyimport/service.go:373-381 — resolvePlexAuth trusts input.PlexBaseURL verbatim; plex_provider.go:28-31 FetchLibrarySections(baseURL, token) then service.go:462-466 failRun fails the whole run on any error.
internal/api/router.go:2657 (admin path) — POST /admin/history-imports/sources/{id}/bulk-run -> BulkCreateAdminRuns runs against an operator-vetted saved source base_url + stored token, which is why admin works.
Activity
fix(historyimport): retry Plex advertised connections