Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
maltepost opened this issue Apr 19, 2021 · 21 comments · Fixed by nextcloud/server#26980
Closed
Labels
1. to develop Issues that are ready for development bug high high priority Nc21

Comments

@maltepost
Copy link

maltepost commented Apr 19, 2021

We get "Could not rename part file to final file"-Errors when trying to write files in shared folders in a group folder (group folder/shared folder/...) on two different servers which were updated to version 21.0.1.1. The two backup servers with version 20.0.9 run fine. Any ideas?

[webdav] Fatal: Sabre\DAV\Exception: Could not rename part file to final file at <<closure>>

0. /var/www/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php line 156
   OCA\DAV\Connector\Sabre\File->put(null)
1. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 1098
   OCA\DAV\Connector\Sabre\Directory->createFile("210412_CDD Proj ... X", null)
2. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php line 504
   Sabre\DAV\Server->createFile("Testuser.docume ... X", null, null)
3. /var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php line 89
   Sabre\DAV\CorePlugin->httpPut(Sabre\HTTP\Request {}, Sabre\HTTP\Response {})
4. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 472
   Sabre\DAV\Server->emit("method:PUT", [Sabre\HTTP\Requ ... }])
5. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 253
   Sabre\DAV\Server->invokeMethod(Sabre\HTTP\Request {}, Sabre\HTTP\Response {})
6. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 321
   Sabre\DAV\Server->start()
7. /var/www/nextcloud/apps/dav/appinfo/v1/webdav.php line 84
   Sabre\DAV\Server->exec()
8. /var/www/nextcloud/remote.php line 167
   require_once("/var/www/nextcl ... p")

PUT /remote.php/webdav/Testuser.documents/210412_CDD%.DOCX
from 62.84.220.XXX by Testuser at 2021-04-19T10:19:58+00:00
@JacoboDominguez
Copy link

Same problem, it seems an issue with the folder path, the error reports access to the path:
./data//
while in the server group folders are inside the ./data/__groupfolder//, e.g.
./data/__groupfolder//

I fixed temporally creating a symbolink link in ./data/ => to the ./data/__groupfolder/
Is this a bug with the code or should this symbolics link be created?. The symbolic link is a temporary fix for me, because group folder name could collide with an username, that must be the reason to host them in the __groupfolder.
Cheers

@propcoder
Copy link

I met similar issue and reported here: github.com/nextcloud/server/issues/26649#issue-862649435

@variantolog
Copy link

variantolog commented Apr 20, 2021

Same problem. Servers with version 20.0.9 run fine.

In my case:
/mnt/ncdata/__groupfolder/4 - Group folder (with ID 4)
/mnt/ncdata/__groupfolder/4/FSFU - Folder shared for user (located in group folder with ID 4)

User tries to upload own files in FSFU
Error in log: unable to rename, source directory is not writable : /mnt/ncdata/FSFU
In fact, of course, there is no such folder at all

My temporary fix: ln -s /mnt/ncdata/__groupfolder/4/FSFU /mnt/ncdata/FSFU

@variantolog
Copy link

variantolog commented Apr 21, 2021

P.S.
IMHO, i assume that when forming the full path, instead of the getSourcePath() function from the GroupMountPoint class, some other function is used.

@pierreozoux pierreozoux added 0. Needs triage Issues that need to be triaged bug Nc21 labels Apr 21, 2021
@kaberdouch
Copy link

Same problem after migrating to docker and upgrading from 20.0.8 to 21.0.1

@HLeithner
Copy link

same problem here Nextcloud 21.0.1

@N4IR0
Copy link

N4IR0 commented Apr 27, 2021

It seems that this bug also exists after upgrading to Nextcloud 20.0.9

@bob4os
Copy link

bob4os commented Apr 27, 2021

Interestingly moving a file from your Nextcloud root folder into your shared subfolder of a groupfolder is possible.
Permissions on the share do not matter.
(PHP 7.4 and Lighttpd)

@borekon
Copy link

borekon commented Apr 28, 2021

Same problem. Servers with version 20.0.9 run fine.

In my case:
/mnt/ncdata/__groupfolder/4 - Group folder (with ID 4)
/mnt/ncdata/__groupfolder/4/FSFU - Folder shared for user (located in group folder with ID 4)

User tries to upload own files in FSFU
Error in log: unable to rename, source directory is not writable : /mnt/ncdata/FSFU
In fact, of course, there is no such folder at all

My temporary fix: ln -s /mnt/ncdata/__groupfolder/4/FSFU /mnt/ncdata/FSFU

Same here, except if i create a file instead of upload it, the file is created in the right folder and no error is shown

@Ornanovitch
Copy link

Ornanovitch commented Apr 28, 2021

It seems to be a duplicate of the recent #1445 (or at least linked to it)

This might affect a lot of users...

@HLeithner
Copy link

Many things have been fixed in 9.0.1 but not this issue (at least for me)

@bob4os
Copy link

bob4os commented Apr 28, 2021

I can see that files like "... .ocTransferId ... .part" are created in the shared folders - only renaming the file after the transfer fails.
The ".part" files remain in these folders.

@Skywalker-11
Copy link

Assume:
groupfolder GF grants write access to group WG
User A, B are member of group WG
User C is not a member of group WG

  • user B tries to upload a file to the group folder GF: ✔️
  • user A shares subdirectory GF/S of the group folder with B; B uploads a file to the shared directory S (not via the GF but the separate share): ❌
  • user A shares subdirectory GF/S of the group folder with B; B uploads a file to the directory GF/S (via the actual GF): ✔️
  • user A shares any directory (incl. root of GF) with user C; C uploads a file to the shared directory: ❌
  • user A creates a share link to any directory of GF; B uploads a file to link shared directory: ✔️
  • user A creates a share link to any directory of GF; C uploads a file to link shared directory: ✔️

❌ creates the rename part file to final file error

So it seems to be an issue of incompatibility of groupfolders with user shares and link shares are working fine.

Setup: groupfolders 9.0.1; NC: 21.0.1; LDAP user and group backend: 1.11.0

@fschrempf fschrempf added high high priority 1. to develop Issues that are ready for development and removed 0. Needs triage Issues that need to be triaged labels Apr 30, 2021
@solracsf solracsf changed the title v.21.0.1.1 | Could not rename part file to final file-Error when trying to write file in shared folder in a group folder (group folder/shared folder/...) Could not rename part file to final file-Error when trying to write file in shared folder in a group folder (group folder/shared folder/...) May 5, 2021
@solracsf solracsf changed the title Could not rename part file to final file-Error when trying to write file in shared folder in a group folder (group folder/shared folder/...) Fatal: Sabre\DAV\Exception Could not rename part file to final file May 5, 2021
@pgassmann
Copy link

pgassmann commented May 7, 2021

Related to

@mowtee
Copy link

mowtee commented May 8, 2021

Thank you to everyone who reported and is actively developing to fix this bug! My company is kinda panicking right now, because it prevents our partners and customers to our Nextcloud, which relies on Group Folders. Is there any estimate, when we can expect a fix? Thank you so much!

@juliusknorr
Copy link
Member

Bisect showed that nextcloud/server#25568 seems to be causing this with the steps from #1453 (comment)

@Ornanovitch
Copy link

Bisect showed that nextcloud/server#25568 seems to be causing this with the steps from #1453 (comment)

How could this issue be related to the trashbin? The steps above don't mention anything concerning the trash...

@trieq
Copy link

trieq commented Jun 23, 2021

The issue is still present in 21.0.2. Users with access to direct shares are unable to upload files and get the error 'Could not rename part file to final file'

@juliusknorr
Copy link
Member

The linked fix will become part of 21.0.3 nextcloud/server#27015

@exander77
Copy link

How to recover from the part file? I can't seem to be able to decrypt it.

@thekk1
Copy link

thekk1 commented Oct 12, 2021

Assume: groupfolder GF grants write access to group WG User A, B are member of group WG User C is not a member of group WG

* user B tries to upload a file to the group folder GF: heavy_check_mark

* user A shares subdirectory GF/S of the group folder with B; B uploads a file to the shared directory S (not via the GF but the separate share): x

* user A shares subdirectory GF/S of the group folder with B; B uploads a file to the directory GF/S (via the actual GF): heavy_check_mark

* user A shares any directory (incl. root of GF) with user C; C uploads a file to the shared directory: x

* user A creates a share link to any directory of GF; B uploads a file to link shared directory: heavy_check_mark

* user A creates a share link to any directory of GF; C uploads a file to link shared directory: heavy_check_mark

x creates the rename part file to final file error

So it seems to be an issue of incompatibility of groupfolders with user shares and link shares are working fine.

Setup: groupfolders 9.0.1; NC: 21.0.1; LDAP user and group backend: 1.11.0

Additional to this cases, there is another case which provoke this error message:
If group WG has no right to delete in group folder or in a subfolder in the group folder, an upload over the client will fail with the same error message 500.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. to develop Issues that are ready for development bug high high priority Nc21
Projects
None yet
Development

Successfully merging a pull request may close this issue.