Some files unreadable (for viewing or download)

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

The issue you are facing:
Some files are unreadable and cannot be downloaded.
With some PDF I have the error message:
"PDF.js v2.13.216 (identifiant de compilation : 399a0ec60)
Message : Unexpected server response (500) while retrieving PDF "https://cloud.xx/remote.php/dav/files/Antonio/Administratif/Documents%20identité/Actes%20de%20naissance/Acte%20de%20naissance%20tatoune.pdf"."
and with jpg: “Error loading file”
It seems to me that the files with errors are files that I moved from a synced folder to another folder on my computer, but can’t be sure.
Help much appreciated!

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

Steps to replicate it:

  1. Go to files
  2. Choose one folder that shows the error
  3. click on the file to view it

The output of your Nextcloud log in Admin > Logging:

[no app in context] Error: Cannot decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you.

GET /index.php/core/preview?fileId=28508&x=1920&y=1080&a=true
from 82.65..x by Antonio at 2022-07-18T21:12:58+00:00
[no app in context] Error: Cannot decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you.

GET /index.php/core/preview?fileId=28508&x=1920&y=1080&a=true
from 82.65..x by Antonio at 2022-07-18T21:12:47+00:00
[no app in context] Error: Cannot decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you.

GET /index.php/core/preview?fileId=28508&x=1920&y=1080&a=true
from 82.65..x by Antonio at 2022-07-18T21:12:41+00:00

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

<?php
$CONFIG = array (
  'instanceid' => ,
  'passwordsalt' => ,
  'secret' => ,
  'trusted_domains' => 
  array (
    0 => '82.*'
    1 => 'cloud.xx',
    2 => 'localhost',
  ),
  'datadirectory' => '/var/www/cloud.xx/html/nextcloud-data',
  'dbtype' => 'mysql',
  'version' => '24.0.3.2',
  'overwrite.cli.url' => 'https://cloud.xx',
  'log_type' => 'file',
  'logfile' => '/var/www/cloud.xx/html/nextcloud.log',
  'loglevel' => 0,
  'logdateformat' => 'F d, Y H:i:s',
  'default_phone_region' => 'FR',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'adnext',
  'dbpassword' => 'xx',
  'installed' => true,
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'ssl',
  'mail_smtptimeout' => '30',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'xx',
  'mail_domain' => 'xx.fr',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'smtp.xx.fr',
  'mail_smtpport' => '465',
  'mail_smtpname' => 'x@x.fr',
  'mail_smtppassword' => 'x',
  'mail_smtpauthtype' => 'LOGIN',
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => 'localhost',
    'port' => 6379,
  ),
  'maintenance' => false,
  'theme' => '',
  'updater.secret' => 'xx',
);

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

Mon Jul 18 20:39:44.426296 2022] [mpm_prefork:notice] [pid 701] AH00163: Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f configured -- resuming normal operations
[Mon Jul 18 20:39:44.438138 2022] [core:notice] [pid 701] AH00094: Command line: '/usr/sbin/apache2'
[Mon Jul 18 20:52:15.589160 2022] [php7:error] [pid 734] [client 192.46.211.163:42766] script '/var/www/cloud.tellurix.eu/html/nextcloud/wp-blockup.php' not found or unable to stat
[Mon Jul 18 20:52:15.801957 2022] [php7:error] [pid 1142] [client 192.46.211.163:42438] script '/var/www/cloud.tellurix.eu/html/nextcloud/wp-beckup.php' not found or unable to stat
[Mon Jul 18 20:52:15.968698 2022] [php7:error] [pid 1111] [client 192.46.211.163:42856] script '/var/www/cloud.tellurix.eu/html/nextcloud/wp-blockdown.php' not found or unable to stat
[Mon Jul 18 20:52:16.082445 2022] [php7:error] [pid 732] [client 192.46.211.163:42896] script '/var/www/cloud.tellurix.eu/html/nextcloud/wp-blog-post.php' not found or unable to stat
[Mon Jul 18 20:52:16.087878 2022] [php7:error] [pid 735] [client 192.46.211.163:42898] script '/var/www/cloud.tellurix.eu/html/nextcloud/wp-stream.php' not found or unable to stat
[Mon Jul 18 21:12:05.351207 2022] [negotiation:error] [pid 1317] [client 91.241.19.167:44026] AH00687: Negotiation: discovered file(s) matching request: /var/www/cloud.tellurix.eu/html/nextcloud/remote (None could be negotiated).

Are you using the Snap or something else?

I’m afraid I don’t know what the snap is. It’s a regular installation of nextcloud on a Ubuntu server instance from the nextcloud tarballs.