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
Users cannot delete files from shared/ even with delete permission #16599
Share folder with group/user, giving delete permissions
Navigate to file in folder attempt to delete
Expected behaviour
File should be deleted
Actual behaviour
Error message "Could not delete: filename"
Activity Log still shows that the person deleted the file, but the file remains.
I added some debugging lines to delete.php and it fails on the unlink() call on line 31.
The admin account can delete the file just fine, only the user gets the error message.
The user can delete any of their own files, the only problem files are under Shared/
Server configuration
Operating system: Ubuntu 14.04
Web server: Apache
Database: MariaDB
PHP version: 5.5.9
ownCloud version: 8.0.3
Updated from an older ownCloud or fresh install: Updated from 6.x->7.x->8.0->8.0.3
List of activated apps: Activity, Deleted Files, First Run Wizard, PDF Viewer, Share Files, Updater, Versions, Video Viewer
Are you using external storage, if yes which one: No
Are you using encryption: no
Are you using an external user-backend, if yes which one: No
Client configuration
Browser: Chrome/Internet Explorer
Operating system: Windows 7
Logs
Web server error log
No lines are added to the log when trying to delete
ownCloud log (data/owncloud.log)
No lines are added to the log when trying to delete
If the permissions were wrong, the UI would not show the trash icon but it does here.
Can you confirm that you had "loglevel" set to 0 when checking the logs ?
I see you have encryption enabled: usually when deleting a file it will first delete the file and then delete the keys. So maybe the file deletion worked but something wrong happened during key deletion.
Just confirmed loglevel = 0, still no log entries written when it fails. In double checking looks like I'm not using encryption, sorry for the mistake there.
Again from my testing the line that fails is as follows app/files/ajax/delete.php
\OC\Files\Filesystem::unlink($dir . '/' . $file)
I'm not familiar enough with the owncloud source to determine which unlink it was using so that's as far as I got with my troubleshooting.
It just returns false, I'm not able to debug unlink()
Also I had only been trying with old folders that existed before the upgrade from 7->8. It turns out file deletion works if I create a new folder, new file, then share the folder and delete.
The delete only fails if the folder existed before the upgrade, even if the file is new after the upgrade.
Ok, I figured it out and after changing everything possible and the solution is a bit strange, likely a bug?
So even if I remove all groups for a user, remove all sharing for a folder, then re-add groups, and re-add sharing it still would not allow users to delete shared files.
It seems this was because all users have a quota set of 0. Once I increase the quota for a user to 1GB they are able to delete files out of the shared directories. This certainly was not the behavior in versions 6/7 as we have always maintained 0 quota for all employees and they work out of shared exclusively.
Activity
PVince81 commentedon May 28, 2015
Hmm strange.
If the permissions were wrong, the UI would not show the trash icon but it does here.
Can you confirm that you had "loglevel" set to 0 when checking the logs ?
I see you have encryption enabled: usually when deleting a file it will first delete the file and then delete the keys. So maybe the file deletion worked but something wrong happened during key deletion.
mattrandallbecker commentedon May 28, 2015
Just confirmed loglevel = 0, still no log entries written when it fails. In double checking looks like I'm not using encryption, sorry for the mistake there.
Again from my testing the line that fails is as follows app/files/ajax/delete.php
\OC\Files\Filesystem::unlink($dir . '/' . $file)
I'm not familiar enough with the owncloud source to determine which unlink it was using so that's as far as I got with my troubleshooting.
PVince81 commentedon May 28, 2015
When you say "fails", do you mean it throws an exception or does it just return false ?
Are you able to debug inside ?
Does it happen for newly created shares or only old ones, maybe from a former upgrade ?
mattrandallbecker commentedon May 28, 2015
It just returns false, I'm not able to debug unlink()
Also I had only been trying with old folders that existed before the upgrade from 7->8. It turns out file deletion works if I create a new folder, new file, then share the folder and delete.
The delete only fails if the folder existed before the upgrade, even if the file is new after the upgrade.
Screenshot of the working process

PVince81 commentedon May 28, 2015
Okay, that's an important clue.
If you had 7.0.2 at the time the shares were created, you might be having this issue: #13361
There is unfortunately no proper migration path to fix it, so you might want to simply unshare then reshare the folder.
mattrandallbecker commentedon May 28, 2015
Ok, I figured it out and after changing everything possible and the solution is a bit strange, likely a bug?
So even if I remove all groups for a user, remove all sharing for a folder, then re-add groups, and re-add sharing it still would not allow users to delete shared files.
It seems this was because all users have a quota set of 0. Once I increase the quota for a user to 1GB they are able to delete files out of the shared directories. This certainly was not the behavior in versions 6/7 as we have always maintained 0 quota for all employees and they work out of shared exclusively.
PVince81 commentedon May 28, 2015
Weird.
But you said for new folders it worked ? Or did you test new shares with users that did not have 0 as quota ?
PVince81 commentedon May 28, 2015
The quota issue sounds like #16187
mattrandallbecker commentedon May 28, 2015
Yes it's exactly that issue.
Pretty much 100% what we are experiencing.
PVince81 commentedon May 28, 2015
Ok thanks, closing as duplicate.
Please follow up in the linked ticket.