NC 20.0.4 issues with move files (having spaces in the names)

Support intro

Nextcloud version (eg, 18.0.2): 20.0.4
Operating system and version (eg, Ubuntu 20.04): CentOS 8
Apache or nginx version (eg, Apache 2.4.25): httpd-2.4.37-30.module_el8.3.0+561+97fdbbcc.x86_64
PHP version (eg, 7.1): php-7.4.13-1.el8.remi.x86_64

The issue you are facing:
I have uploaded some files in bulk, then I have changed ownership to ‘apache:apache’ and verified the ownership and mode.
It seems that if I open a mp4 file from the web browser (google chrome) and close it (using the “X” in the upper right corner), I cannot move the file to another directory.
Most probably it is a locking issue,as after waiting some time (for example - 30s) moving of the file is possible.

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

Steps to replicate it:

  1. Copy via scp a large ammount of files (50-60 files 10-120 MB each)
  2. Chown to ‘apache:apache’
  3. use ‘restorecon -RFvv /var/www/html/nextcloud/data’ to restore SELINUX ownership
  4. use ‘sudo -u apache php /var/www/html/nextcloud/occ files:scan --all’ to notify Nextcloud for the new files
  5. Open an mp4 file in the web browser
  6. Select the file and try to move it to another directory
  7. Wait 30s and try again

The output of your Nextcloud log in Admin > Logging:

Error	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 10240000 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 2097152 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.
Error	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 10240000 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 2998272 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.

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

<?php
$CONFIG = array (
  'instanceid' => 'ocq5fxs7yuzz',
  'passwordsalt' => '<REPLACED>',
  'secret' => '<REPLACED>',
  'trusted_domains' => 
  array (
    0 => 'nextcloud.localdomain',
    1 => '<REPLACED>',
  ),
  'datadirectory' => '/var/www/html/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '20.0.4.0',
  'overwrite.cli.url' => 'http://nextcloud.localdomain',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost:/var/lib/mysql/mysql.sock',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => '<REPLACED>',
  'dbpassword' => '<REPLACED>',
  'installed' => true,
  'filelocking.enabled' => true,
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'redis' => 
  array (
    'host' => 'localhost',
    'port' => 6379,
    'timeout' => 1.5,
  ),
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'tls',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => '<REPLACED>',
  'mail_domain' => '<REPLACED>',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtphost' => '<REPLACED>',
  'mail_smtpport' => '587',
  'mail_smtpname' => '<REPLACED>',
  'mail_smtppassword' => '<REPLACED>',
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 2,
);

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

/var/log/httpd/error_log:

[Sat Jan 02 23:23:11.870676 2021] [mpm_event:notice] [pid 11360:tid 139853524326720] AH00492: caught SIGWINCH, shutting down gracefully
[Sat Jan 02 23:23:12.936918 2021] [core:notice] [pid 11748:tid 140460603513152] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
[Sat Jan 02 23:23:12.938002 2021] [suexec:notice] [pid 11748:tid 140460603513152] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Sat Jan 02 23:23:12.958121 2021] [lbmethod_heartbeat:notice] [pid 11748:tid 140460603513152] AH02282: No slotmem from mod_heartmonitor
[Sat Jan 02 23:23:12.962204 2021] [mpm_event:notice] [pid 11748:tid 140460603513152] AH00489: Apache/2.4.37 (centos) OpenSSL/1.1.1g configured -- resuming normal operations
[Sat Jan 02 23:23:12.962244 2021] [core:notice] [pid 11748:tid 140460603513152] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'

Strangely it doesn’t happen for all files.

I’m not sure if the following is related to the problem…
I tried to copy the directory contents to another location and it failed after some time.
Then I noticed that deletion of some files inside the dir is not possible (150-450MB).

Maybe I got an answer. I have killed the desktop sync application and then deletion on some files/dirs was successfull.
I will try to copy and see if it will succeed.

I have found out that the files and dirs got spaces . Once replaced with “_”, the copy finished (despite an error that it failed) and later deletion was successful.