core icon indicating copy to clipboard operation
core copied to clipboard

OC-5.0.4 renamed file sharing failed

Open PisikeSipelgas opened this issue 13 years ago • 7 comments

Upload a file (eg 1.png). Sharing with link works, but don't share it for now.

Rename it: 1.png -> 2.png

Trying to share with link: "Sharing 26 failed, because the sharing backend for file could not find its source"

From syslog messages: Apr 11 12:51:41 pilv ownCloud[1256]: {OCP\Share} Sharing 26 failed, because the sharing backend for file could not find its source

From filesystem perspective file is renamed (2.png).

'oc_filecache' table also contains new filename: path: files/2.png name: 2.png

And now the trick: delete the file. Go to "Deleted files" and restore. Now sharing with link works again.

PisikeSipelgas avatar Apr 11 '13 10:04 PisikeSipelgas

@schiesbn @blizzz @icewind1991 @MTGap

karlitschek avatar Apr 11 '13 10:04 karlitschek

May it be related to the rename hook issue? cc @butonic

blizzz avatar Apr 11 '13 10:04 blizzz

Related to #2795, #2840 ? :)

Vodochnik avatar Apr 11 '13 14:04 Vodochnik

Trying to reproduce this. Some clarifications:

  1. Upload a file (eg 1.png).
  2. Rename it: 1.png -> 2.png
  3. sharing via link without a page refresh give the error mentioned by @PisikeSipelgas: "Sharing 26 failed, because the sharing backend for file could not find its source"
  4. try scanFiles(true) in the browser console (warning will rescan all files, might take a while. better use a test account), on completion, sharing still fails with the same error
  5. reload page: sharing via link works

Looking at the db the fileid is no longer present in the db. Further investigation reveals that a file rename also changes the fileid ?!?!? @icewind1991 is this intended? So either we have to update the browser and tell him the new file id, or there is something wrong with file renames.

digging deeper ...

butonic avatar Apr 11 '13 15:04 butonic

Duplicate of #2170

Come on guys I've described the problem multiple times on the mailing list and in the issue above. @butonic this is exactly what our emails about renaming files is trying to resolve.

MTGap avatar Apr 11 '13 15:04 MTGap

It seems that OC\Files\Cache\Cache->move($source, $target) is called too late. $sourceId = $this->getId($source); returns -1

@MTGap yeah but this one I can actually reproduce ;)

butonic avatar Apr 11 '13 15:04 butonic

All the details are already in my 2 initial emails.

MTGap avatar Apr 11 '13 16:04 MTGap