Skip to content
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

Permissions error on /var/www/html/tmp after pulling 3.8.1 #141

Closed
jakejarvis opened this issue Jan 29, 2019 · 8 comments
Closed

Permissions error on /var/www/html/tmp after pulling 3.8.1 #141

jakejarvis opened this issue Jan 29, 2019 · 8 comments
Labels

Comments

@jakejarvis
Copy link

jakejarvis commented Jan 29, 2019

After pulling 3.8.1 (upgrading from 3.7) I was greeted with this error about temp directories not able to be created. From what I can figure out from the entrypoint file the owner of /var/www/html is correctly being set to www-data so I'm not sure what's causing these new errors.

screen shot 2019-01-29 at 9 20 48 am

I was able to fix it bandaid-style by exec'ing the following after starting the container:

docker exec matomo_app /bin/bash -c "chmod a+w -R /var/www/html"

...but not sure of the security implications of giving global write access to the entire web interface (I assume minimal considering it's a container but you never know).

I tried only giving access to the ./tmp/cache directory but then I was met with a whole bunch of new errors about other folders and files not being writable:

screen shot 2019-01-29 at 9 33 35 am

Am I doing something wrong? Any ideas? Let me know if I should post my config.

Thanks guys!

@Azraeht
Copy link

Azraeht commented Jan 29, 2019

Exactly the same issue for me...

When I start from a fresh installation (no db, no config) everything goes well.

@J0WI
Copy link
Collaborator

J0WI commented Jan 29, 2019

Have you tried docker exec matomo_app /bin/bash -c "chown -R www-data:www-data /var/www/html" as suggested?

@jakejarvis
Copy link
Author

jakejarvis commented Jan 31, 2019

@J0WI that indeed works too and is admittedly much safer than the worldwide chmod I was doing!

But it still doesn't stick and needs to be run after every restart of the container – all the recent diffs in this repo look unrelated (besides maybe an odd difference in PHP 7.2?) so is there some change I'm not finding in the main Matomo code that would cause this?

In the meantime moving the existing chown line in the entrypoint.sh files out of the if statement has fixed the issue for me when building for my setup. Made a pull request at #142 but feel free to reject if there's a better way.

Thanks again :)

edit: if it helps, my personal docker-compose file is here but I don't think I'm doing anything out of the ordinary

@J0WI
Copy link
Collaborator

J0WI commented Jan 31, 2019

I cannot reproduce your issue. Did your change any permissions on your locally mapped files?

@jakejarvis
Copy link
Author

Nope, haven't changed anything. What about you @Azraeht ?

I cloned my entire configuration/database locally when testing the pull request and played with the permissions and got the same error (and moving the chown line in the entrypoint script worked). Same thing on the FPM variants. Very strange....

Is there anything I can send to you to help reproduce? I'm on the latest Docker 18.09.1 btw.

@J0WI
Copy link
Collaborator

J0WI commented Jan 31, 2019

This might be fixed in docker-library/php#787

@jakejarvis
Copy link
Author

@J0WI great find, thanks! I'll wait for the PHP update to work its way into the registry and report back.

Pulling Matomo again should automatically pull the latest PHP build without needing any changes here, right? Or do we need to rebuild the whole Matomo image and push that too? Not too familiar with how the official library works. Thanks again for the help :)

@J0WI
Copy link
Collaborator

J0WI commented Feb 1, 2019

Rebuilds are triggered automatically when the base image is updated :)

@J0WI J0WI added the upstream label Feb 1, 2019
@J0WI J0WI closed this as completed Feb 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants