WEBDAV: Cannot modify files

Nextcloud version 24.0.6
Operating system and version: Ubuntu 22.04
Apache version: Apache 2.4.54
PHP version : 8.1.11

The issue you are facing:

I connect to my data on Nextcloud from Windows 10 using WebDAV. Creating new files, deleting, copying and pasting under a different name is no problem.
I can do everything with my files except modify an existing one.
For example, if I open an Excel file, change numbers, and then click Save, I get: The document was not saved.

The same effect is also visible via the Nextcloud client. The changed file is simply no longer synchronized.

Is this the first time you’ve seen this error? : Yes. After i Updated Nextcloud from 23 to 24

Steps to replicate it:

  1. Open WebDav under Windows
  2. Open a File and make changes
  3. Try to save the file

The output of your Nextcloud log in Admin > Logging:

[webdav] Fatal: TypeError: OCA\Files_Versions\Command\Expire::__construct(): Argument #2 ($fileName) must be of type string, null given, called in /var/www/nextcloud/apps/files_versions/lib/Storage.php on line 743 at <<closure>>

 0. /var/www/nextcloud/apps/files_versions/lib/Storage.php line 743
    OCA\Files_Versions\Command\Expire->__construct()
 1. /var/www/nextcloud/apps/files_versions/lib/Versions/LegacyVersionsBackend.php line 90
    OCA\Files_Versions\Storage::scheduleExpire()
 2. /var/www/nextcloud/apps/files_versions/lib/Versions/VersionManager.php line 92
    OCA\Files_Versions\Versions\LegacyVersionsBackend->createVersion()
 3. /var/www/nextcloud/apps/files_versions/lib/Storage.php line 230
    OCA\Files_Versions\Versions\VersionManager->createVersion()
 4. /var/www/nextcloud/apps/files_versions/lib/Hooks.php line 56
    OCA\Files_Versions\Storage::store()
 5. /var/www/nextcloud/lib/private/legacy/OC_Hook.php line 106
    OCA\Files_Versions\Hooks::write_hook()
 6. /var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php line 449
    OC_Hook::emit()
 7. /var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php line 178
    OCA\DAV\Connector\Sabre\File->emitPreHooks()
 8. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 1137
    OCA\DAV\Connector\Sabre\File->put()
 9. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php line 492
    Sabre\DAV\Server->updateFile("*** sensitive parameters replaced ***")
10. /var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php line 89
    Sabre\DAV\CorePlugin->httpPut()
11. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 472
    Sabre\DAV\Server->emit()
12. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 253
    Sabre\DAV\Server->invokeMethod()
13. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 321
    Sabre\DAV\Server->start()
14. /var/www/nextcloud/apps/dav/lib/Server.php line 358
    Sabre\DAV\Server->exec()
15. /var/www/nextcloud/apps/dav/appinfo/v2/remote.php line 35
    OCA\DAV\Server->exec()
16. /var/www/nextcloud/remote.php line 166
    require_once("/var/www/nextcl ... p")

PUT /remote.php/dav/files/john.doe/Fels%20Immobilien%20AG/Wohnung%20Musterstrasse%2012/Terminplan/221013%20Terminplan%20Wohnungsumbau%20-%20Kopie.xlsx
from 172.20.5.250 by john.doe at 2022-10-14T13:07:56+00:00

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

<?php
$CONFIG = array (
  'instanceid' => 'oxxxxxxxxxxxxxxx',
  'passwordsalt' => 'xxxxxxxxxxxxxxxxxxxxx',
  'secret' => 'axxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
  'trusted_domains' =>
  array (
    0 => 'portal.abc.ch',
    1 => '10.10.2.123',
  ),
  'datadirectory' => '/var/www/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '24.0.6.1',
  'overwrite.cli.url' => 'https://portal.abc.ch',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => 'false',
  'dbuser' => 'nextclouduser',
  'dbpassword' => 'xxxxxxxxxxxxxxx',
  'installed' => true,
  'mail_from_address' => 'portal-john-doe',
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_domain' => 'xxxxxxxxxxxxxxx.ch',
  'mail_smtphost' => 'mail.xxxxxxxxxxxxxxx.ch',
  'mail_smtpport' => '25',
  'log_type' => 'file',
  'logfile' => '/var/log/nextcloud.log',
  'logfilemode' => 416,
  'loglevel' => '3',
  'logdateformat' => 'F d, Y H:i:s',
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => 'localhost',
    'port' => 6379,
  ),
  'maintenance' => false,
  'theme' => '',
  'default_phone_region' => 'CH',
  'updater.release.channel' => 'stable',

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

[Fri Oct 14 14:54:06.860292 2022] [mpm_prefork:notice] [pid 3797] AH00163: Apache/2.4.54 (Ubuntu) OpenSSL/1.1.1f configured -- resuming normal operations
[Fri Oct 14 14:54:06.860315 2022] [core:notice] [pid 3797] AH00094: Command line: '/usr/sbin/apache2

The error was already with ubuntu 20.04 and PHP 7.4. I then made the upgrade to Ubuntu 22.04 and php 8.1.11 in the hope that it then works.

Thanks for any help

I’m having the same issue when nextcloud apps (such as drawio or the text/markdown editor) try to modify files. Creating new files is not an issue, only modifying existing ones.

Having the same issue here. Maybe any update on this?

Edit: Updated the files_versions app manually to 1.18.0 and seems to works now.