Page MenuHomePhabricator

TemplateData: Fix "PHP Fatal error: Call to undefined function gzdecode"
Closed, ResolvedPublic

Description

[11-Sep-2013 11:01:59] Fatal error: Call to undefined function gzdecode() at /usr/local/apache/common-local/php-1.22wmf16/extensions/TemplateData/TemplateDataBlob.php on line 58
Server: mw1143
Method: GET
URL: http://commons.wikimedia.org/w/api.php?action=templatedata&titles=Template:Information&format=jsonfm
Backtrace:
#0 /usr/local/apache/common-local/php-1.22wmf16/extensions/TemplateData/TemplateDataBlob.php(58): TemplateDataBlob::newFromDatabase()
#1 /usr/local/apache/common-local/php-1.22wmf16/extensions/TemplateData/api/ApiTemplateData.php(83): TemplateDataBlob::newFromDatabase('???????????W???...')
#2 /usr/local/apache/common-local/php-1.22wmf16/includes/api/ApiMain.php(834): ApiTemplateData->execute()
#3 /usr/local/apache/common-local/php-1.22wmf16/includes/api/ApiMain.php(380): ApiMain->executeAction()
#4 /usr/local/apache/common-local/php-1.22wmf16/includes/api/ApiMain.php(351): ApiMain->executeActionWithErrorHandling()
#5 /usr/local/apache/common-local/php-1.22wmf16/api.php(73): ApiMain->execute()
#6 /usr/local/apache/common-local/w/api.php(3): require('/usr/local/apac...')

#7 {main}

[12-Sep-2013 03:06:23] Fatal error: Call to undefined function gzdecode() at /usr/local/apache/common-local/php-1.22wmf16/extensions/TemplateData/TemplateDataBlob.php on line 58
Server: mw1208
Method: GET
URL: http://pt.wikipedia.org/w/api.php?format=json&action=templatedata&titles=Predefini%C3%A7%C3%A3o%3Acitar_web
Backtrace:
#0 /usr/local/apache/common-local/php-1.22wmf16/extensions/TemplateData/TemplateDataBlob.php(58): TemplateDataBlob::newFromDatabase()
#1 /usr/local/apache/common-local/php-1.22wmf16/extensions/TemplateData/api/ApiTemplateData.php(83): TemplateDataBlob::newFromDatabase('???????????[???...')
#2 /usr/local/apache/common-local/php-1.22wmf16/includes/api/ApiMain.php(834): ApiTemplateData->execute()
#3 /usr/local/apache/common-local/php-1.22wmf16/includes/api/ApiMain.php(380): ApiMain->executeAction()
#4 /usr/local/apache/common-local/php-1.22wmf16/includes/api/ApiMain.php(351): ApiMain->executeActionWithErrorHandling()
#5 /usr/local/apache/common-local/php-1.22wmf16/api.php(73): ApiMain->execute()
#6 /usr/local/apache/common-local/w/api.php(3): require('/usr/local/apac...')
#7 {main}
[12-Sep-2013 03:14:50] Fatal error: Call to undefined function gzdecode() at /usr/local/apache/common-local/php-1.22wmf16/extensions/TemplateData/TemplateDataBlob.php on line 58
Server: mw1133
Method: GET
Backtrace:
#0 /usr/local/apache/common-local/php-1.22wmf16/extensions/TemplateData/TemplateDataBlob.php(58): TemplateDataBlob::newFromDatabase()
#1 /usr/local/apache/common-local/php-1.22wmf16/extensions/TemplateData/api/ApiTemplateData.php(83): TemplateDataBlob::newFromDatabase('???????????[???...')
#2 /usr/local/apache/common-local/php-1.22wmf16/includes/api/ApiMain.php(834): ApiTemplateData->execute()
#3 /usr/local/apache/common-local/php-1.22wmf16/includes/api/ApiMain.php(380): ApiMain->executeAction()
#4 /usr/local/apache/common-local/php-1.22wmf16/includes/api/ApiMain.php(351): ApiMain->executeActionWithErrorHandling()
#5 /usr/local/apache/common-local/php-1.22wmf16/api.php(73): ApiMain->execute()
#6 /usr/local/apache/common-local/w/api.php(3): require('/usr/local/apac...')
#7 {main}
[12-Sep-2013 03:16:37] Fatal error: Call to undefined function gzdecode() at /usr/local/apache/common-local/php-1.22wmf16/extensions/TemplateData/TemplateDataBlob.php on line 58
Server: mw1196
Method: GET
Backtrace:
#0 /usr/local/apache/common-local/php-1.22wmf16/extensions/TemplateData/TemplateDataBlob.php(58): TemplateDataBlob::newFromDatabase()
#1 /usr/local/apache/common-local/php-1.22wmf16/extensions/TemplateData/api/ApiTemplateData.php(83): TemplateDataBlob::newFromDatabase('???????????[???...')
#2 /usr/local/apache/common-local/php-1.22wmf16/includes/api/ApiMain.php(834): ApiTemplateData->execute()
#3 /usr/local/apache/common-local/php-1.22wmf16/includes/api/ApiMain.php(380): ApiMain->executeAction()
#4 /usr/local/apache/common-local/php-1.22wmf16/includes/api/ApiMain.php(351): ApiMain->executeActionWithErrorHandling()
#5 /usr/local/apache/common-local/php-1.22wmf16/api.php(73): ApiMain->execute()
#6 /usr/local/apache/common-local/w/api.php(3): require('/usr/local/apac...')
#7 {main}


Version: master
Severity: normal

Details

Reference
bz54058

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 2:11 AM
bzimport added a project: TemplateData.
bzimport set Reference to bz54058.

Wikimedia isn't running PHP 5.4

This is caused by https://gerrit.wikimedia.org/r/#/c/75330/ which uses gzdecode() that came with PHP 5.4.0.

Change 83981 had a related patch set uploaded by Reedy:
Add fallback for gzdecode (only exists >= 5.4.0)

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

Change 83981 merged by jenkins-bot:
Add fallback for gzdecode (only exists in PHP >= 5.4.0)

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

Change 83982 had a related patch set uploaded by Hashar:
test gzdecode() in TemplateDataBlob::newFromDatabase()

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

Change 83982 merged by jenkins-bot:
Test gzdecode() in TemplateDataBlob::newFromDatabase()

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

Whoops. Thanks.

Is jenkins running a different PHP than the cluster? Maybe that should be changed.

Nope

04:14:55 PHP 5.3.10-1ubuntu3.6+wmf1 is installed.

reedy@ubuntu64-web-esxi:~$ cat foobarlol.php
<?php

omfg();
reedy@ubuntu64-web-esxi:~$ php -l foobarlol.php
No syntax errors detected in foobarlol.php
reedy@ubuntu64-web-esxi:~$

  • Bug 54084 has been marked as a duplicate of this bug. ***

Commit 0e4339da86e03ce3af23fa8b8ab5661a86e9e730 fixes the bug by polyfilling gzdecode for PHP < 5.4

Commit 8dc157bc091ebb34911dfefd8bb4b483d2b7782d adds a test that would've failed on Jenkins without the polyfil. Jenkins runs PHP 5.3, but the tests were all passing because we weren't testing with a gzipped templatedata blob.

  • Bug 54084 has been marked as a duplicate of this bug. ***