-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nextcloud 28 alpine image - permission denied when post-installation hook is invoked #2217
Comments
Works for me. Is the execute bit set on the script? |
As for my knowledge, it is. It has 755 permissions. The error:
The relevant service definition in docker-compose.yaml:
What I could observe is that the owner of the setup.sh file is neither root nor www-data, but 1001. I don't know where 1001 comes from, because on the host it has the same owner then all the other shared/used file have. But doing an exec from the container I can see the followings:
Invoking the script directly by passing the full path:
The setup.sh script holds:
I don't know what I am missing. |
1001 is likely your host userid. The file created had 1001 but www-data of nextcloud (inside container) not 1001, hence permission denied. Fast fix set 777 or set ownership to www-data id of container(#id www-data) |
Already tried it, didn't help. I would like to avoid to setting 777, but if there is no other solution can help, this might be the one... |
I'm away from my desk at the moment, but I believe the id is 82 in the Alpine FPM images: So try |
I just noticed you're trying to
You seem to be executing (for testing) your in-container commands as root based on your prompt. Your script contains this:
That won't work. It's also unnecessary (if I understand your goal - since it'll already run as https://github.com/nextcloud/docker?tab=readme-ov-file#using-the-nextcloud-command-line-interface
So this isn't a bug in the image's hook support. If you get stuck still, I suggest popping over to the community help forum: https://help.nextcloud.com |
Hi everyone,
I wonder if any of us has faced with the issue "Permission denied" when a bash script should run from the post-installation hook directory using nextcloud:28.0.5-fpm-alpine image. I keep getting this error even if only an "echo" is in the bash script. If I try to execute the script from the docker container it is the same, so I assume something is around how alpine handles these bash scripts. But if I invoke the shell script with "/bin/sh changesettings.sh" (using the right path, of course) the script can run.
Any idea would be highly appreciated since now I am using some hacky-workaround.
The text was updated successfully, but these errors were encountered: