Sabre\DAV\Exception: Could not rename part file to final file

Nextcloud version (eg, 12.0.2): 16
Operating system and version (eg, Ubuntu 17.04):
Apache or nginx version (eg, Apache 2.4.25):
PHP version (eg, 7.1):

The issue you are facing:

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

Steps to replicate it:

  1. Upload Files to External Storage (SMB/CIFS)

The output of your Nextcloud log in Admin > Logging:

Sabre\DAV\Exception: Could not rename part file to final file

  1. /var/www/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php - line 156:OCA\DAV\Connector\Sabre\File->put(null)
  2. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 1096:OCA\DAV\Connector\Sabre\Directory->createFile(“3-3475865.lic”, null)
  3. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 525:Sabre\DAV\Server->createFile(“SEAH_DEPT/3 … c”, null, null)
  4. <>Sabre\DAV\CorePlugin->httpPut(Sabre\HTTP\R … "}, Sabre\HTTP\Response {})
  5. /var/www/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105:call_user_func_array([ Sabre\DAV\ … "], [ Sabre\HTTP … }])
  6. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 479:Sabre\Event\EventEmitter->emit(“method:PUT”, [ Sabre\HTTP … }])
  7. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 254:Sabre\DAV\Server->invokeMethod(Sabre\HTTP\R … "}, Sabre\HTTP\Response {})
  8. /var/www/nextcloud/apps/dav/appinfo/v1/webdav.php - line 80:Sabre\DAV\Server->exec()
  9. /var/www/nextcloud/remote.php - line 163:require_once("/var/www/ne … p")
    Error webdav renaming part file to final file failed $renameOkay: false, $fileExists: false)

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

root@cloud:/var/www/nextcloud/config# more config.php
<?php
$CONFIG = array (
  'passwordsalt' => '',
  'secret' => '',
  'trusted_domains' =>
  array (
    0 => 'localhost',
    1 => '',
    2 => '',
    3 => '',
  ),
  'datadirectory' => '/mnt/ncdata',
  'overwrite.cli.url' => '/',
  'dbtype' => 'pgsql',
  'version' => '16.0.0.9',
  'dbname' => 'nextcloud_db',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => '',
  'dbpassword' => '',
  'installed' => true,
  'instanceid' => 'ocdlkbru62ei',
  'mail_smtpmode' => 'smtp',
  'log_rotate_size' => '10485760',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'filelocking.enabled' => true,
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => '/var/run/redis/redis-server.sock',
    'port' => 0,
    'timeout' => 0.5,
    'dbindex' => 0,
    'password' => '',
  ),
  'htaccess.RewriteBase' => '/',
  'maintenance' => false,
  'ldapIgnoreNamingRules' => false,
  'ldapProviderFactory' => '\\OCA\\User_LDAP\\LDAPProviderFactory',
  'theme' => '',
  'loglevel' => 2,
  'updater.secret' => '',
  'updater.release.channel' => 'stable',
);
root@cloud:/var/www/nextcloud/config#

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

i can't find this

Really ? No one ?

The problem is also discussed here:


but a solution is not in sight.
The real problem seems to be here:

I am having similar problems writing to my external disk

My setup is as follows:

Nextcloud; installation on hosted webserver “Unoeuro.com
Database: SQL/Maria
Nextcloud version: 16.0.4

Added external harddrive to my home router (RT-AC88U) and shared the disk over FTP with full RW access using username:John password: Doe
Tested the Ftp connection all goes well.
I can delete and add files and folders.

Creating a new nextcloud user called John password: Doe

adding the FTP connection to the John profile. Test connection “OK”

Tried adding a new folder to the FTP folder in nextcloud “OK went well”
I checked the folder and it has been created with rwx for owner,group,other
The folder is identified as not hidden.
Owner ID : 1
Group ID : 1

Tried adding a txt file to the newly created folder: [Error: Could not create file “mytestfile.txt”]
I can see the file has been created if I connect to the drive using FTP.
To files is not visible in Nextcloud.
The file permission is:
rw- for owner,group,other
Owner ID : 1
Group ID : 1
The files is identified as not hidden.

Tried uploading picture to newly created folder: it looks like the file uploaded. [Error: Could not rename part file to final file]
The file is not visible in nextcloud.
I can see the file has been created if I connect to the drive using FTP.
the file permission is:
rw- for owner,group,other
Owner ID : 1
Group ID : 1
The files is identified as not hidden.

The log files gives me this fatal error:

Sabre\DAV\Exception: Could not rename part file to final file
/var/www/[MY DOMAIN].com/cloud/apps/dav/lib/Connector/Sabre/Directory.php - line 156:
OCA\DAV\Connector\Sabre\File->put(null)
/var/www/[MY DOMAIN].com/cloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 1096:
OCA\DAV\Connector\Sabre\Directory->createFile(“NC uploaded pic3.JPG”, null)
/var/www/[MY DOMAIN].com/cloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 525:
Sabre\DAV\Server->createFile(“Data/NC map … G”, null, null)
<>
Sabre\DAV\CorePlugin->httpPut(Sabre\HTTP\R … "}, Sabre\HTTP\Response {})
/var/www/[MY DOMAIN].com/cloud/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105:
call_user_func_array([ Sabre\DAV\ … “], [ Sabre\HTTP … }])
/var/www/[MY DOMAIN].com/cloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 479:
Sabre\Event\EventEmitter->emit(“method:PUT”, [ Sabre\HTTP … }])
/var/www/[MY DOMAIN].com/cloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 254:
Sabre\DAV\Server->invokeMethod(Sabre\HTTP\R … “}, Sabre\HTTP\Response {})
/var/www/[MY DOMAIN].com/cloud/apps/dav/appinfo/v1/webdav.php - line 80:
Sabre\DAV\Server->exec()
/var/www/[MY DOMAIN].com/cloud/remote.php - line 163:
require_once(”/var/www/by … p”)

unlink() [function.unlink]: Error Deleting file: 550 Delete operation failed.
at /var/www/[MY DOMAIN].com/cloud/apps/files_external/lib/Lib/Storage/FTP.php#98
Error webdav renaming part file to final file failed $renameOkay: true, $fileExists: false)

Hope this will bring new information to the table.
Best Regards
Lasse