Docker update checker fails for lscr.io images due to cross-domain redirect stripping Bearer authentication
Expected Behavior
Docker containers using lscr.io/linuxserver repositories should correctly report their update availability when checking for updates through the Unraid Docker WebUI.
Actual Behavior
All containers using lscr.io/linuxserver repositories report "not available" when checking for updates. Containers using other registries correctly report their update status.
Affected containers in my environment:
Sonarr
Radarr
Prowlarr
qBittorrent
Tvheadend
All affected containers continue to operate normally. Docker itself can successfully retrieve remote manifests from these repositories.
Steps to Reproduce
Install a Docker container using an
lscr.io/linuxserverrepository, such aslscr.io/linuxserver/sonarr:latest.Navigate to the Docker tab in the Unraid WebUI.
Click "Check for Updates."
Observe that the container's update status reports "not available."
The issue can also be reproduced directly from the terminal using Unraid's update-check function:
php -r '
require_once "/usr/local/emhttp/plugins/dynamix.docker.manager/include/DockerClient.php";
$client = new DockerUpdate();
var_dump($client->getRemoteVersionV2("lscr.io/linuxserver/sonarr:latest"));
'Result: NULL
Additional Context
I performed extensive troubleshooting and isolated the issue to the DockerUpdate::getRemoteVersionV2() function located in:
/usr/local/emhttp/plugins/dynamix.docker.manager/include/DockerClient.php
DNS resolution, network connectivity, TLS certificate validation, registry authentication, and manual Docker manifest retrieval were all verified to be working correctly.
Using an instrumented temporary copy of DockerClient.php, I identified the following sequence:
Unraid successfully obtains a Bearer token from
https://ghcr.io/token.Unraid sends an authenticated HEAD request to the
lscr.iomanifest endpoint.The endpoint returns an HTTP 302 redirect to
ghcr.io.cURL strips the Authorization header during the cross-domain redirect as part of its default security behavior.
GitHub returns HTTP 401 Unauthorized.
Unraid receives no Docker-Content-Digest header and returns NULL.
The instrumented function returned the following:
HTTP STATUS: 401
CURL ERROR:
RAW RESPONSE:
HTTP/2 302
location: https://ghcr.io/v2/linuxserver/sonarr/manifests/latest
HTTP/2 401
content-type: application/json
www-authenticate: Bearer realm="https://ghcr.io/token",service="ghcr.io",scope="repository:linuxserver/sonarr:pull"
NULLAdditionally, I noticed a separate apparent coding error in the final cURL error-handling section:
$reply = curl_exec($digest_ch);
if (curl_errno($ch) !== 0) {The error check references $ch instead of $digest_ch, potentially masking errors during the final manifest request.
Workarounds
I successfully resolved the issue by adding the following line immediately after the $manifestURL = sprintf(...) statement in getRemoteVersionV2():
$manifestURL = preg_replace("@^https://lscr\\.io/@", "https://ghcr.io/", $manifestURL);This bypasses the cross-domain redirect by directly targeting the GitHub Container Registry for lscr.io images while preserving cURL's default credential-forwarding security protections.
After applying this change, the same PHP reproduction command successfully returned:
string(71) "sha256:c7d1df25e428da6c9ace05daea0d34e59522978a3843ea1944812f855af4086c"I subsequently applied the workaround to the live DockerClient.php file, verified its PHP syntax, and checked for updates through the WebUI.
All five affected containers now correctly report their update status.
No container configuration changes, container restarts, or Docker service restarts were required.
This workaround is temporary and will not normally persist across an Unraid reboot.
Screenshots / Videos / Diagnostics
The original screenshot demonstrates the affected LinuxServer containers reporting "not available" while other containers report their update status correctly.
Relevant diagnostic HTTP responses and PHP function output are included above.