Page MenuHomePhabricator

PHP error: Undefined index: 6::ofield and 7::nfield (from DeleteLogFormatter.php)
Closed, ResolvedPublic

Description

Error

Request URL: POST /w/api.php action=query list=logevents lelimit=5000
Request ID: XPMRpQpAAE4AACaxoW0AAABW

message
ErrorException from line 273 of /srv/mediawiki/php-1.34.0-wmf.7/includes/logging/DeleteLogFormatter.php:
PHP Notice: Undefined index: 6::ofield

ErrorException from line 274 of /srv/mediawiki/php-1.34.0-wmf.7/includes/logging/DeleteLogFormatter.php:
PHP Notice: Undefined index: 7::nfield
trace
#0 /srv/mediawiki/php-1.34.0-wmf.7/includes/logging/DeleteLogFormatter.php(274): MWExceptionHandler::handleError(integer, string, string, integer, array, array)
#1 /srv/mediawiki/php-1.34.0-wmf.7/includes/logging/LogFormatter.php(817): DeleteLogFormatter->getParametersForApi()
#2 /srv/mediawiki/php-1.34.0-wmf.7/includes/logging/DeleteLogFormatter.php(307): LogFormatter->formatParametersForApi()
#3 /srv/mediawiki/php-1.34.0-wmf.7/includes/api/ApiQueryLogEvents.php(300): DeleteLogFormatter->formatParametersForApi()
#4 /srv/mediawiki/php-1.34.0-wmf.7/includes/api/ApiQueryLogEvents.php(260): ApiQueryLogEvents->extractRowInfo(stdClass)
#5 /srv/mediawiki/php-1.34.0-wmf.7/includes/api/ApiQuery.php(249): ApiQueryLogEvents->execute()
#6 /srv/mediawiki/php-1.34.0-wmf.7/includes/api/ApiMain.php(1595): ApiQuery->execute()
#7 /srv/mediawiki/php-1.34.0-wmf.7/includes/api/ApiMain.php(531): ApiMain->executeAction()
#8 /srv/mediawiki/php-1.34.0-wmf.7/includes/api/ApiMain.php(502): ApiMain->executeActionWithErrorHandling()
#9 /srv/mediawiki/php-1.34.0-wmf.7/api.php(87): ApiMain->execute()
#10 /srv/mediawiki/w/api.php(3): include(string)
#11 {main}

Impact

Unknown.

Notes

There are multiple ways to trigger it, involving at least three different deletion events. Here is one of them:

https://en.wikipedia.org/w/api.php?action=query&list=logevents&lelimit=1&lecontinue=20090505183444|22203402&leuser=Thatcher

"params": {
  "type": "oldid",
  "ids": [
    "233156789" 
  ],
  "old": {
    "bitmask": 0
  },
  "new": {
    "bitmask": 0
  }
},
"type": "delete",
"action": "revision",
"timestamp": "2009-05-05T18:34:44Z",

Event Timeline

Krinkle created this task.Jun 2 2019, 12:38 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJun 2 2019, 12:38 AM

Since since at least 1.34-wmf.3. Unknown at this point whether it is caused by a (recent) regression in rendering layer assumptions, or whether it has existed for longer but triggered for a few weeks and then pops up again etc.

Anomie added a subscriber: Anomie.

The logging row in question is

wikiadmin@10.64.16.101(enwiki)> select * from logging where log_id='22203402';
+----------+----------+------------+----------------+----------+---------------+--------------+-------------+----------------+-----------------+-------------+---------------+-----------+----------+
| log_id   | log_type | log_action | log_timestamp  | log_user | log_namespace | log_title    | log_comment | log_comment_id | log_params      | log_deleted | log_user_text | log_actor | log_page |
+----------+----------+------------+----------------+----------+---------------+--------------+-------------+----------------+-----------------+-------------+---------------+-----------+----------+
| 22203402 | delete   | revision   | 20090505183444 |   903149 |             0 | Coal_torpedo |             |      268172859 | oldid
233156789 |           0 |               |    862888 |     NULL |
+----------+----------+------------+----------------+----------+---------------+--------------+-------------+----------------+-----------------+-------------+---------------+-----------+----------+

Looks like it has existed since rMW61233fc84724: API: Move parameter formatting into LogFormatter, the code didn't take into account the possibility that the fields would be missing.

Change 514364 had a related patch set uploaded (by Anomie; owner: Anomie):
[mediawiki/core@master] DeleteLogFormatter: Handle missing ofield/nfield

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

Change 514364 merged by jenkins-bot:
[mediawiki/core@master] DeleteLogFormatter: Handle missing ofield/nfield

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

Anomie closed this task as Resolved.Jun 13 2019, 1:23 PM
Anomie claimed this task.
mmodell changed the subtype of this task from "Task" to "Production Error".Wed, Aug 28, 11:06 PM