Home Directory Writable Permissions When Accessing Files

The main error, as seen from the NextCloud web UI:

Internal Server Error

The server was unable to complete your request.

If this happens again, please send the technical details below to the server administrator.

More details can be found in the server log.
Technical details

    Remote Address: 127.0.0.1
    Request ID: aaabbbcccdddeee

Fedora 33 IoT
Podman, container/pod running as nextcloud. The command:

podman create --pod nextcloud_pod --name=nextcloud -e TZ=America/Toronto -v /var/opt/podstorage/nextcloud_pod/nextcloud/config:/config -v /var/mnt/nextcloud/ncdata:/data ghcr.io/linuxserver/nextcloud

This is what my subuid and subgid files look like:

caddy:100000:65536
jellyfin:200000:65536
nextcloud:300000:65536

abc ends up being user/group 300910 on the host side. nextcloud is 1001 on the host and 0 inside the container.

I’ve tried SELinux set to Permissive and Enforcing.

This was a migration from a native/non-container Debian install.

These are the permissions on the filesystem (I’ve messed with these a lot):

drwxrwx---.  6 300910 300910       69 Nov 23 20:59 0468089e-15ed-103a-8bae-2752a04e57b6
drwxrwx---.  4 300910 300910       32 Oct 10 15:08 1c3fdf46-15ed-103a-8bc0-2752a04e57b6
drwxrwx---.  4 300910 300910       32 Dec 11 23:06 51a5cb26-d075-103a-8e93-77b9873012e2
drwxrwx---.  2 300910 300910        6 Jun  4  2020 __groupfolders
drwxrwx---.  7 300910 300910       91 Jun  8  2020 aa0f78c4-0498-103a-9289-552a8a54f3e7
drwxrwx---.  4 300910 300910       32 Jun  4  2020 adminx.bak
drwxrwx---. 14 300910 300910      207 Dec 13 22:19 appdata_oceafdtkxsea
drwxrwx---.  2 300910 300910       43 Jan  9 15:50 dbbackups
drwxrwx---.  2 300910 300910       27 Jan 25 09:25 files_external
-rwxrwx---.  1 300910 300910        0 Jun  4  2020 index.html
-rwxrwx---.  1 300910 300910        0 Jun  4  2020 mntconf
-rwxrwx---.  1 300910 300910 47109366 Feb 25 21:03 nextcloud-sqlbkp_20210225.bak
-rwxrwx---.  1 300910 300910 47109366 Feb 27 16:32 nextcloud-sqlbkp_20210225.bak.2
-rwxrwx---.  1 300910 300910  3712889 Feb 18 09:46 nextcloud.log
-rwxrwx---.  1 300910 300910     2948 Jan  9 20:43 updater.log

I tried scanning the files:

[nextcloud@web2 ~]$ podman exec nextcloud occ files:scan --all
Starting scan for user 1 out of 8 (0468089e-15ed-103a-8bae-2752a04e57b6)
Home storage for user 0468089e-15ed-103a-8bae-2752a04e57b6 not writable
Make sure you're running the scan command only as the user the web server runs as
Starting scan for user 2 out of 8 (1c3fdf46-15ed-103a-8bc0-2752a04e57b6)
Home storage for user 1c3fdf46-15ed-103a-8bc0-2752a04e57b6 not writable
Make sure you're running the scan command only as the user the web server runs as
Starting scan for user 3 out of 8 (326f5d28-15ed-103a-8bd2-2752a04e57b6)
Starting scan for user 4 out of 8 (48cac210-15ed-103a-8be4-2752a04e57b6)
Starting scan for user 5 out of 8 (51a5cb26-d075-103a-8e93-77b9873012e2)
Home storage for user 51a5cb26-d075-103a-8e93-77b9873012e2 not writable
Make sure you're running the scan command only as the user the web server runs as
Starting scan for user 6 out of 8 (8148f154-25ef-103a-9e3c-a549a73fa0c8)
Starting scan for user 7 out of 8 (aa0f78c4-0498-103a-9289-552a8a54f3e7)
Home storage for user aa0f78c4-0498-103a-9289-552a8a54f3e7 not writable
Make sure you're running the scan command only as the user the web server runs as
Starting scan for user 8 out of 8 (adminx)
Home storage for user adminx not writable
Make sure you're running the scan command only as the user the web server runs as
+---------+-------+--------------+
| Folders | Files | Elapsed time |
+---------+-------+--------------+
| 6       | 0     | 00:00:00     |
+---------+-------+--------------+

This what the error looks like in nextcloud.log:

{"reqId":"5iyRuAxICnwgOvYrPzMx","level":3,"time":"2021-03-03T02:06:01+00:00","remoteAddr":"127.0.0.1","user":"adminx","app":"PHP","method":"GET","url":"/remote.php/webdav/Nextcloud%20Manual.pdf?downloadStartSecret=ivu5s7qc9bp","message":{"Exception":"Error","Message":"fopen(/config/www/nextcloud/data/adminx/files/Nextcloud Manual.pdf): failed to open stream: No such file or directory at /config/www/nextcloud/lib/private/Files/Storage/Local.php#357","Code":0,"Trace":[{"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::"},{"file":"/config/www/nextcloud/lib/private/Files/Storage/Local.php","line":357,"function":"fopen"},{"file":"/config/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php","line":302,"function":"fopen","class":"OC\\Files\\Storage\\Local","type":"->"},{"file":"/config/www/nextcloud/lib/private/Files/View.php","line":1166,"function":"fopen","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->"},{"file":"/config/www/nextcloud/lib/private/Files/View.php","line":1002,"function":"basicOperation","class":"OC\\Files\\View","type":"->"},{"file":"/config/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php","line":434,"function":"fopen","class":"OC\\Files\\View","type":"->"},{"file":"/config/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":85,"function":"get","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->"},{"file":"/config/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpGet","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/config/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/config/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/config/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/config/www/nextcloud/apps/dav/appinfo/v1/webdav.php","line":84,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/config/www/nextcloud/remote.php","line":167,"args":["/config/www/nextcloud/apps/dav/appinfo/v1/webdav.php"],"function":"require_once"}],"File":"/config/www/nextcloud/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:84.0) Gecko/20100101 Firefox/84.0","version":"21.0.0.18"}

Anyone have suggestions? I’ve been trying all day and it’s driving me nuts.

Does anyone have ideas at all?

No one runs podman nor do we test on it but you aren’t passing PUID/PGID so the container isn’t going to know what user to run as and what permissions it’s got.