No previews on photos > 8MB; smaller files are fine

Nextcloud version (eg, 20.0.5): 24.0.4
Operating system and version (eg, Ubuntu 20.04): Ubuntu 20.04
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.41
PHP version (eg, 7.4): 7.4

The issue you are facing:
I’ve uploaded quite a few pictures, some using the app (sync to “Instant Upload”) and some by copying them a directory and then running sudo -u www-data php --define apc.enable_cli=1 /var/www/content/nextcloud/occ files:scan . In both cases, I have previews for all images < 8mb, but nothing for those that are bigger. I cannot find any limitation related to 8mb; when I first installed nextcloud, I had post_max_size set to 8, but I’ve since raised it and restarted.

I’ve tried using the preview generator app to (re)create previews using occ preview:generate-all, as well as deleting the preview directory and wiping out all relevant entries from oc_filecache in the DB and then regenerating. It did not help. Previews for small files worked, but nothing for the larger pictures.

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. Upload large-ish image (> 8mb)
  2. Look for preview
  3. See 404 in logs, “error loading” in GUI

The output of your Nextcloud log in Admin > Logging:

nothing relevant (the Notes app is throwing a bunch of unrelated errors filling up the GUI display)

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'instanceid' => 'XXX',
  'passwordsalt' => 'XXX',
  'secret' => 'XXX',
  'trusted_domains' =>
  array (
    0 => 'XXX',
  ),
  'datadirectory' => '/mnt/big_disk/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '24.0.4.1',
  'overwrite.cli.url' => 'XXX',
  'htaccess.RewriteBase' => '/content/nextcloud',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'oc_root',
  'dbpassword' => 'XXX',
  'installed' => true,
  'mail_from_address' => 'nextcloud',
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_domain' => 'XXX',
  'mail_smtphost' => 'localhost',
  'mail_smtpport' => '25',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => '/var/run/redis/redis-server.sock',
    'port' => 0,
    'timeout' => 1.5,
  ),
  'default_phone_region' => 'IL',
  'maintenance' => false,
);

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

192.118.33.100 - - [23/Aug/2022:10:25:29 +0000] "GET /content/nextcloud/core/preview?fileId=1846&c=45752fc3755b5159c61d3e02298d93fe&x=250&y=250&forceIcon=0&a=0 HTTP/1.1" 200 25819 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.6.1 Safari/605.1.15"
192.118.33.100 - - [23/Aug/2022:10:25:29 +0000] "GET /content/nextcloud/core/preview?fileId=4168&c=462fdfdd55a16c82cff6253f417d15ab&x=250&y=250&forceIcon=0&a=0 HTTP/1.1" 200 30236 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.6.1 Safari/605.1.15"
192.118.33.100 - - [23/Aug/2022:10:25:33 +0000] "GET /content/nextcloud/core/preview?fileId=4613&c=9366d765aadb9f1751dc1095054fb250&x=250&y=250&forceIcon=0&a=0 HTTP/1.1" 404 793 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.6.1 Safari/605.1.15"
192.118.33.100 - - [23/Aug/2022:10:25:33 +0000] "GET /content/nextcloud/core/preview?fileId=962&c=7918d18252bb8af2497ed4ca16552d6e&x=250&y=250&forceIcon=0&a=0 HTTP/1.1" 404 793 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.6.1 Safari/605.1.15"
192.118.33.100 - - [23/Aug/2022:10:25:32 +0000] "GET /content/nextcloud/core/preview?fileId=3709&c=4b6901428b222feb08e86ec21248dd54&x=250&y=250&forceIcon=0&a=0 HTTP/1.1" 200 19087 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.6.1 Safari/605.1.15"
192.118.33.100 - - [23/Aug/2022:10:25:33 +0000] "GET /content/nextcloud/core/preview?fileId=4769&c=608c782b0f285b88dd66a54fd9421ea9&x=250&y=250&forceIcon=0&a=0 HTTP/1.1" 404 793 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.6.1 Safari/605.1.15"
192.118.33.100 - - [23/Aug/2022:10:25:32 +0000] "GET /content/nextcloud/core/preview?fileId=1046&c=469a08e29bbeb2258766a3ec57ddeb42&x=250&y=250&forceIcon=0&a=0 HTTP/1.1" 200 21039 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.6.1 Safari/605.1.15"
192.118.33.100 - - [23/Aug/2022:10:25:32 +0000] "GET /content/nextcloud/core/preview?fileId=972&c=055840e87bcc52643214080ac632364b&x=250&y=250&forceIcon=0&a=0 HTTP/1.1" 200 18750 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.6.1 Safari/605.1.15"

Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

none seen

Of course, once I posted here, I was able to find it :slight_smile:

The default value of ‘preview_max_memory’ is 128, which was not enough to generate previews. Once I raised this, it created previews for everything perfectly.