The Basics
- Nextcloud Server version (e.g., 29.x.x):
31.0.0
- Operating system and version (e.g., Ubuntu 24.04):
- `TrueNAS ElectricEel-24.10.2``
- Web server and version (e.g, Apache 2.4.25):
dunno
- Reverse proxy and version _(e.g. nginx 1.27.2)
???
- PHP version (e.g, 8.3):
8.3.17
- Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
TrueNAS app
- Are you using CloudfIare, mod_security, or similar? (Yes / No)
No(?)
Summary of the issue you are facing:
Attempting to use a deduping app (Czkawka) to delete dplicate files in NextCloud’s /var/www/html/data/<username>/files
folder fails with “Permission denied (os error 13)” error.
Steps to replicate it:
- run Czkawka on
/storage
(mapped to NextCloud’s/var/www/html/data/<username>/files
–see comment below) - select duplicate files to be deleted
- click the “Delete” button
- witness the error message: “Failed to delete file /storage/path/to/file/filename reason Permission denied (os error 13)”
Comments:
The NextCloud /var/www/html/data/<username>/files
folder is actually mapped to TrueNAS’ /mnt/NextCloud/data/<username>/files
folder, which, in turn, maps to Czkawka’s /storage
folder. Thus, in Czkawka, search happens in /storage
. As I was saying, search works fine, but deletion does not.
I thus examined who the owner of the /var/www/html/data/<username>/files
folder is:
root@nas1[/mnt/NextCloud/data/dad]# ls -latr
total 36
drwxr-xr-x 5 apps apps 11 Mar 7 16:53 files
drwxrwx--- 4 www-data www-data 8 Mar 7 16:59 ..
drwxr-xr-x 2 www-data www-data 2 Mar 7 17:06 cache
drwxr-xr-x 7 www-data www-data 7 Mar 7 19:03 .
drwxr-xr-x 5 www-data www-data 5 Mar 7 19:03 files_trashbin
drwxr-xr-x 3 www-data www-data 4 Mar 7 19:18 files_versions
drwxr-xr-x 32 www-data www-data 32 Mar 8 18:13 uploads
The question is, then, should I run Czkawka as this apps
user? Problem is, Czkawka cannot run as apps
. What to do?
Refer to TrueNAS forum topic for more details.