Nextcloud fpm docker cron ownership issue

I have used fstab to mount my ntfs drive with ownership www-data, and my nextcloud container has volume in the same ntfs drive.

However, after I setup my cron container for nextcloud, I found it keeps producing this error:

Console has to be executed with the user that owns the file config/config.php
Current user id: 82
Owner id of config.php: 33

The weirdest thing is that if I execute the following command, I would get the same error:

docker exec -u www-data nextcloud php /var/www/html/cron.php

If I replace www-data with 33 as the following, I will not get the same error:

docker exec -u 33 nextcloud php /var/www/html/cron.php

I have checked that www-data is uid=33, gid=33, groups=33, but why it’s not the same?

BTW, I checked id 82, but there is no user with id 82…

Is your cron container running the same image as your nextcloud container? It sounds like maybe one is the -alpine image and other not maybe? (You want them to be the same image).

The alpine images use 82/www-data. The debian images use 33/www-data.

Oh no…I do have both container using fpm-apline image, but I didn’t know fpm-alpine is for alpine linux. Does that mean raspbian cannot use it?
Or is it because I had nextcloud docker setup before and the user id for www-data was 33, now if i switched to fpm-alpine it won’t work out very well? (I’m using fstab to automount my ntfs with owner www-data, which is currently 33)

(Right now I have everything in fpm-apline, which makes me wonder how the world it works in my raspbian…)

Alpine is what runs in the Docker container. Your underlying host’s OS isn’t relevant (for the most part). e.g. docs/php/README.md at master · docker-library/docs · GitHub

Or is it because I had nextcloud docker setup before and the user id for www-data was 33, now if i switched to fpm-alpine it won’t work out very well? (I’m using fstab to automount my ntfs with owner www-data, which is currently 33)

Yes, the UID changes: https://github.com/nextcloud/docker/issues/601

Do you know if there a way I can make www-data in the fpm-apline version of nextcloud container to use id 33 instead of 82?

I saw there was a git issue but it seems to be shut down quickly by the “user” option in docker compose file. After trying that “user: 33:33” in my docker compose file for all nextcloud related containers, I found this option didn’t work out well for me. I started seeing some permission error in my nextcloud docker, not too sure what’s going on there.

Another method I tried was using the command: docker exec nextcloud chown -R www-data:root /var/www (nextcloud is my nextcloud container name), but that didn’t work out either.

Right now I guess I’ll have to change my www-data on host to 82 instead of 33, and then automount my ntfs drive to 82

Wonder if there is a better way.

Thanks…

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.