UnraidUnraid
Unraid OS Bug Reports

Docker update checker fails for lscr.io images due to cross-domain redirect stripping Bearer authentication

B
basketballguy59011inUnraid OS Bug Reports
about 23 hours ago

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

  1. Install a Docker container using an lscr.io/linuxserver repository, such as lscr.io/linuxserver/sonarr:latest.

  2. Navigate to the Docker tab in the Unraid WebUI.

  3. Click "Check for Updates."

  4. 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:

  1. Unraid successfully obtains a Bearer token from https://ghcr.io/token.

  2. Unraid sends an authenticated HEAD request to the lscr.io manifest endpoint.

  3. The endpoint returns an HTTP 302 redirect to ghcr.io.

  4. cURL strips the Authorization header during the cross-domain redirect as part of its default security behavior.

  5. GitHub returns HTTP 401 Unauthorized.

  6. 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"

NULL

Additionally, 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.

Closed
Loading content, please wait...
Loading content, please wait...
Loading content, please wait...
Loading content, please wait...
Loading content, please wait...
Loading content, please wait...
Loading content, please wait...
Loading content, please wait...
Loading content, please wait...
Loading content, please wait...
Loading content, please wait...
Loading content, please wait...