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

Hide commands that don't work on windows #18603

Closed
brainfoolong opened this issue Jan 11, 2022 · 1 comment · Fixed by #18604
Closed

Hide commands that don't work on windows #18603

brainfoolong opened this issue Jan 11, 2022 · 1 comment · Fixed by #18604
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@brainfoolong
Copy link
Contributor

I've seen really strange error messages since a while in our Apache log which have no timestamp or what so ever.

  The system cannot find the path specified.
  The system cannot find the path specified.
  The system cannot find the path specified.
  The system cannot find the path specified.
  'groups' is not recognized as an internal or external command,
  operable program or batch file.

After checking every application i finally found the problem in Matomo (Current version).

The call stack from

public function newVersionAvailable()

which has a stack of
$view->makeWritableCommands = Filechecks::getAutoUpdateMakeWritableMessage();

public static function getAutoUpdateMakeWritableMessage()

$message .= "<br /><code>" . self::getCommandToChangeOwnerOfPiwikFiles() . "</code><br />";

public static function getCommandToChangeOwnerOfPiwikFiles()

public static function getUserAndGroup()

which at the end tries to execute a groups command on the host, which not exist on windows.
This fill up our apache error log with those error messages.
It is a glitch in the updater and a matomo dev, that knows that system, should patch that. I am not sure what is the best way to do this.

However, all calls to

public static function getUserAndGroup()

which executes this shell command are always pre-checked with a check of !SettingsServer::isWindows(), except in this case.

@brainfoolong brainfoolong added the Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. label Jan 11, 2022
@sgiehl
Copy link
Member

sgiehl commented Jan 11, 2022

Hi @brainfoolong
Thanks for your detailed bug report. Guess it makes sense to adjust the Filechecks::getAutoUpdateMakeWritableMessage method, so it only performs the methods that work on windows. I will have a quick look and check if I'm able to provide a simple fix for this.

@sgiehl sgiehl added Bug For errors / faults / flaws / inconsistencies etc. and removed Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. labels Jan 11, 2022
@justinvelluppillai justinvelluppillai changed the title Error when calling newVersionAvailable from CoreUpdater on Windows Hide commands that don't work on windows Feb 1, 2022
@justinvelluppillai justinvelluppillai added this to the 4.7.0 milestone Feb 1, 2022
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

Successfully merging a pull request may close this issue.

3 participants