Page MenuHomePhabricator

Undefined property stdClass::$name in VisualEditorDataModule
Closed, ResolvedPublic1 Story Points

Description

Spotted in production:

Notice: Undefined property: stdClass::$name in /srv/mediawiki/php-1.27.0-wmf.8/extensions/VisualEditor/VisualEditorDataModule.php on line 109

Event Timeline

demon created this task.Dec 17 2015, 4:21 PM
demon updated the task description. (Show Details)
demon raised the priority of this task from to Normal.
demon added a subscriber: demon.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptDec 17 2015, 4:21 PM

We need to know which wiki this is coming from.

I made a custom mwgrep to list all of the wikis which have a MediaWiki:visualeditor-cite-tool-definition.json page. I then checked through them manually and only https://fo.wikipedia.org/wiki/MediaWiki:Visualeditor-cite-tool-definition.json looks like it will cause this error.

demon added a comment.Dec 17 2015, 4:44 PM

Wiki is not...logged? Here's the full JSON from a sample entry:

{
  "_index": "logstash-2015.12.17",
  "_type": "hhvm",
  "_id": "AVGwwgp3lAIL90ZzPjWT",
  "_score": null,
  "_source": {
    "message": "Notice: Undefined property: stdClass::$name in /srv/mediawiki/php-1.27.0-wmf.8/extensions/VisualEditor/VisualEditorDataModule.php on line 109",
    "@version": "1",
    "@timestamp": "2015-12-17T16:24:44.000Z",
    "type": "hhvm",
    "host": "mw1248",
    "priority": 11,
    "timestamp": "Dec 17 16:24:44",
    "logsource": "mw1248",
    "program": "hhvm",
    "severity": 3,
    "facility": 1,
    "facility_label": "user-level",
    "severity_label": "Error",
    "level": "NOTICE",
    "tags": [
      "syslog",
      "es",
      "normalized_message_untrimmed"
    ],
    "normalized_message": "Notice: Undefined property: stdClass::$name in /srv/mediawiki/php-1.27.0-wmf.8/extensions/VisualEditor/VisualEditorDataModule.php on line 109"
  },
  "sort": [
    1450369484000
  ]
}

And the first error in the log is just two minutes after that was created. I'll make a patch to have VE ignore such invalid definitions and fix the keys in that message.

demon added a comment.Dec 17 2015, 4:46 PM

That makes sense. Thanks!

Change 259738 had a related patch set uploaded (by Alex Monk):
Avoid checking non-set keys in user-defined data

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

Krenair claimed this task.Dec 17 2015, 4:49 PM

So the errors should have stopped, but leaving this open until the patch is merged.

demon added a comment.Dec 17 2015, 5:01 PM

Can confirm errors have stopped. Thanks for quickly figuring this out :)

Change 259738 merged by jenkins-bot:
Avoid checking non-set keys in user-defined data

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

Krenair closed this task as Resolved.Dec 19 2015, 3:38 AM
Jdforrester-WMF set Security to None.
Jdforrester-WMF edited a custom field.