Occ files:scan seems to crash on files with non-standard names

Hello,

I added additional storage with sftp. I noticed that some of the directories in the sftp storage are shown as empty by nextcloud files and also e.g. the Android client. For that reason, I run an scan, but this get killed (see below). The issue is reproducible.

root@contabo:/var/www/nextcloud#  sudo -u www-data php occ files:scan rd
Starting scan for user 1 out of 1 (rd)
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
PHP Deprecated:  Function utf8_encode() is deprecated in /var/www/nextcloud/lib/private/Log/LogDetails.php on line 109
Killed
root@contabo:/var/www/nextcloud# 

When I search in nextcloud.log for the last entry with scan, I find

{"reqId":"CwILaw1uvxu988xIgHBt","level":0,"time":"2024-01-26T03:02:40+00:00","remoteAddr":"","user":"--","app":"core","method":"","url":"--","message":"Exception while scanning file \"Test/w\u00e4schetrockern200311.pdf\"","userAgent":"--","version":"28.0.1.1","exception":{"Exception":"Doctri
ne\\DBAL\\Exception\\DriverException","Message":"An exception occurred while executing a query: SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: '\\xE4schet...' for column `nextcloud`.`oc_filecache`.`name` at row 1","Code":1366,"Trace":[{"file":"/var/www/nextcloud/3rdpa
rty/doctrine/dbal/src/Connection.php","line":1938,"function":"convert","class":"Doctrine\\DBAL\\Driver\\API\\MySQL\\ExceptionConverter","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1880,"function":"handleDriverException","class":"Doctrine\\DBAL\\
Connection","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1208,"function":"convertExceptionDuringQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Connection.php","line":294,"function":"executeStat
ement","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":386,"function":"executeStatement","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php"
,"line":280,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Cache.php","line":322,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/C
ache/Wrapper/CacheWrapper.php","line":152,"function":"insert","class":"OC\\Files\\Cache\\Cache","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Scanner.php","line":300,"function":"insert","class":"OC\\Files\\Cache\\Wrapper\\CacheWrapper","type":"->"},{"file":"/var/www/nextcl
oud/lib/private/Files/Cache/Scanner.php","line":233,"function":"addToCache","class":"OC\\Files\\Cache\\Scanner","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Scanner.php","line":460,"function":"scanFile","class":"OC\\Files\\Cache\\Scanner","type":"->"},{"file":"/var/www/ne
xtcloud/lib/private/Files/Cache/Scanner.php","line":397,"function":"handleChildren","class":"OC\\Files\\Cache\\Scanner","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Scanner.php","line":400,"function":"scanChildren","class":"OC\\Files\\Cache\\Scanner","type":"->"},{"file":
"/var/www/nextcloud/lib/private/Files/Cache/Scanner.php","line":347,"function":"scanChildren","class":"OC\\Files\\Cache\\Scanner","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Utils/Scanner.php","line":273,"function":"scan","class":"OC\\Files\\Cache\\Scanner","type":"->"},{"file
":"/var/www/nextcloud/apps/files/lib/Command/Scan.php","line":180,"function":"scan","class":"OC\\Files\\Utils\\Scanner","type":"->"},{"file":"/var/www/nextcloud/apps/files/lib/Command/Scan.php","line":241,"function":"scanFiles","class":"OCA\\Files\\Command\\Scan","type":"->"},{"file":"/var/w
ww/nextcloud/3rdparty/symfony/console/Command/Command.php","line":298,"function":"execute","class":"OCA\\Files\\Command\\Scan","type":"->"},{"file":"/var/www/nextcloud/core/Command/Base.php","line":177,"function":"run","class":"Symfony\\Component\\Console\\Command\\Command","type":"->"},{"fi
le":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":1040,"function":"run","class":"OC\\Core\\Command\\Base","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":301,"function":"doRunCommand","class":"Symfony\\Component\\Console\\Appli
cation","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":171,"function":"doRun","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/lib/private/Console/Application.php","line":206,"function":"run","class":"Symfo
ny\\Component\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/console.php","line":100,"function":"run","class":"OC\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/occ","line":11,"args":["/var/www/nextcloud/console.php"],"function":"require_once"}],"File":"/var
/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php","Line":117,"Previous":{"Exception":"Doctrine\\DBAL\\Driver\\PDO\\Exception","Message":"SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: '\\xE4schet...' for column `nextcloud`.`oc_filecach
e`.`name` at row 1","Code":1366,"Trace":[{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","line":132,"function":"new","class":"Doctrine\\DBAL\\Driver\\PDO\\Exception","type":"::"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":12
02,"function":"execute","class":"Doctrine\\DBAL\\Driver\\PDO\\Statement","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Connection.php","line":294,"function":"executeStatement","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Q
uery/QueryBuilder.php","line":386,"function":"executeStatement","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":280,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/var/www/nex
tcloud/lib/private/Files/Cache/Cache.php","line":322,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Wrapper/CacheWrapper.php","line":152,"function":"insert","class":"OC\\Files\\Cache\\Cache","type":"->"},{"fi
le":"/var/www/nextcloud/lib/private/Files/Cache/Scanner.php","line":300,"function":"insert","class":"OC\\Files\\Cache\\Wrapper\\CacheWrapper","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Scanner.php","line":233,"function":"addToCache","class":"OC\\Files\\Cache\\Scanner","
type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Scanner.php","line":460,"function":"scanFile","class":"OC\\Files\\Cache\\Scanner","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Scanner.php","line":397,"function":"handleChildren","class":"OC\\Files\\Cache\\Sc
anner","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Scanner.php","line":400,"function":"scanChildren","class":"OC\\Files\\Cache\\Scanner","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Scanner.php","line":347,"function":"scanChildren","class":"OC\\Files\
\Cache\\Scanner","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Utils/Scanner.php","line":273,"function":"scan","class":"OC\\Files\\Cache\\Scanner","type":"->"},{"file":"/var/www/nextcloud/apps/files/lib/Command/Scan.php","line":180,"function":"scan","class":"OC\\Files\\Utils\\Sc
anner","type":"->"},{"file":"/var/www/nextcloud/apps/files/lib/Command/Scan.php","line":241,"function":"scanFiles","class":"OCA\\Files\\Command\\Scan","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Command/Command.php","line":298,"function":"execute","class":"OCA\\Files\\C
ommand\\Scan","type":"->"},{"file":"/var/www/nextcloud/core/Command/Base.php","line":177,"function":"run","class":"Symfony\\Component\\Console\\Command\\Command","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":1040,"function":"run","class":"OC\\Core\
\Command\\Base","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":301,"function":"doRunCommand","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":171,"function":
"doRun","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/lib/private/Console/Application.php","line":206,"function":"run","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/console.php","line":100,"function":
"run","class":"OC\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/occ","line":11,"args":["/var/www/nextcloud/console.php"],"function":"require_once"}],"File":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Exception.php","Line":28,"Previous":{"Exception":"PDOExcepti
on","Message":"SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: '\\xE4schet...' for column `nextcloud`.`oc_filecache`.`name` at row 1","Code":"22007","Trace":[{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","line":130,"function":"execute
","class":"PDOStatement","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1202,"function":"execute","class":"Doctrine\\DBAL\\Driver\\PDO\\Statement","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Connection.php","line":294,"function":"execut
eStatement","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":386,"function":"executeStatement","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder
.php","line":280,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Cache.php","line":322,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/lib/private/Fi
les/Cache/Wrapper/CacheWrapper.php","line":152,"function":"insert","class":"OC\\Files\\Cache\\Cache","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Scanner.php","line":300,"function":"insert","class":"OC\\Files\\Cache\\Wrapper\\CacheWrapper","type":"->"},{"file":"/var/www/n
extcloud/lib/private/Files/Cache/Scanner.php","line":233,"function":"addToCache","class":"OC\\Files\\Cache\\Scanner","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Scanner.php","line":460,"function":"scanFile","class":"OC\\Files\\Cache\\Scanner","type":"->"},{"file":"/var/w
ww/nextcloud/lib/private/Files/Cache/Scanner.php","line":397,"function":"handleChildren","class":"OC\\Files\\Cache\\Scanner","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Scanner.php","line":400,"function":"scanChildren","class":"OC\\Files\\Cache\\Scanner","type":"->"},{"f
ile":"/var/www/nextcloud/lib/private/Files/Cache/Scanner.php","line":347,"function":"scanChildren","class":"OC\\Files\\Cache\\Scanner","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Utils/Scanner.php","line":273,"function":"scan","class":"OC\\Files\\Cache\\Scanner","type":"->"},{
"file":"/var/www/nextcloud/apps/files/lib/Command/Scan.php","line":180,"function":"scan","class":"OC\\Files\\Utils\\Scanner","type":"->"},{"file":"/var/www/nextcloud/apps/files/lib/Command/Scan.php","line":241,"function":"scanFiles","class":"OCA\\Files\\Command\\Scan","type":"->"},{"file":"/
var/www/nextcloud/3rdparty/symfony/console/Command/Command.php","line":298,"function":"execute","class":"OCA\\Files\\Command\\Scan","type":"->"},{"file":"/var/www/nextcloud/core/Command/Base.php","line":177,"function":"run","class":"Symfony\\Component\\Console\\Command\\Command","type":"->"}
,{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":1040,"function":"run","class":"OC\\Core\\Command\\Base","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":301,"function":"doRunCommand","class":"Symfony\\Component\\Console\\
Application","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":171,"function":"doRun","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/lib/private/Console/Application.php","line":206,"function":"run","class":"
Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/console.php","line":100,"function":"run","class":"OC\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/occ","line":11,"args":["/var/www/nextcloud/console.php"],"function":"require_once"}],"File":
"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","Line":130}},"message":null,"exception":{},"CustomMessage":null}}

Listing the directory with relevant file on the remote machine directly, I get

rd@h370:~/Ablage/Test$ ls
 201004-risikolebensversicherung-warentest.pdf   batterien.pdf                               dampfgarer_200701062.pdf        elektrischeZahnbuersten.pdf   indexFonds.pdf                                rieserrente_finanztest_f201010028.pdf   uran-mineralwasser-oekotest.pdf
 2013-01-Fahrrad_Winterschuhe.pdf               'BU - 111 Tarife - Finanztest 2000-10.pdf'   DigiCamTest.200302.pdf          esspressomaschine200212.pdf   MultifunktionsGeraete-warentest-08-2004.pdf   Staubsauger200504.pdf                  'w'$'\344''schetrockern200311.pdf'
 akkuLadegeraete.pdf                             Bu-200507.pdf                               Drucker-warentest-07-2004.pdf   fahrradanhänger.pdf           oekotest-matratzenbezuege-20041443.pdf        StaubsaugerElektrobuerste200404.pdf
rd@h370:~/Ablage/Test$ 

The failing file is

‘w’$‘\344’‘schetrockern200311.pdf’

I assume there is a quoting issue in the files::scan implementation of occ.

I renamed it and started a rescan.

Nextcloud version (eg, 20.0.5): 28.0.1.1
Operating system and version (eg, Ubuntu 20.04): Debian 12
Apache or nginx version (eg, Apache 2.4.25): 2.4.57
PHP version (eg, 7.4): 8.2

The issue you are facing: occ files::scan aborts (probably due to a non-standard name of a scaned file

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

Steps to replicate it:
see above

The output of your Nextcloud log in Admin > Logging:
see above

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

root@contabo:/var/www/nextcloud/config# cat config.php
<?php
$CONFIG = array (
  'instanceid' => 'oc9173i54zmk',
  'passwordsalt' => '****',
  'secret' => '****',
  'trusted_domains' => 
  array (
    0 => 'localhost',
    1 => '****',
  ),
  'datadirectory' => '/var/www/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '28.0.1.1',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'ncuser',
  'dbpassword' => '****,
  'default_phone_region' => 'DE',
  'installed' => true,
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 0,
  'updater.release.channel' => 'stable',
  'mail_smtpmode' => 'sendmail',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_from_address' => 'nextcloud',
  'mail_domain' => '****',
  'has_rebuilt_cache' => true,
  'app_install_overwrite' => 
  array (
    0 => 'gluusso',
    1 => 'timetracker',
  ),
  'overwrite.cli.url' => '****',
  'opcache.interned_strings_buffer' => '32',
  'htaccess.RewriteBase' => '/',
  'mysql.utf8mb4' => true,
  'filelocking.enabled' => true,
  'memcache.locking' => '\\OC\\Memcache\\Redis',
);
root@contabo:/var/www/nextcloud/config#

The output of your Apache/nginx/system log in /var/log/____:
I don’t see any related entry around the time the error occured.

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.

see above

"Message":"An exception occurred while executing a query: SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: '\\xE4schet...' for column nextcloud.oc_filecache.name at row 1","Code":1366,
[…]
'w'$'\344''schetrockern200311.pdf'

Are there any other log entries just before/after this one? Maybe one like normalizing failed for [...] or something?

Might be interesting to turn on the sql query log to see exactly what is being sent[1], but I suspect the issue is around here[2].

Do you have the recommended PHP module intl installed?[3]

[1] Configuration Parameters — Nextcloud latest Administration Manual latest documentation

[2] server/lib/private/legacy/OC_Util.php at 65b8c8f9dd2285e373ce61a8b549cdbacf7da2ca · nextcloud/server · GitHub

[3] PHP Modules & Configuration — Nextcloud latest Administration Manual latest documentation

P.S. Any particular reason you have Memory caching disabled for anything other than locking?

Thanks for the quick reply.

Is this the entry you are looking for ?

{"reqId":"CwILaw1uvxu988xIgHBt","level":2,"time":"2024-01-26T03:02:40+00:00","remoteAddr":"","user":"--","app":"core","method":"","url":"--","message":"normalizing failed for \"w\u00e4schetrockern200311.pdf\"","userAgent":"--","version":"28.0.1.1","data":{"app":"core"}}
{"reqId":"CwILaw1uvxu988xIgHBt","level":2,"time":"2024-01-26T03:02:40+00:00","remoteAddr":"","user":"--","app":"core","method":"","url":"--","message":"normalizing failed for \"Test/w\u00e4schetrockern200311.pdf\"","userAgent":"--","version":"28.0.1.1","data":{"app":"core"}}
{"reqId":"CwILaw1uvxu988xIgHBt","level":0,"time":"2024-01-26T03:02:40+00:00","remoteAddr":"","user":"--","app":"core","method":"","url":"--","message":"Exception while scanning file \"Test/w\u00e4schetrockern200311.pdf\"","userAgent":"--","version":"28.0.1.1","exception":{"Exception":"Doctrine\\DBAL\\Exception\\DriverException","Message":"An exception occurred while executing a query: SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: '\\xE4schet...' for column `nextcloud`.`oc_filecache`.`name` at row 1","Code":1366,"Trace":[{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1938,"function":"convert","class":"Doctrine\\DBAL\\Driver\\API\\MySQL\\ExceptionConverter","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1880,"function":"handleDriverException","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1208,"function":"convertExceptionDuringQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Connection.php","line":294,"function":"executeStatement","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":386,"function":"executeStatement","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":280,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Cache.php","line":322,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Wrapper/CacheWrapper.php","line":152,"function":"insert","class":"OC\\Files\\Cache\\Cache","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Scanner.php","line":300,"function":"insert","class":"OC\\Files\\Cache\\Wrapper\\CacheWrapper","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Scanner.php","line":233,"function":"addToCache","class":"OC\\Files\\Cache\\Scanner","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Scanner.php","line":460,"function":"scanFile","class":"OC\\Files\\Cache\\Scanner","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Scanner.php","line":397,"function":"handleChildren","class":"OC\\Files\\Cache\\Scanner","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Scanner.php","line":400,"function":"scanChildren","class":"OC\\Files\\Cache\\Scanner","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Scanner.php","line":347,"function":"scanChildren","class":"OC\\Files\\Cache\\Scanner","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Utils/Scanner.php","line":273,"function":"scan","class":"OC\\Files\\Cache\\Scanner","type":"->"},{"file":"/var/www/nextcloud/apps/files/lib/Command/Scan.php","line":180,"function":"scan","class":"OC\\Files\\Utils\\Scanner","type":"->"},{"file":"/var/www/nextcloud/apps/files/lib/Command/Scan.php","line":241,"function":"scanFiles","class":"OCA\\Files\\Command\\Scan","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Command/Command.php","line":298,"function":"execute","class":"OCA\\Files\\Command\\Scan","type":"->"},{"file":"/var/www/nextcloud/core/Command/Base.php","line":177,"function":"run","class":"Symfony\\Component\\Console\\Command\\Command","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":1040,"function":"run","class":"OC\\Core\\Command\\Base","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":301,"function":"doRunCommand","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":171,"function":"doRun","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/lib/private/Console/Application.php","line":206,"function":"run","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/console.php","line":100,"function":"run","class":"OC\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/occ","line":11,"args":["/var/www/nextcloud/console.php"],"function":"require_once"}],"File":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php","Line":117,"Previous":{"Exception":"Doctrine\\DBAL\\Driver\\PDO\\Exception","Message":"SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: '\\xE4schet...' for column `nextcloud`.`oc_filecache`.`name` at row 1","Code":1366,"Trace":[{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","line":132,"function":"new","class":"Doctrine\\DBAL\\Driver\\PDO\\Exception","type":"::"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1202,"function":"execute","class":"Doctrine\\DBAL\\Driver\\PDO\\Statement","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Connection.php","line":294,"function":"executeStatement","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":386,"function":"executeStatement","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":280,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Cache.php","line":322,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Wrapper/CacheWrapper.php","line":152,"function":"insert","class":"OC\\Files\\Cache\\Cache","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Scanner.php","line":300,"function":"insert","class":"OC\\Files\\Cache\\Wrapper\\CacheWrapper","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Scanner.php","line":233,"function":"addToCache","class":"OC\\Files\\Cache\\Scanner","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Scanner.php","line":460,"function":"scanFile","class":"OC\\Files\\Cache\\Scanner","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Scanner.php","line":397,"function":"handleChildren","class":"OC\\Files\\Cache\\Scanner","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Scanner.php","line":400,"function":"scanChildren","class":"OC\\Files\\Cache\\Scanner","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Scanner.php","line":347,"function":"scanChildren","class":"OC\\Files\\Cache\\Scanner","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Utils/Scanner.php","line":273,"function":"scan","class":"OC\\Files\\Cache\\Scanner","type":"->"},{"file":"/var/www/nextcloud/apps/files/lib/Command/Scan.php","line":180,"function":"scan","class":"OC\\Files\\Utils\\Scanner","type":"->"},{"file":"/var/www/nextcloud/apps/files/lib/Command/Scan.php","line":241,"function":"scanFiles","class":"OCA\\Files\\Command\\Scan","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Command/Command.php","line":298,"function":"execute","class":"OCA\\Files\\Command\\Scan","type":"->"},{"file":"/var/www/nextcloud/core/Command/Base.php","line":177,"function":"run","class":"Symfony\\Component\\Console\\Command\\Command","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":1040,"function":"run","class":"OC\\Core\\Command\\Base","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":301,"function":"doRunCommand","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":171,"function":"doRun","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/lib/private/Console/Application.php","line":206,"function":"run","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/console.php","line":100,"function":"run","class":"OC\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/occ","line":11,"args":["/var/www/nextcloud/console.php"],"function":"require_once"}],"File":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Exception.php","Line":28,"Previous":{"Exception":"PDOException","Message":"SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: '\\xE4schet...' for column `nextcloud`.`oc_filecache`.`name` at row 1","Code":"22007","Trace":[{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","line":130,"function":"execute","class":"PDOStatement","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1202,"function":"execute","class":"Doctrine\\DBAL\\Driver\\PDO\\Statement","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Connection.php","line":294,"function":"executeStatement","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":386,"function":"executeStatement","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":280,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Cache.php","line":322,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Wrapper/CacheWrapper.php","line":152,"function":"insert","class":"OC\\Files\\Cache\\Cache","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Scanner.php","line":300,"function":"insert","class":"OC\\Files\\Cache\\Wrapper\\CacheWrapper","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Scanner.php","line":233,"function":"addToCache","class":"OC\\Files\\Cache\\Scanner","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Scanner.php","line":460,"function":"scanFile","class":"OC\\Files\\Cache\\Scanner","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Scanner.php","line":397,"function":"handleChildren","class":"OC\\Files\\Cache\\Scanner","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Scanner.php","line":400,"function":"scanChildren","class":"OC\\Files\\Cache\\Scanner","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Scanner.php","line":347,"function":"scanChildren","class":"OC\\Files\\Cache\\Scanner","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Utils/Scanner.php","line":273,"function":"scan","class":"OC\\Files\\Cache\\Scanner","type":"->"},{"file":"/var/www/nextcloud/apps/files/lib/Command/Scan.php","line":180,"function":"scan","class":"OC\\Files\\Utils\\Scanner","type":"->"},{"file":"/var/www/nextcloud/apps/files/lib/Command/Scan.php","line":241,"function":"scanFiles","class":"OCA\\Files\\Command\\Scan","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Command/Command.php","line":298,"function":"execute","class":"OCA\\Files\\Command\\Scan","type":"->"},{"file":"/var/www/nextcloud/core/Command/Base.php","line":177,"function":"run","class":"Symfony\\Component\\Console\\Command\\Command","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":1040,"function":"run","class":"OC\\Core\\Command\\Base","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":301,"function":"doRunCommand","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":171,"function":"doRun","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/lib/private/Console/Application.php","line":206,"function":"run","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/console.php","line":100,"function":"run","class":"OC\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/occ","line":11,"args":["/var/www/nextcloud/console.php"],"function":"require_once"}],"File":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","Line":130}},"message":null,"exception":{},"CustomMessage":null}}

I renamed the file already, but it could try to create a test user and create just a copy with the old name for the test user.

The PHP module intl is installed:

rd@contabo:~$ dpkg --get-selections|grep php|grep intl
php-intl                                        install
php8.2-intl                                     install
rd@contabo:~$ 

For the memory caching:
I usually run with
‘memcache.local’ => ‘\OC\Memcache\APCu’
but occ fails in these cases

root@contabo:/var/www/nextcloud#  sudo -u www-data php occ files:scan rd
An unhandled exception has been thrown:
OCP\HintException: [0]: Memcache OC\Memcache\APCu not available for local cache (Is the matching PHP module installed and enabled?)
root@contabo:/var/www/nextcloud# 

I didn’t have the time to dig into that, therefore I disable the memory cache before running updater.phar or occ commands typically after the update as workaround.