You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
File cannot be shared via link (permalink) if file was renamed #1382
We are sharing a folder with mulitple users and all works fine with sync clients.
When we try to access files by the share link, we get sometimes a 404.
This only happens when we try to share a file that was renamed and then shared via link. We also found out that it does not help if we rename the file.
Here are three experiments that we tried to narrow done the cause of the issue:
Experiment 1: Causes the bug
Upload a file via web interface (into a shared folder)
rename the newly uploaded file
share the file by link
This results in a 404.
Experiment 2: Without renaming
These steps lead to working link (same directory, same user, same file)
Upload the file via web interface (again a shared folder)
share file by link
This results in a working link.
Experiment 3: In a not shared folder
Last setup: like the first experiment but not within a shared folder
Upload a file via web interface (into a NOT shared folder)
Thanks for the detailed report. I can reproduce it now.
It seems like during the rename process both the file system cache and the oc_share table doesn't get updated correctly with the new file name. This causes the problem you described above.
Further, if the owner of the file logs into his ownCloud his file cache will be updated (because the physical file was renamed correctly). This means that ownCloud will assume that the original file was deleted and that the file with the new name is a completely new file. This will also result in a lose of all shares defined for the original file before the rename action took place.
I have to check if this can be solved with the file cache we use in OC4.5.
We should also make sure that this problem doesn't happen in OC5 with the new file cache!
Message in Error Log:
fopen(/www/htdocs/cloud/data/christian/files/Pi/p) [function.fopen]: failed to open stream: No such file or directory at /www/htdocs//cloud/lib/files/storage/local.php#143
filemtime() [function.filemtime]: stat failed for /www/htdocs/cloud/data/christian/files/RaspberryPi at /www/htdocs/cloud/lib/files/storage/local.php#92
The file name is not "p". Its "pibox.png",
The file name is truncated.
fopen(/var/www/owncloud/data/admin/files/Akcie/!pomocne_vypocty_bilancie/C): failed to open stream: No such file or directory at /var/www/owncloud/lib/files/storage/local.php#143
Activity
schiessle commentedon Feb 15, 2013
Thanks for the detailed report. I can reproduce it now.
It seems like during the rename process both the file system cache and the oc_share table doesn't get updated correctly with the new file name. This causes the problem you described above.
Further, if the owner of the file logs into his ownCloud his file cache will be updated (because the physical file was renamed correctly). This means that ownCloud will assume that the original file was deleted and that the file with the new name is a completely new file. This will also result in a lose of all shares defined for the original file before the rename action took place.
I have to check if this can be solved with the file cache we use in OC4.5.
We should also make sure that this problem doesn't happen in OC5 with the new file cache!
cc @icewind1991 @MTGap
sruslanas commentedon Mar 5, 2013
Is this fixed in ownCloud 4.5.7 ?
perryflynn commentedon Mar 16, 2013
No, i have the same issue with OC 5.
Message in Error Log:
fopen(/www/htdocs/cloud/data/christian/files/Pi/p) [function.fopen]: failed to open stream: No such file or directory at /www/htdocs//cloud/lib/files/storage/local.php#143
filemtime() [function.filemtime]: stat failed for /www/htdocs/cloud/data/christian/files/RaspberryPi at /www/htdocs/cloud/lib/files/storage/local.php#92
The file name is not "p". Its "pibox.png",
The file name is truncated.
Lupuz23 commentedon Mar 16, 2013
Same problem here OC 5.
Message in Log:
fopen(/var/www/owncloud/data/admin/files/Akcie/!pomocne_vypocty_bilancie/C): failed to open stream: No such file or directory at /var/www/owncloud/lib/files/storage/local.php#143
file is Calculation.xls
MTGap commentedon Mar 16, 2013
@sim4000 @lupus-yonderboy That's a different problem and is already resolved #2291 #2249
Please use the search.
MTGap commentedon Mar 17, 2013
This is fixed in #2204 and should have been included in the release. Sorry about that.
MTGap commentedon Apr 8, 2013
Closing and moving discussion to #2170 because it isn't just links.