matomo-org/docker

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

jakejarvis opened this issue · 8 comments

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!

Exactly the same issue for me...

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

J0WI commented

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

@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 commented

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

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 commented

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

@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 commented

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