Page MenuHomePhabricator

PHP Notice: Trying to access array offset on value of type null (in TranslationUnitDTO)
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error
normalized_message
[{reqId}] {exception_url}   PHP Notice: Trying to access array offset on value of type null
exception.trace
from /srv/mediawiki/php-1.40.0-wmf.21/extensions/ContentTranslation/includes/DTO/TranslationUnitDTO.php(134)
#0 /srv/mediawiki/php-1.40.0-wmf.21/extensions/ContentTranslation/includes/DTO/TranslationUnitDTO.php(134): MWExceptionHandler::handleError(integer, string, string, integer, array)
#1 /srv/mediawiki/php-1.40.0-wmf.21/extensions/ContentTranslation/scripts/dump-corpora.php(146): ContentTranslation\DTO\TranslationUnitDTO->toCorporaDumpArray(boolean)
#2 [internal function]: CXCorporaDump::{closure}(ContentTranslation\DTO\TranslationUnitDTO)
#3 /srv/mediawiki/php-1.40.0-wmf.21/extensions/ContentTranslation/scripts/dump-corpora.php(147): array_map(Closure, array)
#4 /srv/mediawiki/php-1.40.0-wmf.21/maintenance/includes/MaintenanceRunner.php(585): CXCorporaDump->execute()
#5 /srv/mediawiki/php-1.40.0-wmf.21/maintenance/doMaintenance.php(99): MediaWiki\Maintenance\MaintenanceRunner->run()
#6 /srv/mediawiki/php-1.40.0-wmf.21/extensions/ContentTranslation/scripts/dump-corpora.php(316): require_once(string)
#7 /srv/mediawiki/multiversion/MWScript.php(118): require_once(string)
#8 {main}
Impact
Notes

These are currently happening on a very high rate (~2200 of these in the last 15 min) in snapshot1008.

Event Timeline

Krinkle renamed this task from PHP Notice: Trying to access array offset on value of type null to PHP Notice: Trying to access array offset on value of type null (in TranslationUnitDTO).Feb 15 2023, 12:12 AM

Still happening as of wmf.25

One such req from today: https://logstash.wikimedia.org/goto/056a3d0a8ca80fa3193257fd0837d74b

Added filter (accounting for TranslationUnitDTO) to MW new errors board.

Actually, the null access seems to now be happening in a different function call. New backtrace:

exception.trace
from /srv/mediawiki/php-1.40.0-wmf.24/extensions/ContentTranslation/includes/DTO/TranslationUnitDTO.php(109)
#0 /srv/mediawiki/php-1.40.0-wmf.24/extensions/ContentTranslation/includes/DTO/TranslationUnitDTO.php(109): MWExceptionHandler::handleError(integer, string, string, integer, array)
#1 /srv/mediawiki/php-1.40.0-wmf.24/extensions/ContentTranslation/includes/ActionApi/ApiQueryContentTranslationCorpora.php(46): ContentTranslation\DTO\TranslationUnitDTO->toCustomArray(array, boolean)
#2 [internal function]: ContentTranslation\ActionApi\ApiQueryContentTranslationCorpora::ContentTranslation\ActionApi\{closure}(ContentTranslation\DTO\TranslationUnitDTO)
#3 /srv/mediawiki/php-1.40.0-wmf.24/extensions/ContentTranslation/includes/ActionApi/ApiQueryContentTranslationCorpora.php(45): array_map(Closure, array)
#4 /srv/mediawiki/php-1.40.0-wmf.24/includes/api/ApiQuery.php(678): ContentTranslation\ActionApi\ApiQueryContentTranslationCorpora->execute()
#5 /srv/mediawiki/php-1.40.0-wmf.24/includes/api/ApiMain.php(1901): ApiQuery->execute()
#6 /srv/mediawiki/php-1.40.0-wmf.24/includes/api/ApiMain.php(878): ApiMain->executeAction()
#7 /srv/mediawiki/php-1.40.0-wmf.24/includes/api/ApiMain.php(849): ApiMain->executeActionWithErrorHandling()
#8 /srv/mediawiki/php-1.40.0-wmf.24/api.php(90): ApiMain->execute()
#9 /srv/mediawiki/php-1.40.0-wmf.24/api.php(45): wfApiMain()
#10 /srv/mediawiki/w/api.php(3): require(string)
#11 {main}

Change 901568 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/extensions/ContentTranslation@master] CX corpora dump: Filter out translation units without source

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

Change 901569 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/extensions/ContentTranslation@master] CX corpora query API: Handle null blob types for translation units

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

Change 901568 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] CX corpora dump: Filter out translation units without source

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

Change 901569 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] CX corpora query API: Handle null blob types for translation units

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

There is another one that generated 2M PHP Notices since 11h20 UTC this morning:

labels.normalized_message
[{reqId}] {exception_url}   PHP Notice: Trying to access array offset on value of type null
error.stack_trace
from /srv/mediawiki/php-1.41.0-wmf.3/extensions/ContentTranslation/includes/DTO/TranslationUnitDTO.php(153)
#0 /srv/mediawiki/php-1.41.0-wmf.3/extensions/ContentTranslation/includes/DTO/TranslationUnitDTO.php(153): MWExceptionHandler::handleError(integer, string, string, integer, array)
#1 /srv/mediawiki/php-1.41.0-wmf.3/extensions/ContentTranslation/scripts/dump-corpora.php(146): ContentTranslation\DTO\TranslationUnitDTO->toCorporaDumpArray(boolean)
#2 [internal function]: CXCorporaDump::{closure}(ContentTranslation\DTO\TranslationUnitDTO)
#3 /srv/mediawiki/php-1.41.0-wmf.3/extensions/ContentTranslation/scripts/dump-corpora.php(147): array_map(Closure, array)
#4 /srv/mediawiki/php-1.41.0-wmf.3/maintenance/includes/MaintenanceRunner.php(681): CXCorporaDump->execute()
#5 /srv/mediawiki/php-1.41.0-wmf.3/maintenance/run.php(51): MediaWiki\Maintenance\MaintenanceRunner->run()
#6 /srv/mediawiki/multiversion/MWScript.php(140): require_once(string)
#7 {main}

It is a systemd timer on snapshot1008:

NEXT                         LEFT           LAST                         PASSED        UNIT                                            ACTIVATES
n/a                          n/a            Fri 2023-04-07 09:10:00 UTC  4h 2min ago   xlation-dumps.timer                             xlation-dumps.service

The job is of course the content translation dumps, which run once a week. They call the maintenance script extensions/ContentTranslation/scripts/dump-corpora.php which I guess the Language Team knows the innards of.

@ArielGlenn @Zabe could there be any specific steps to reproduce this ?

Change 908484 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/extensions/ContentTranslation@master] CX corpora dump: Check if type exists before sanitizing

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

Completed content translation of an article and unable to reproduce the above said issue.

Marked as QA PASS

@EChukwukere-WMF This task cannot really be tested using the CX or SX application. We can only track the logstash and see if the errors disappear to verify that it is fixed, moving back to "Needs QA" to keep an eye on it for some time, until we stop getting those errors.

@ngkountas By logstash you mean the network tab in the browser correct ?

@EChukwukere-WMF Logstash is the tool we use to collect, track and manage the logs from production Wikis. You should be able to access it here: https://logstash.wikimedia.org

Change 908484 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] CX corpora dump: Check if type exists before sanitizing

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

Nikerabbit subscribed.

Last occurrence of this warning in Logstash was in May 5, 2023.