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

Odd hint at the end of update progress #13993

Open
fdellwing opened this issue Jan 22, 2019 · 3 comments
Open

Odd hint at the end of update progress #13993

fdellwing opened this issue Jan 22, 2019 · 3 comments
Labels
Bug For errors / faults / flaws / inconsistencies etc.

Comments

@fdellwing
Copy link
Contributor

fdellwing commented Jan 22, 2019

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
Copy link
Member

mattab commented Jan 21, 2020

@fdellwing thanks for the report, something seems wrong here indeed. You can see the code at:

}
$output->writeln(
sprintf("<comment>%s</comment>", Piwik::translate('CoreUpdater_ConsoleUpdateUnexpectedUserWarning', [
$processUserAndGroup,
$fileOwnerUserAndGroup,
Filechecks::getCommandToChangeOwnerOfPiwikFiles()
]))
);
}

and at:

matomo/core/Filechecks.php

Lines 188 to 193 in e4f5475

*/
public static function getCommandToChangeOwnerOfPiwikFiles()
{
$realpath = Filesystem::realpath(PIWIK_INCLUDE_PATH . '/');
return "chown -R " . self::getUserAndGroup() . " " . $realpath;
}

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
Copy link
Contributor Author

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 Findus23 added the Bug For errors / faults / flaws / inconsistencies etc. label May 4, 2020
@Findus23
Copy link
Member

Findus23 commented May 4, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

No branches or pull requests

4 participants