Page MenuHomePhabricator

Misleading error message "Mathoid cli /path/to/cli.js is not executable."
Closed, ResolvedPublic

Description

Reproducing:

  • follow the installation instructions in T188745 with default limits set (300M memory)
  • edit a wiki page and insert a <math>formula </math>
  • press "show preview"

Result:

  • Mathoid cli /path/to/cli.js is not executable. and no formula shown

Doing the same from CLI as the web server user worked:

sudo -H -u www-data bash -c 'php -r "echo exec(\"/path/to/mathoid/cli.js -c /path/to/mathoid/config.yaml\");"'

Expected:

  • Error message: Memory limit exhausted, please adjust $wgMaxShellMemory

$result->getExitCode() != 0 only indicates that something went wrong during execution.

Anytime, when execute mathoid/cli.js failed, only logging Mathoid cli mathoid/cli.js is not executable message (logging point). This will make operator messy, because the real reason is often not that the file is not executable, such as Nodejs throw an error or failed to execute shell command.

Logging error messages from STDERR at the same time would be better.

Event Timeline

Rillke created this task.Jul 1 2018, 1:16 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 1 2018, 1:16 PM
RP88 added a subscriber: RP88.Aug 6 2018, 12:25 AM
RazeSoldier triaged this task as Normal priority.Nov 20 2018, 10:23 AM

Change 474876 had a related patch set uploaded (by 星耀晨曦; owner: 星耀晨曦):
[mediawiki/extensions/Math@master] Also logging the STDERR message

https://gerrit.wikimedia.org/r/474876

Change 474876 merged by jenkins-bot:
[mediawiki/extensions/Math@master] Log STDERR from mathoids cli output

https://gerrit.wikimedia.org/r/474876

Change 475082 had a related patch set uploaded (by 星耀晨曦; owner: 星耀晨曦):
[mediawiki/extensions/Math@REL1_32] Log STDERR from mathoids cli output

https://gerrit.wikimedia.org/r/475082

RazeSoldier moved this task from Incoming to Doing on the Math board.Nov 22 2018, 10:35 AM

@RazeSoldier I got the impression that backporting changes is unusual. I think we have to wait for the 1.33 release. If you find someone to review your backport change I have no objections to it. I am not just knowledgeable enough myself to oversee the consequences.

RazeSoldier added a comment.EditedNov 29 2018, 1:36 PM

@RazeSoldier I got the impression that backporting changes is unusual. I think we have to wait for the 1.33 release. If you find someone to review your backport change I have no objections to it. I am not just knowledgeable enough myself to oversee the consequences.

IMO, MW 1.32 is not release now so we can backport any bug-fixed changes. If this is not the case, then I may have to abandon the backporting change.

RazeSoldier closed this task as Resolved.Jan 29 2019, 10:22 AM

1.32 already released. The reason for my backporting does not exist anymore.

Change 475082 abandoned by 星耀晨曦:
Log STDERR from mathoids cli output

Reason:
1.32 already released. The reason for my backporting does not exist anymore.

https://gerrit.wikimedia.org/r/475082