SVG thumbnails not generating on clean install (all troubleshooting steps failed)

Support intro

Sorry to hear you’re facing problems. :slightly_frowning_face:

The community help forum (help.nextcloud.com) is for home and non-enterprise users. Support is provided by other community members on a best effort / “as available” basis. All of those responding are volunteering their time to help you.

If you’re using Nextcloud in a business/critical setting, paid and SLA-based support services can be accessed via portal.nextcloud.com where Nextcloud engineers can help ensure your business keeps running smoothly.

Getting help

In order to help you as efficiently (and quickly!) as possible, please fill in as much of the below requested information as you can.

Before clicking submit: Please check if your query is already addressed via the following resources:

(Utilizing these existing resources is typically faster. It also helps reduce the load on our generous volunteers while elevating the signal to noise ratio of the forums otherwise arising from the same queries being posted repeatedly).

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can. :heart:

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • replace me
  • Operating system and version (e.g., Ubuntu 24.04):
    • replace me
  • Web server and version (e.g, Apache 2.4.25):
    • replace me
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • replace me
  • PHP version (e.g, 8.3):
    • replace me
  • Is this the first time you’ve seen this error? (Yes / No):
    • replace me
  • When did this problem seem to first start?
    • replace me
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • replace me
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • replace me

Summary of the issue you are facing:

[…]

Steps to replicate it (hint: details matter!):

Log entries

Nextcloud

Please provide the log entries from your Nextcloud log that are generated during the time of problem (via the Copy raw option from Administration settings->Logging screen or from your nextcloud.log located in your data directory). Feel free to use a pastebin/gist service if necessary.

PASTE HERE

Web Browser

If the problem is related to the Web interface, open your browser inspector Console and Network tabs while refreshing (reloading) and reproducing the problem. Provide any relevant output/errors here that appear.

PASTE

Web server / Reverse Proxy

The output of your Apache/nginx/system log in /var/log/____:

PASTE HERE

Configuration

Nextcloud

The output of occ config:list system or similar is best, but, if not possible, the contents of your config.php file from /path/to/nextcloud is fine (make sure to remove any identifiable information!):

<?php
$CONFIG = array (
  
  'instanceid' => 'oc_',
  'passwordsalt' => '********************************',
  'secret' => '************************************************',
  'datadirectory' => '/var/www/html/data',
  'dbtype' => 'pgsql',
  'version' => '32.0.0.13', 
  'dbname' => 'nextcloud',
  'dbhost' => 'db',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'nextcloud_user',
  'dbpassword' => '********************',
  'installed' => true,

  'trusted_domains' =>
  array (
    0 => 'localhost',
    1 => '192.168.1.67:8090',
    2 => 'xxx.xxxx.freeddns.org',
  ),
  'overwrite.cli.url' => 'https://xxx.xxxx.freeddns.org',
  'overwritehost' => 'xxx.xxxx.freeddns.org',
  'overwriteprotocol' => 'https',
  'trusted_proxies'   => ['172.17.0.1'],

  'enable_previews' => true,
  'enabled_preview_providers' =>
  array (
    0 => 'OC\\Preview\\PNG',
    1 => 'OC\\Preview\\JPEG',
    2 => 'OC\\Preview\\GIF',
    3 => 'OC\\Preview\\HEIC',
    4 => 'OC\\Preview\\BMP',
    5 => 'OC\\Preview\\XBitmap',
    6 => 'OC\\Preview\\Movie',
    7 => 'OC\\Preview\\PDF',
    8 => 'OC\\Preview\\MP3',
    9 => 'OC\\Preview\\TXT',
    10 => 'OC\\Preview\\MarkDown',
    11 => 'OC\\Preview\\SVG',
  ),
  // Mówimy Nextcloudowi, żeby zignorował Imagicka
  'disabled_preview_providers' => ['OC\\Preview\\Imagick'],

);

Hello everyone,

I am new here but very surprised that i didn’t dive into nextcloud sooner! I am creating small 3 persons setup to fast interchange svg projects for laser cutting and more.

But I’m struggling with a persistent issue on a fresh Nextcloud installation and I’ve run out of ideas after two days of troubleshooting.

My setup:
Raspberry Pi 4, Docker & Portainer, Nextcloud Image: nextcloud:apache
Database: postgres:15-alpine
All data is on the host filesystem at /home/user/nextcloud via volumes.

My problem
Previews for standard images like PNG and JPG generate perfectly and instantly.
Thumbnails for SVG files are never created. I only see the default mime-type icon in the web browser.
Here is a summary of everything I have tried so far, without success:

Configuring config.php:

I have added OC\Preview\SVG to the enabled_preview_providers array.

I have verified with php occ config:system:get enabled_preview_providers` that the server sees this configuration correctly.
I have entered the container (as root) and successfully installed librsvg2-bin and imagemagick.
I have confirmed they are installed using which rsvg-convert. The tools are present.

I can manually generate a perfect preview when I am inside the container as the www-data user. The command rsvg-convert -h 256 /path/to/my/file.svg works generating without any errors. I installed the preview generator app to get access to its commands.

When I run php occ preview:generate-all -vvv, the command runs very quickly. The output shows it processes JPG/PNG files but completely skips all SVG files without printing any error. It doesn’t even try to process them. The standard php occ files:scan --all also does not trigger SVG preview generation. I confirmed that the imagick PHP module is active.
I checked the /etc/ImageMagick-7/policy.xml file, and there is no policy blocking SVG.
As a test, I added ‘disabled_preview_providers’ => [‘OC\Preview\Imagick’] to config.php to force the system to use rsvg-convert. This did not change the behavior.
As another test, I added preview_mimetypes_blacklist => to `config.php. This also did not change the behavior.

As a final test, I even tried to force the mapping with ‘preview_provider_mimetypes’ => [‘OC\Preview\SVG’ => ‘image/svg+xml’]. This also did not help.

I thought that my browser is blocking them but i have downloaded all previews zipped and checked them for any svg thumbnails - NONE :frowning:

At this point, it feels like I’ve exhausted every possible configuration issue.

Is this a known bug in the latest nextcloud apache image or this version of Nextcloud? Is there any deeper level of debugging I can enable to see why the decision to skip SVG files is being made?

Thank you for any help you can provide.

I did attempt to install the AIO version, but it conflicts with my existing setup on this Raspberry Pi. I reached a point in the AIO setup instructions where it became clear that it would not work well with my existing Nginx Proxy Manager setup. This became a major roadblock and a source of frustration, so I decided to return to the standard Docker setup that I want to have full control over.

@fishaa welcome to the Nextcloud community :waving_hand:

see the docs here Previews configuration — Nextcloud latest Administration Manual latest documentation

short answer (warning):

Nextcloud can also generate previews of other file types (such as PDF, SVG, various Office document formats, and various video formats). Due to security and performance concerns those providers are disabled by default. While those providers are still available, we discourage enabling them and they are considered unsupported. The full list of the preview providers that are enabled by default (as well as those disabled by default) can be found under the enabledPreviewProviders configuration parameter.

if that warning is scary… which it should be! then consider hosting a local imaginary service with docker How to generate image previews in Nextcloud with Imaginary with Docker

Thanks! I saw this post and thought that provide option enable in config.php could enable this? on my mobile app ios and android it is generated after opening file and it is super useful to scroll those projects fast…

I’ve just spotted that when i am doing drag and drop from pc to overwrite same file the dialogs pops out WITH THUMBNAIL of dragged file without thumbnail of old file…pretty strange

Edit: i got home added imaginary and it is working LIKE A CHARM!!! thank YOU!

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.