@brainfoolong opened this Issue on January 11th 2022 Contributor

Another one :)

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

with the stack

and the stack

both result in commands executed on windows ps x and awk... that not exist on windows.

There are even more commands, that are all suppressed with @shell_exec that do not throw a Matomo error, but still log errors on the windows apache, because commands are tried to execute, which apache then logs as errors without useful information.

A general check for commands should be implemented, to check for windows or not. Some shell_exec are already pre-cechekd with isWindows checks, but not all.

More examples:

Maybe a fix for the whole canse of isSupportedWithReason could be, when on windows, just skip all other checks. As the isWindows check already return that is not possible on windows so further checks are useless, aren't they?

@tsteur commented on January 11th 2022 Member

Makes sense 👍 if isWindows() === true we want to return immediately and not perform any of the other checks. Thanks for reporting this @brainfoolong

As in

diff --git a/core/CliMulti/Process.php b/core/CliMulti/Process.php
index e3a6bd968d..6016f72918 100644
--- a/core/CliMulti/Process.php
+++ b/core/CliMulti/Process.php
@@ -215,6 +215,7 @@ class Process

         if (SettingsServer::isWindows()) {
             $reasons[] = 'not supported on windows';
+            return $reasons;

         if (self::isMethodDisabled('shell_exec')) {
This Issue was closed on January 18th 2022
Powered by GitHub Issue Mirror