Skip to content

SMB/CIFS Problem: Could not rename part file to final file #11295

Closed

Description

@Lumm23

Steps to reproduce

  1. Connect a SMB/CIFS External Storage to cloud
  2. Uplaod any File you want

Expected behaviour

Tell us what should happen

Upload should begin and finish with no issue

Actual behaviour

Tell us what happens instead

The file is trying to upload but exits with the error on top:

Could not rename part file to final file

Server configuration

Operating system:

Ubuntu 18.04 LTS

Web server:

Apache 2

Database:

MariaDB

PHP version:

PHP 7.1

Nextcloud version: (see Nextcloud admin page)

NC 14.0.0.19

Updated from an older Nextcloud/ownCloud or fresh install:

Updated from 13.0.6

Where did you install Nextcloud from:

Tech and me prepared VM installation

Signing status:

Signing status
Login as admin user into your Nextcloud and access 
http://example.com/index.php/settings/integrity/failed 
paste the results here.

No errors have been found.

List of activated apps:

App list - accessibility: 1.0.1 - activity: 2.7.0 - admin_audit: 1.4.0 - bruteforcesettings: 1.1.0 - cloud_federation_api: 0.0.1 - comments: 1.4.0 - dav: 1.6.0 - federatedfilesharing: 1.4.0 - files: 1.9.0 - files_external: 1.5.0 - files_pdfviewer: 1.3.2 - files_rightclick: 0.8.4 - files_sharing: 1.6.2 - files_texteditor: 2.6.0 - files_trashbin: 1.4.1 - files_versions: 1.7.1 - files_videoplayer: 1.3.0 - gallery: 18.1.0 - groupfolders: 1.3.3 - logreader: 2.0.0 - lookup_server_connector: 1.2.0 - metadata: 0.7.0 - nextcloud_announcements: 1.3.0 - notifications: 2.2.1 - oauth2: 1.2.1 - password_policy: 1.4.0 - previewgenerator: 1.1.0 - provisioning_api: 1.4.0 - serverinfo: 1.4.0 - sharebymail: 1.4.0 - support: 1.0.0 - survey_client: 1.2.0 - systemtags: 1.4.0 - theming: 1.5.0 - twofactor_backupcodes: 1.3.1 - updatenotification: 1.4.1 - user_ldap: 1.4.0 - workflowengine: 1.4.0 Disabled: - admin_notifications - announcementcenter - checksum - contacts - encryption - federation - files_accesscontrol - files_downloadactivity - files_retention - firstrunwizard - fulltextsearch - ldaporg - quota_warning - ransomware_protection - tasks - unsplash - user_external - w2g2
If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your Nextcloud installation folder

Nextcloud configuration:

Config report

{
"system": {
"passwordsalt": "REMOVED SENSITIVE VALUE",
"secret": "REMOVED SENSITIVE VALUE",
"trusted_domains": [
"localhost",
"192.168.50.28",
"nextcloud",
"cloud.gertex.de",
"gertex.net",
"192.168.50.47"
],
"datadirectory": "REMOVED SENSITIVE VALUE",
"overwrite.cli.url": "https://cloud.gertex.de/",
"dbtype": "mysql",
"version": "14.0.0.19",
"dbname": "REMOVED SENSITIVE VALUE",
"dbhost": "REMOVED SENSITIVE VALUE",
"dbport": "",
"dbtableprefix": "oc_",
"mysql.utf8mb4": true,
"dbuser": "REMOVED SENSITIVE VALUE",
"dbpassword": "REMOVED SENSITIVE VALUE",
"installed": true,
"instanceid": "REMOVED SENSITIVE VALUE",
"quota_include_external_storage": false,
"maintenance": false,
"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": {
"host": "REMOVED SENSITIVE VALUE",
"port": 0,
"timeout": 0,
"dbindex": 0,
"password": "REMOVED SENSITIVE VALUE"
},
"htaccess.RewriteBase": "/",
"ldapIgnoreNamingRules": false,
"ldapProviderFactory": "\OCA\User_LDAP\LDAPProviderFactory",
"mail_from_address": "REMOVED SENSITIVE VALUE",
"mail_smtpauthtype": "LOGIN",
"mail_domain": "REMOVED SENSITIVE VALUE",
"mail_smtphost": "REMOVED SENSITIVE VALUE",
"loglevel": 1,
"updater.release.channel": "production",
"theme": ""
}
}

Are you using external storage, if yes which one: local/smb/sftp/...

SMB

Are you using encryption: yes/no

No

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...

LDAP

LDAP configuration (delete this part if not used)

LDAP config

| hasMemberOfFilterSupport | 1 |
| hasPagedResultSupport | |
| homeFolderNamingRule | |
| lastJpegPhotoLookup | 0 |
| ldapAgentName | CN=User,OU=Group,DC=domain,DC=net |
| ldapAgentPassword | *** |
| ldapAttributesForGroupSearch | |
| ldapAttributesForUserSearch | |
| ldapBackupHost | nothing to see here |
| ldapBackupPort | nothing to see here |
| ldapBase | DC=domain,DC=net |
| ldapBaseGroups | DC=domain,DC=net |
| ldapBaseUsers | DC=domain,DC=net |
| ldapCacheTTL | 1200 |
| ldapConfigurationActive | 1 |
| ldapDefaultPPolicyDN | |
| ldapDynamicGroupMemberURL | |
| ldapEmailAttribute | mail |
| ldapExperiencedAdmin | 0 |
| ldapExpertUUIDGroupAttr | |
| ldapExpertUUIDUserAttr | sAMAccountName |
| ldapExpertUsernameAttr | sAMAccountName |
| ldapGidNumber | gidNumber |
| ldapGroupDisplayName | cn |
| ldapGroupFilter | (&(|(objectclass=group))(|(cn=somegroup)(cn=somegroup)(cn=somegroup))) |
| ldapGroupFilterGroups | somegroup;somegroup;somegroup |
| ldapGroupFilterMode | 0 |
| ldapGroupFilterObjectclass | group |
| ldapGroupMemberAssocAttr | member |
| ldapHost | some ip |
| ldapIgnoreNamingRules | |
| ldapLoginFilter | (&(&(|(objectclass=user))(|(|(memberof=CN=group,CN=Users,DC=domain,DC=net)(primaryGroupID=8715))))(|(samaccountname=%uid)(|(mailPrimaryAddress=%uid)(mail=%uid))(|(sAMAccountName=%uid)))) |
| ldapLoginFilterAttributes | sAMAccountName |
| ldapLoginFilterEmail | 1 |
| ldapLoginFilterMode | 0 |
| ldapLoginFilterUsername | 1 |
| ldapNestedGroups | 0 |
| ldapOverrideMainServer | |
| ldapPagingSize | 500 |
| ldapPort | 389 |
| ldapQuotaAttribute | |
| ldapQuotaDefault | |
| ldapTLS | 0 |
| ldapUserAvatarRule | default |
| ldapUserDisplayName | displayname |
| ldapUserDisplayName2 | |
| ldapUserFilter | (&(|(objectclass=user))(|(|(memberof=CN=group ,CN=Users,DC=domain,DC=net)(primaryGroupID=some ID)))) |
| ldapUserFilterGroups | Group |
| ldapUserFilterMode | 0 |
| ldapUserFilterObjectclass | user |
| ldapUuidGroupAttribute | auto |
| ldapUuidUserAttribute | auto |
| turnOffCertCheck | 0 |
| turnOnPasswordChange | 0 |
| useMemberOfToDetectMembership | 1 |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

Client configuration

Browser:
Google Chrome
Version 69.0.3497.100

Operating system:

Windows 10
Version 1803
Build 17134.286

Logs

Nextcloud log (data/nextcloud.log)

Nextcloud log
Fatal webdav Sabre\DAV\Exception: Could not rename part file to final file/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php - line 156:OCA\DAV\Connector\Sabre\File->put(null)/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 1096:OCA\DAV\Connector\Sabre\Directory->createFile("nix.png", null)/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 529:Sabre\DAV\Server->createFile("zwissTEX Me ... g", null, null)Sabre\DAV\CorePlugin->httpPut(Sabre\HTTP\R ... "}, Sabre\HTTP\Response {})/var/www/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105:call_user_func_array([ Sabre\DAV\ ... "], [ Sabre\HTTP ... }])/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 479:Sabre\Event\EventEmitter->emit("method:PUT", [ Sabre\HTTP ... }])/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 254:Sabre\DAV\Server->invokeMethod(Sabre\HTTP\R ... "}, Sabre\HTTP\Response {})/var/www/nextcloud/apps/dav/appinfo/v1/webdav.php - line 80:Sabre\DAV\Server->exec()/var/www/nextcloud/remote.php - line 163:require_once("/var/www/ne ... p")
Error webdav renaming part file to final file failed ($run: false, $renameOkay: false, $fileExists: false)
Error PHP Undefined variable: run at /var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php#223
Warning no app in context Icewind\SMB\Exception\NotFoundException: Invalid request for /0005a_Managementsystem%20Mexico/nix.png (NotFoundException)/var/www/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Native/NativeState.php - line 61:Icewind\SMB\Exception\Exception::fromMap({ 1: "Icewin ... "}, 2, "/0005a_Mana ... g")/var/www/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Native/NativeState.php - line 73:Icewind\SMB\Native\NativeState->handleError("/0005a_Mana ... g")/var/www/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Native/NativeState.php - line 136:Icewind\SMB\Native\NativeState->testResult(false, "smb://192.1 ... g")/var/www/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Native/NativeShare.php - line 166:Icewind\SMB\Native\NativeState->rename("smb://192.1 ... t", "smb://192.1 ... g")/var/www/nextcloud/apps/files_external/lib/Lib/Storage/SMB.php - line 237:Icewind\SMB\Native\NativeShare->rename("/0005a_Mana ... t", "/0005a_Mana ... g")/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php - line 276:OCA\Files_External\Lib\Storage\SMB->rename("nix.png.ocT ... t", "nix.png")/var/www/nextcloud/lib/private/Files/Storage/Wrapper/PermissionsMask.php - line 88:OC\Files\Storage\Wrapper\Wrapper->rename("nix.png.ocT ... t", "nix.png")/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php - line 276:OC\Files\Storage\Wrapper\PermissionsMask->rename("nix.png.ocT ... t", "nix.png")/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Availability.php - line 299:OC\Files\Storage\Wrapper\Wrapper->rename("nix.png.ocT ... t", "nix.png")/var/www/nextcloud/apps/files_trashbin/lib/Storage.php - line 163:OC\Files\Storage\Wrapper\Availability->rename("nix.png.ocT ... t", "nix.png")/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php - line 570:OCA\Files_Trashbin\Storage->rename("nix.png.ocT ... t", "nix.png")/var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php - line 220:OC\Files\Storage\Wrapper\Wrapper->moveFromStorage(OCA\Files_Tr ... l}, "nix.png.ocT ... t", "nix.png")/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php - line 156:OCA\DAV\Connector\Sabre\File->put(null)/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 1096:OCA\DAV\Connector\Sabre\Directory->createFile("nix.png", null)/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 529:Sabre\DAV\Server->createFile("zwissTEX Me ... g", null, null)Sabre\DAV\CorePlugin->httpPut(Sabre\HTTP\R ... "}, Sabre\HTTP\Response {})/var/www/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105:call_user_func_array([ Sabre\DAV\ ... "], [ Sabre\HTTP ... }])/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 479:Sabre\Event\EventEmitter->emit("method:PUT", [ Sabre\HTTP ... }])/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 254:Sabre\DAV\Server->invokeMethod(Sabre\HTTP\R ... "}, Sabre\HTTP\Response {})/var/www/nextcloud/apps/dav/appinfo/v1/webdav.php - line 80:Sabre\DAV\Server->exec()/var/www/nextcloud/remote.php - line 163:require_once("/var/www/ne ... p")

Activity

  1. nextcloud-bot commented on Sep 19, 2018

    @nextcloud-bot
    Member

    GitMate.io thinks possibly related issues are #9152 (Problem renaming folders), #9000 (Problem rewriting SMB files), #8942 (Uploading to shared public upload-only Folder fails: Could not rename part file to final file), #9091 ( server replied: Internal Server Error (Could not rename part file to final file)), and #490 (Rename file logging from "ownCloud" to "file").

  2. Lumm23 commented on Sep 24, 2018

    @Lumm23
    Author

    Does no one has any idea what causes this error or how ti fix it ? I cant upload any file to the external storage. This is very important because there are over 200 users waiting for it. I searched through all the forums i could find and also the things the nextcloud bot suggested me. There is no fix that could have helped me. Could someone please look through this ? Thanks very much.

  3. Lumm23 commented on Sep 26, 2018

    @Lumm23
    Author

    Does no one else have this problem ?

  4. Lumm23 commented on Oct 8, 2018

    @Lumm23
    Author

    I really need your help .. just give me any point where i can start searching for the problem ..

  5. mwitschel commented on Oct 9, 2018

    @mwitschel

    We had a similiar problem with NetApp as backend for CIFS/SMB external storage. Seems the CIFS implementation on NetApp and Samba/smbclient negotiated SMB1 as protocol but tried to upload with data chunks > 64k which does not work in SMB1 resulting in a butched upload.
    To fix this behaviour add the following to global section of /etc/samba/smb.conf (path may differ on your system) on your nextcloud server:

    client min protocol = SMB2
    client max protocol = SMB2
    min protocol = SMB2
    max protocol = SMB2
    

    Pls let me know if this was of any help.

    Source:
    https://unix.stackexchange.com/questions/367202/setting-smb-2-0-as-default-for-mount-operations

  6. Lumm23 commented on Oct 11, 2018

    @Lumm23
    Author

    Did not change anything.. i checked the whole smb.conf file there wasnt anything like that in there so i copied that in the file. I tried rebooting the whole machine but it did not affect the error at all ..

  7. mwitschel commented on Oct 11, 2018

    @mwitschel

    It may well be that this won't fix your problem. But just to make sure, you put those lines into the global section of smb.conf? It is prefixed by a line "[global]".
    Otherwise those parameters wont do anything.

  8. Lumm23 commented on Oct 11, 2018

    @Lumm23
    Author

    image
    That's where i pastet them.

  9. mwitschel commented on Oct 11, 2018

    @mwitschel

    seems perfect... then sorry for not beeing helpfull in your case :(

  10. Lumm23 commented on Oct 11, 2018

    @Lumm23
    Author

    no problem but thanks for tryin .. :/

  11. Lumm23 commented on Oct 17, 2018

    @Lumm23
    Author

    still not working after 14.0.3 Update ....

  12. egena-its commented on Nov 2, 2018

    @egena-its

    Same here;
    Tech&Me VM
    14.0.3
    Exact same issue.

  13. Lumm23 commented on Nov 2, 2018

    @Lumm23
    Author

    Are you using Netapp with a CIFS share?

  14. egena-its commented on Nov 4, 2018

    @egena-its

    Are you using Netapp with a CIFS share?

    I'm using an internally self-hosted Tech&Me VM, updated to 14.03 using the External Storage SMB/CIFS share configuration to a Windows 2012 Std (Not R2) share. Creating a file within Nextcloud works fine but uploads do not, this includes the sync clients on any platform.

    I have done a workaround by mounting the windows share using fstab and using "Local" as storage type. This means the share is accessed using one set of windows credentials rather than the LDAP authentication (preferred) but this works very well - and much quicker!

  15. 21 remaining items

  16. ynott commented on Jan 29, 2021

    @ynott

    @Tschortsch666

    As I use NextCloud in a Docker Container, the change is not persistant. Is there any solution in the meanwhile?

    This isn't the main topic, but
    How about browsing samba.conf on the Docker host side from within the Docker container?

    like this.

    mkdir /docker-host/samba/
    cp /etc/samba/smb.conf /docker-host/samba/
    docker run nextcloud:stable -v /docker-host/samba:/etc/samba
    
  17. Tschortsch666 commented on Jan 29, 2021

    @Tschortsch666

    @ynott:
    Yes, as I am currently no docker-expert, I did not think about this solution. Will add this to the Dockerfile.
    Anyway - a solution should be provided as I think that the Setup AD-Controller <> DFS-Shares <> NextCloud is Enterprise-like ;)

    Cheers,
    Tschortsch

  18. coderReview commented on Jun 6, 2022

    @coderReview

    https://bugzilla.samba.org/show_bug.cgi?id=14169 This has been fixed on latest version of samba. Some other issues related to the SAMBA library that had issues with Nextcloud and Owncloud were fixed as well.

  19. szaimen commented on Jan 9, 2023

    @szaimen
    Contributor

    Hi, please update to 24.0.8 or better 25.0.2 and report back if it fixes the issue. Thank you!

  20. added
    0. Needs triage
    and removed
    1. to develop
    on Jan 9, 2023
  21. Tschortsch666 commented on Jan 9, 2023

    @Tschortsch666
  22. szaimen commented on Jan 9, 2023

    @szaimen
    Contributor

    Great! Thanks for verifying!

  23. akarabach commented on Apr 3, 2024

    @akarabach
    Screenshot 2024-04-04 at 00 16 56

    @szaimen It should be reopened, [Nextcloud Hub 7] (28.0.4)

  24. ha11oga11o commented on Dec 3, 2024

    @ha11oga11o

    Yeah,

    something went wrong again.

    Image

    Image

    Image

    Image

    [Nextcloud Hub 9] (30.0.2)

    Was trying to uplaod 133MB MOV file from iphone. I let it do with screen on for about 10 minutes. It was going back and forward from 95MB to 133MB multiple times. And finally finished it saying its uploaded 15 hours ago.

  25. greenhazel commented on Jun 30, 2026

    @greenhazel

    nextcloud:32 docker image
    issue on FTP still persists)
    S3 works fine

  26. github-actions commented on Nov 5, 2026

    @github-actions
    Contributor

    This issue has been automatically locked because it has been closed for more than 14 days. As we do not monitor closed issues, we are locking this issue to prevent further comments from getting lost in the noise.
    Please open a new issue if you have a similar problem instead. For general discussions, please use our forum: https://help.nextcloud.com

  27. locked as resolved and limited conversation to collaborators on Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    0. Needs triagebugfeature: external storageneeds info

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions