Page MenuHomePhabricator

Better error message than "Scap failed!: Call to mwscript eval.php returned: None"
Closed, ResolvedPublic

Description

While I'm glad stopped me deploying something that was broken... "Call to mwscript eval.php returned: None" isn't the most useful

reedy@deploy1001:/srv/mediawiki-staging$ scap sync-file wmf-config/extension-list collection
           ___ ____
         ⎛   ⎛ ,----
          \  //==--'
     _//|,.·//==--'    ____________________________
    _OO≣=-  ︶ ᴹw ⎞_§ ______  ___\ ___\ ,\__ \/ __ \
   (∞)_, )  (     |  ______/__  \/ /__ / /_/ / /_/ /
     ¨--¨|| |- (  / ______\____/ \___/ \__^_/  .__/
         ««_/  «_/ jgs/bd808                /_/

15:46:54 Checking for new runtime errors locally
15:46:54 Scap failed!: Call to mwscript eval.php returned: None
15:46:54 Unhandled error:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/scap/cli.py", line 342, in run
    exit_status = app.main(app.extra_arguments)
  File "/usr/lib/python2.7/dist-packages/scap/main.py", line 745, in main
    return super(SyncFile, self).main(*extra_args)
  File "/usr/lib/python2.7/dist-packages/scap/main.py", line 80, in main
    self._check_fatals()
  File "/usr/lib/python2.7/dist-packages/scap/main.py", line 217, in _check_fatals
    raise RuntimeError(errmsg.format('returned', exit_code))
RuntimeError: Scap failed!: Call to mwscript eval.php returned: None
15:46:54 sync-file failed: <RuntimeError> Scap failed!: Call to mwscript eval.php returned: None
reedy@deploy1001:/srv/mediawiki-staging$ mwscript eval.php enwiki
[Wed Jun  5 15:49:01 2019] [hphp] [7683:7f469eaac3c0:0:000001] [] 
Fatal error: Uncaught exception 'Exception' with message '/srv/mediawiki-staging/php-1.34.0-wmf.7/extensions/Collection/extension.json does not exist!' in /srv/mediawiki-staging/php-1.34.0-wmf.7/includes/registration/ExtensionRegistry.php:132
Stack trace:
#0 /srv/mediawiki-staging/php-1.34.0-wmf.7/includes/GlobalFunctions.php(52): ExtensionRegistry->queue()
#1 /srv/mediawiki-staging/wmf-config/CommonSettings.php(2034): wfLoadExtension()
#2 /srv/mediawiki-staging/php-1.34.0-wmf.7/LocalSettings.php(4): include()
#3 /srv/mediawiki-staging/php-1.34.0-wmf.7/includes/Setup.php(105): include()
#4 /srv/mediawiki-staging/php-1.34.0-wmf.7/maintenance/doMaintenance.php(83): include()
#5 /srv/mediawiki-staging/php-1.34.0-wmf.7/maintenance/commandLine.inc(77): include()
#6 /srv/mediawiki-staging/php-1.34.0-wmf.7/maintenance/eval.php(39): include()
#7 /srv/mediawiki-staging/multiversion/MWScript.php(101): include()
#8 {main}

Event Timeline

Same as T224634

I clearly remember struggling with that error and I was blaming scap.sh. T222372 is about removing that code entirely.

I am 100% sure we already had a task about the return code being None and the lack of stderr/stdout logging. But I must have been wrong. Anyway that is definitely an issue with Scap.

Aklapper added a subscriber: thcipriani.

@thcipriani: A good first task is a self-contained, non-controversial task with a clear approach and links to documentation and the codebase (see the project description). Given the current task description I'm removing the good first task tag.

Change 620791 had a related patch set uploaded (by Ahmon Dancy; owner: Ahmon Dancy):
[mediawiki/tools/scap@master] Improve mwscript error handling

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

Change 620791 merged by jenkins-bot:
[mediawiki/tools/scap@master] Improve mwscript error handling

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

Change 621560 had a related patch set uploaded (by Ahmon Dancy; owner: Ahmon Dancy):
[mediawiki/tools/scap@master] Improve mwscript error handling (followup)

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

Change 621560 merged by jenkins-bot:
[mediawiki/tools/scap@master] Improve mwscript error handling (followup)

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

Deployed via T261234. Closing