Page MenuHomePhabricator

Failed to invoke Pygments: /usr/bin/env: python: No such file or directory
Open, Needs TriagePublic

Description

Seen on REL1_30 and REL1_29. Seems fine on REL1_31 and master

https://gerrit.wikimedia.org/r/440866
https://gerrit.wikimedia.org/r/440865

14:04:37 1) ParserIntegrationTest::testParse with data set "parserTests.txt: Default behaviour (inner is pre)" ('[details omitted]')
14:04:37 Failed to invoke Pygments: /usr/bin/env: python: No such file or directory
14:04:37  [Called from SyntaxHighlight::highlight in /workspace/src/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight.class.php at line 314]
14:04:37 
14:04:37 /workspace/src/includes/debug/MWDebug.php:309
14:04:37 /workspace/src/includes/debug/MWDebug.php:164
14:04:37 /workspace/src/includes/GlobalFunctions.php:1192
14:04:37 /workspace/src/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight.class.php:314
14:04:37 /workspace/src/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight.class.php:121
14:04:37 /workspace/src/includes/parser/Parser.php:3852
14:04:37 /workspace/src/includes/parser/Preprocessor_Hash.php:1145
14:04:37 /workspace/src/includes/parser/Parser.php:2921
14:04:37 /workspace/src/includes/parser/Parser.php:1277
14:04:37 /workspace/src/includes/parser/Parser.php:451
14:04:37 /workspace/src/tests/parser/ParserTestRunner.php:855
14:04:37 /workspace/src/tests/phpunit/includes/parser/ParserIntegrationTest.php:36
14:04:37 /workspace/src/maintenance/doMaintenance.php:92
14:04:37 
14:04:37 2) ParserIntegrationTest::testParse with data set "parserTests.txt: Custom attributes" ('[details omitted]')
14:04:37 Failed to invoke Pygments: /usr/bin/env: python: No such file or directory
14:04:37  [Called from SyntaxHighlight::highlight in /workspace/src/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight.class.php at line 314]
14:04:37 
14:04:37 /workspace/src/includes/debug/MWDebug.php:309
14:04:37 /workspace/src/includes/debug/MWDebug.php:164
14:04:37 /workspace/src/includes/GlobalFunctions.php:1192
14:04:37 /workspace/src/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight.class.php:314
14:04:37 /workspace/src/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight.class.php:121
14:04:37 /workspace/src/includes/parser/Parser.php:3852
14:04:37 /workspace/src/includes/parser/Preprocessor_Hash.php:1145
14:04:37 /workspace/src/includes/parser/Parser.php:2921
14:04:37 /workspace/src/includes/parser/Parser.php:1277
14:04:37 /workspace/src/includes/parser/Parser.php:451
14:04:37 /workspace/src/tests/parser/ParserTestRunner.php:855
14:04:37 /workspace/src/tests/phpunit/includes/parser/ParserIntegrationTest.php:36
14:04:37 /workspace/src/maintenance/doMaintenance.php:92
14:04:37 
14:04:37 3) ParserIntegrationTest::testParse with data set "parserTests.txt: Inline attribute (inline code)" ('[details omitted]')
14:04:37 Failed to invoke Pygments: /usr/bin/env: python: No such file or directory
14:04:37  [Called from SyntaxHighlight::highlight in /workspace/src/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight.class.php at line 314]
14:04:37 
14:04:37 /workspace/src/includes/debug/MWDebug.php:309
14:04:37 /workspace/src/includes/debug/MWDebug.php:164
14:04:37 /workspace/src/includes/GlobalFunctions.php:1192
14:04:37 /workspace/src/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight.class.php:314
14:04:37 /workspace/src/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight.class.php:121
14:04:37 /workspace/src/includes/parser/Parser.php:3852
14:04:37 /workspace/src/includes/parser/Preprocessor_Hash.php:1145
14:04:37 /workspace/src/includes/parser/Parser.php:2921
14:04:37 /workspace/src/includes/parser/Parser.php:1277
14:04:37 /workspace/src/includes/parser/Parser.php:451
14:04:37 /workspace/src/tests/parser/ParserTestRunner.php:855
14:04:37 /workspace/src/tests/phpunit/includes/parser/ParserIntegrationTest.php:36
14:04:37 /workspace/src/maintenance/doMaintenance.php:92
14:04:37 
14:04:37 4) ParserIntegrationTest::testParse with data set "parserTests.txt: Enclose none (inline code)" ('[details omitted]')
14:04:37 Failed to invoke Pygments: /usr/bin/env: python: No such file or directory
14:04:37  [Called from SyntaxHighlight::highlight in /workspace/src/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight.class.php at line 314]
14:04:37 
14:04:37 /workspace/src/includes/debug/MWDebug.php:309
14:04:37 /workspace/src/includes/debug/MWDebug.php:164
14:04:37 /workspace/src/includes/GlobalFunctions.php:1192
14:04:37 /workspace/src/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight.class.php:314
14:04:37 /workspace/src/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight.class.php:121
14:04:37 /workspace/src/includes/parser/Parser.php:3852
14:04:37 /workspace/src/includes/parser/Preprocessor_Hash.php:1145
14:04:37 /workspace/src/includes/parser/Parser.php:2921
14:04:37 /workspace/src/includes/parser/Parser.php:1277
14:04:37 /workspace/src/includes/parser/Parser.php:451
14:04:37 /workspace/src/tests/parser/ParserTestRunner.php:855
14:04:37 /workspace/src/tests/phpunit/includes/parser/ParserIntegrationTest.php:36
14:04:37 /workspace/src/maintenance/doMaintenance.php:92
14:04:37 
14:04:37 5) ParserIntegrationTest::testParse with data set "parserTests.txt: Enclose with nowiki" ('[details omitted]')
14:04:37 Failed to invoke Pygments: /usr/bin/env: python: No such file or directory
14:04:37  [Called from SyntaxHighlight::highlight in /workspace/src/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight.class.php at line 314]
14:04:37 
14:04:37 /workspace/src/includes/debug/MWDebug.php:309
14:04:37 /workspace/src/includes/debug/MWDebug.php:164
14:04:37 /workspace/src/includes/GlobalFunctions.php:1192
14:04:37 /workspace/src/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight.class.php:314
14:04:37 /workspace/src/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight.class.php:121
14:04:37 /workspace/src/includes/parser/Parser.php:3852
14:04:37 /workspace/src/includes/parser/CoreParserFunctions.php:1091
14:04:37 /workspace/src/includes/parser/Parser.php:3383
14:04:37 /workspace/src/includes/parser/Parser.php:3106
14:04:37 /workspace/src/includes/parser/Preprocessor_Hash.php:1071
14:04:37 /workspace/src/includes/parser/Parser.php:2921
14:04:37 /workspace/src/includes/parser/Parser.php:1277
14:04:37 /workspace/src/includes/parser/Parser.php:451
14:04:37 /workspace/src/tests/parser/ParserTestRunner.php:855
14:04:37 /workspace/src/tests/phpunit/includes/parser/ParserIntegrationTest.php:36
14:04:37 /workspace/src/maintenance/doMaintenance.php:92

Details

Related Gerrit Patches:
mediawiki/extensions/SyntaxHighlight_GeSHi : REL1_30Run Pygments using Python 3
mediawiki/extensions/SyntaxHighlight_GeSHi : REL1_29Run Pygments using Python 3

Event Timeline

Reedy created this task.Jun 18 2018, 2:07 PM
Restricted Application added subscribers: jeblad, Aklapper. · View Herald TranscriptJun 18 2018, 2:07 PM
Reedy updated the task description. (Show Details)Jun 18 2018, 2:10 PM

The Docker images for Quibble have the python3 which is a dependency of Quibble itself. There is no python2 package installed which would provide /usr/bin/python.

The images:

  • docker_image: docker-registry.wikimedia.org/releng/quibble-jessie-php55:0.0.18-1
  • docker_image: docker-registry.wikimedia.org/releng/quibble-stretch:0.0.18-1
  • docker_image: docker-registry.wikimedia.org/releng/quibble-jessie-hhvm:0.0.18-1

e50bce1036e61f28d8daef9751e729c2657542b1 has ported the script to python3 and it is available since REL1_31.

So potentially we can:

  • backport e50bce1036e61f28d8daef9751e729c2657542b1 to the release branches, which might be a bit of a breaking change since the extension would now requires python3 instead of 2.
  • add python2 to the Quibble images, though Syntaxhighlight_Geshi is most probably the only such case
  • just ignore the issue since it is fixed in REL1_31 and forward. For example by removing the parsertests in the old release branches.

Change 440873 had a related patch set uploaded (by Reedy; owner: Legoktm):
[mediawiki/extensions/SyntaxHighlight_GeSHi@REL1_29] Run Pygments using Python 3

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

Change 440874 had a related patch set uploaded (by Reedy; owner: Legoktm):
[mediawiki/extensions/SyntaxHighlight_GeSHi@REL1_30] Run Pygments using Python 3

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

Reedy added a comment.Jun 18 2018, 3:25 PM

Backports are above.

I don't really see any reason we can't require python3. It's not like it's new (9.5 years old by now?), and we don't explicitly define any requirements anywhere for it

Backports are above.
I don't really see any reason we can't require python3. It's not like it's new (9.5 years old by now?), and we don't explicitly define any requirements anywhere for it

It's a breaking change to an already released stable version of MediaWiki...

Reedy added a comment.Jun 19 2018, 8:52 PM

Backports are above.
I don't really see any reason we can't require python3. It's not like it's new (9.5 years old by now?), and we don't explicitly define any requirements anywhere for it

It's a breaking change to an already released stable version of MediaWiki...

I don't disagree, but it's not like we actually detail these dependancies anyway. You'd only know if you were to look at the python code... to know that

https://www.mediawiki.org/wiki/Extension:SyntaxHighlight makes no mention of a required python version

Neither does https://github.com/wikimedia/mediawiki-extensions-SyntaxHighlight_GeSHi/blob/master/README

Vvjjkkii renamed this task from Failed to invoke Pygments: /usr/bin/env: python: No such file or directory to eqaaaaaaaa.Jul 1 2018, 1:03 AM
Vvjjkkii triaged this task as High priority.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed subscribers: gerritbot, Aklapper.
CommunityTechBot renamed this task from eqaaaaaaaa to Failed to invoke Pygments: /usr/bin/env: python: No such file or directory.Jul 2 2018, 4:34 AM
CommunityTechBot raised the priority of this task from High to Needs Triage.
CommunityTechBot updated the task description. (Show Details)
CommunityTechBot added subscribers: gerritbot, Aklapper.

Change 440873 abandoned by Krinkle:
Run Pygments using Python 3

Reason:
Task T197669 was declined per T197669.

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

Change 440874 abandoned by Reedy:
Run Pygments using Python 3

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