Directory not empty

I'm getting loads of these errors in my logs and I've no idea what they mean.

Steps to reproduce

Expected behaviour

Actual behaviour

Server configuration
Operating system: Ubuntu
Web server: Apache2
Database: MySQL
PHP version: 7
ownCloud version (see ownCloud admin page): 9.1.4
Updated from an older ownCloud or fresh install: Fresh install
Special configurations (external storage, external authentication, reverse proxy, server-side-encryption):
external storage

ownCloud log (data/owncloud.log)

rmdir(/mnt/hgfs/ [FILE PATH] ): Directory not empty at /var/www/owncloud/lib/private/Files/Storage/Local.php#109
unlink(/mnt/hgfs/ [FILE PATH] ): Operation not permitted at /var/www/owncloud/lib/private/Files/Storage/Local.php#105

Integrity status for oC9+

Login as admin user into your ownCloud and access
paste the results here.
No errors have been found.

You probably have a permission issue in /mnt/hgfs that your webserver can't delete anything there. If you delete files in your webinterface they are likely to come back because they weren't deleted on the file system. Can you confirm that (after deletion, create an empty textfile to trigger a rescan of the folder and the deleted file should re-appear)?

Ah ok, you are already having this problem:

Check your permissions:
sudo -u www-data ls -lisa /mnt/hgfs

Hi there,

I ran that command and I get the following. What does it mean?

total 10
1 5 dr-xr-xr-x 1 root root 4192 Apr 16 02:12 .
131074 4 drwxr-xr-x 3 root root 4096 Mar 5 05:40 ..
12 1 drwxrwx--- 1 501 80 544 Apr 13 08:10 RESownCloud


Your folder is only accessible by user with uid 501 or a user in group with gid 50.

I see, what should it be? Is there any way this can be fixed?


Yes, this can be fixed. Read into the manual of "mount" or in the manual of the filesystem you're using how to give the proper permission to the webserver user running ownCloud (mostly user www-data).

As this is nothing ownCloud specific you might also want to ask for support in a community dedicated to your used linux distro.

What should the permission be please? Or where can I find this information?

Also, sorry, I don't understand, what do you mean read the manual of 'mount'? Do you mean in the OC manual, search for 'mount'?

As already written previously this is nothing ownCloud specific. So "mount" is nothing what you need to look up in the ownCloud manual.

To sum up:

Your external storage / mountpoint needs to be read and writeable by the webserver user running ownCloud. How to achieve this heavily depends on your environment so we can't give you specific information about that.

Some hints for a search on your own on the net are:

Command man mount
linux permission mount
mount permissions