Nextcloud Apps page: no screenshots (403 from usercontent.apps.nextcloud.com)

I have searched the forum for similar issues

on

This category is for issues regarding specific apps, NOT general issues with YunoHost.

on

This form is written in English but feel free to write in French if you’re more comfortable!

on

What app is this about, and its version

Nextcloud 33.0.4~ynh1, now upgraded to 35.0.1~ynh1

What YunoHost version are you running

12.1.41.2 (Debian 12 bookworm)

What type of hardware are you using

Old laptop or computer

Describe your issue

After restoring a full backup on the new machine, the Apps page in Nextcloud shows no screenshots. Most apps show a gear icon, and a few show a black “Preview not available / Image not recognized” box. App names, descriptions and the Download and enable buttons all work.

image

Does anyone know what could be wrong/what the solution is?

Share relevant logs or error messages

I asked Claude for help diagnosing the issue and this is a summary of that after reading through logs:

  • In browser dev tools, the failing image requests go to usercontent.apps.nextcloud.com and return 403 Forbidden. This happens in every browser, including private windows. Nothing reaches my nginx access log.
  • The long path in the request decodes (base64) to another usercontent.apps.nextcloud.com/<base64> address, and only inside that is the real GitHub raw image. So the screenshot address is wrapped by the proxy twice.
  • The app store’s own JSON already contains addresses of the form usercontent.apps.nextcloud.com/<base64>. Counting the first 16 characters after the slash: aHR0cHM6Ly9yYXcu (a single-wrapped https://raw) appears about 1000 times, both in the cached apps.json and in a fresh download from apps.nextcloud.com/api/v1/platform/33.0.4/apps.json. The double-wrapped form (aHR0cHM6Ly91c2Vy) appears in neither.
  • In Nextcloud 33.0.4, apps/settings/lib/Controller/AppSettingsController.php builds the address like this, with no check for whether it is already proxied: 534: 'screenshot' => isset($app['screenshots'][0]['url']) ? 'https://usercontent.apps.nextcloud.com/' . base64_encode($app['screenshots'][0]['url']) : '',
    Network is fine. From the server, curl -I to raw.githubusercontent.com and apps.nextcloud.com both return HTTP/2 200, and PHP as the app user can download from GitHub. Nextcloud’s config has no has_internet_connection, appstoreurl or proxy overrides.
  • occ status is healthy and nextcloud.log shows no errors about images or the app store.

Please let me know if I need to upload any specific logs.

I didn’t find it before I made my post, but there is a bug report about this here - [Bug]: App Store does not show preview screenshots · Issue #65055 · nextcloud/server · GitHub

The solution in this issue worked for me to get images working again.

What I did:

In apps/appstore/lib/Controller/ApiController.php replaced line 309 with return $this->proxify($url); and line 481 with 'screenshot' => isset($app['screenshots'][0]['url']) ? $this->proxify($app['screenshots'][0]['url']) : '', then added before the very last closing bracket in this file:

private function proxify(string $url): string {
    $prefix = 'https://usercontent.apps.nextcloud.com/';
    return str_starts_with($url, $prefix) ? $url : $prefix . base64_encode($url);
}

Verified syntax was ok with php -l apps/appstore/lib/Controller/ApiController.php

Then I reloaded php with sudo systemctl reload php8.4-fpm php8.5-fpm and the images on the app page are working again.