@e7o-de opened this Issue on February 5th 2022

Did an update via console core:update. Was doing it as root, as ... yeah, bash of www-data isn't that functional :) Anyway, got that message at the end:

It appears you have executed this update with user root:root, while your Matomo files are owned by www-data:www-data. 

To ensure that the Matomo files are readable by the correct user, you may need to run the following command (or a similar command depending on your server configuration):

$ chown -R root:root /var/www/piwik/piwik

Of course, I just copied and executed that command, as it looked ok. Then I figured out, that Matomo doesn't want to run anymore, so I did a chown with www-data:www-data.

I suggest to think about that hint. Not entirely sure wether it's more likely that the files are usually owned by the correct user and it should be assumed that this is correct or there should be a simple check like "something will break with root ownership for sure".

@tsteur commented on February 7th 2022 Member

Thanks for mentioning this @e7o-de

It will also fix https://github.com/matomo-org/matomo/issues/17862 and will close that issue as a duplicate.

I think in this example we could adjust the wording and mention that the command may be executed using the wrong user and not only suggest the chown command to prevent such cases. If the user is root we could also mention specifically that this is likely executed with wrong user.

@justinvelluppillai commented on February 28th 2022 Contributor

Possibly we could also prompt user at the start if they aren't using the same user as the files are owned with to make sure they want to continue.

Powered by GitHub Issue Mirror