matomo-org / matomo

Empowering People Ethically with the leading open source alternative to Google Analytics that gives you full control over your data. Matomo lets you easily collect data from websites & apps and visualise this data and extract insights. Privacy is built-in. Liberating Web Analytics. Star us on Github? +1. And we love Pull Requests!
https://matomo.org/
GNU General Public License v3.0
19.72k stars 2.63k forks source link

Odd hint at the end of update progress #13993

Open fdellwing opened 5 years ago

fdellwing commented 5 years ago
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

Shouldn't that be chown -R 33:33 /var/www/piwik?

mattab commented 4 years ago

@fdellwing thanks for the report, something seems wrong here indeed. You can see the code at: https://github.com/matomo-org/matomo/blob/b16a791aa3650d85af829156129c2bd44c7cb075/plugins/CoreUpdater/Commands/Update.php#L372-L380

and at: https://github.com/matomo-org/matomo/blob/e4f54754ea3c4821d4a602a539e5efe6064067dc/core/Filechecks.php#L188-L193

Maybe the problem is that the console core:update was executed as root, when it should ideally be executed as the web server user (eg. www-data).

So maybe the proper solution to this issue is to update our documentation to run the core:update as the web server user?

fdellwing commented 4 years ago

Yes, you should run the updater as www-data User if possible, but if someone runs it as root, this message still is not allowed to be shown.

Maybe change the message in the case it is run by root (and the files are not owned by root) to something like:

It seems you are running this update with root priviledges, this is not recommended.

To make sure everything works afterwards run:

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

You can get more information about this <here>
Findus23 commented 4 years ago

See https://forum.matomo.org/t/core-update-file-user-warning/37166 for more details about it.

Ideally Matomo should suggest running the update as the php user, but it definitely should not suggest (as it currently does) changing the owner to root if the update was run as root.