Last modified: 2014-07-03 20:46:53 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T45086, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 43086 - Report more information about php warnings
Report more information about php warnings
Status: NEW
Product: Wikimedia
Classification: Unclassified
General/Unknown (Other open bugs)
unspecified
All All
: High enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
: platformeng
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-12-13 18:41 UTC by Sam Reed (reedy)
Modified: 2014-07-03 20:46 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Sam Reed (reedy) 2012-12-13 18:41:43 UTC
Although we get PHP warnings in the apache syslogs, we don't really get much information about it:

Dec 13 18:30:43 10.0.11.48 apache2[9987]: PHP Warning:  preg_match() expects parameter 2 to be string, array given in /usr/local/apache/common-local/php-1.21wmf6/extensions/FundraiserLandingPage/FundraiserLandingPage.php on line 96
Dec 13 18:30:43 10.0.2.198 apache2[24462]: PHP Warning:  preg_match() expects parameter 2 to be string, array given in /usr/local/apache/common-local/php-1.21wmf6/extensions/FundraiserLandingPage/FundraiserLandingPage.php on line 96


We could do with recording more information (to a different log file on fluorine), like we do for both the fatal log and the exception logs
Comment 1 Sam Reed (reedy) 2013-11-11 16:59:40 UTC
PHPUnit dumps warnings to the console...

Warning: Invalid argument supplied for foreach() in /var/www/wiki/mediawiki/core/includes/objectcache/SqlBagOStuff.php on line 232

Call Stack:
    0.0009     245936   1. {main}() /var/www/wiki/mediawiki/core/tests/phpunit/phpunit.php:0
    2.0765   14629624   2. MediaWikiPHPUnitCommand::main() /var/www/wiki/mediawiki/core/tests/phpunit/phpunit.php:119
    2.0767   14641960   3. MediaWikiPHPUnitCommand->run() /var/www/wiki/mediawiki/core/tests/phpunit/MediaWikiPHPUnitCommand.php:64
    2.0767   14642440   4. PHPUnit_TextUI_Command->run() /var/www/wiki/mediawiki/core/tests/phpunit/MediaWikiPHPUnitCommand.php:80
    7.3004   87363544   5. PHPUnit_TextUI_TestRunner->doRun() /usr/share/php/PHPUnit/TextUI/Command.php:176
    7.3094   87684904   6. PHPUnit_Framework_TestSuite->run() /usr/share/php/PHPUnit/TextUI/TestRunner.php:349
    7.4141   87686664   7. PHPUnit_Framework_TestSuite->run() /usr/share/php/PHPUnit/Framework/TestSuite.php:705
   22.3535  178137936   8. PHPUnit_Framework_TestSuite->run() /usr/share/php/PHPUnit/Framework/TestSuite.php:705
   22.3537  178139472   9. PHPUnit_Framework_TestSuite->runTest() /usr/share/php/PHPUnit/Framework/TestSuite.php:745
   22.3537  178139952  10. MediaWikiTestCase->run() /usr/share/php/PHPUnit/Framework/TestSuite.php:775
   22.3586  178141408  11. ApiQueryContinueTest->addDBData() /var/www/wiki/mediawiki/core/tests/phpunit/MediaWikiTestCase.php:109
   23.4059  178284240  12. ApiTestCase->editPage() /var/www/wiki/mediawiki/core/tests/phpunit/includes/api/query/ApiQueryContinueTest.php:47
   23.4063  178285904  13. WikiPage->doEditContent() /var/www/wiki/mediawiki/core/tests/phpunit/includes/api/ApiTestCase.php:56
   23.5032  178306552  14. Title->getUserPermissionsErrors() /var/www/wiki/mediawiki/core/includes/WikiPage.php:1904
   23.5032  178306736  15. Title->getUserPermissionsErrorsInternal() /var/www/wiki/mediawiki/core/includes/Title.php:1820
   23.5140  178309936  16. Title->checkPermissionHooks() /var/www/wiki/mediawiki/core/includes/Title.php:2338
   23.5142  178310696  17. wfRunHooks() /var/www/wiki/mediawiki/core/includes/Title.php:1946
   23.5142  178310696  18. Hooks::run() /var/www/wiki/mediawiki/core/includes/GlobalFunctions.php:4032
   23.5167  178312136  19. call_user_func_array() /var/www/wiki/mediawiki/core/includes/Hooks.php:199
   23.5167  178312848  20. PageTranslationHooks::lockedPagesCheck() /var/www/wiki/mediawiki/core/includes/Hooks.php:199
   23.5168  178312984  21. SqlBagOStuff->get() /var/www/wiki/mediawiki/extensions/Translate/tag/PageTranslationHooks.php:777
   23.5168  178313336  22. SqlBagOStuff->getMulti() /var/www/wiki/mediawiki/core/includes/objectcache/SqlBagOStuff.php:200
Comment 2 Sam Reed (reedy) 2013-11-11 17:48:31 UTC
The above might be from xdebug..
Comment 3 Bryan Davis 2014-07-03 20:46:53 UTC
Grabbing stack traces for warnings should be possible with a custom error handler and debug_backtrace() or ErrorException. It should probably be put behind a feature flag of some sort so that deployments that don't care about tracking warnings don't incur the performance penalty of generating the backtrace.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links