Page MenuHomePhabricator

Fix WikibaseLexeme UnsupportedObjectExceptions in Wikibase CI builds
Closed, ResolvedPublic

Description

The quibble-vendor-mysql-php72-noselenium-docker job currently produces some MediaWiki errors when run for Wikibase:

2020-04-09 15:50:12 d6590ce0293f wikidb-unittest_: [af39f22aabeec81d24dc8904] [no req] Serializers\Exceptions\UnsupportedObjectException from line 109 of /workspace/src/extensions/WikibaseLexeme/src/Serialization/StorageLexemeSerializer.php: Can not serialize incomplete Lexeme
2020-04-09 15:50:12 d6590ce0293f wikidb-unittest_: [af39f22aabeec81d24dc8904] [no req] Serializers\Exceptions\UnsupportedObjectException from line 109 of /workspace/src/extensions/WikibaseLexeme/src/Serialization/StorageLexemeSerializer.php: Can not serialize incomplete Lexeme
2020-04-09 15:50:13 d6590ce0293f wikidb-unittest_: [af39f22aabeec81d24dc8904] [no req] Serializers\Exceptions\UnsupportedObjectException from line 109 of /workspace/src/extensions/WikibaseLexeme/src/Serialization/StorageLexemeSerializer.php: Can not serialize incomplete Lexeme

Details can be found in the full mw-error.log. That file is supposed to be empty, and the build is supposed to fail if it isn’t (T246358) – but before that can happen, we need to ensure Wikibase CI builds don’t produce MediaWiki server errors.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 9 2020, 4:13 PM
Tarrow added a subscriber: Tarrow.May 28 2020, 8:16 AM
Addshore triaged this task as High priority.May 28 2020, 8:48 AM
Addshore added a subscriber: Addshore.

Marking as high to reflect the parent / blocked ticket

If these tests aren't important, could they be temporarily disabled?

Change 605818 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseLexeme@master] Disable exception logger for a test

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

I looked into this a bit. I can reproduce the error (by putting an echo or similar in StorageLexemeSerializer where the exception is thrown) when AbuseFilter is also installed. The execution happens roughly like this:

  • the WikibaseLexeme test asks the Wikibase API to save an incomplete Lexeme
  • the Wikibase API creates the Content and runs the EditFilterMergedContent hook
  • AbuseFilter gets the text of that Content
  • WikibaseLexeme throws an error when trying to serialize the incomplete Lexeme (language and/or lexical category missing)
  • (fuzzy)
  • the API returns an error
  • the WikibaseLexeme test asserts that the error looks as expected

The exception thrown by StorageLexemeSerializer is caught and logged in Wikibase’s EntityContentDataCodec::encodeEntity(), but I haven’t yet been able to figure out what’s supposed to happen instead – since it seems that at some point, this test was able to complete without emitting anything to mw-error.log.

That said, the above change seems to fix the issue by completely disabling the “exception” log channel – in the artifacts for that build, I no longer see an mw-error.log file. This might not be the best solution (after all, Wikibase also has tests for EditEntity behavior with bad lexemes, and those tests don’t seem to disable any log channel), but it should be good enough to unblock the parent task, and better than disabling the tests.

Change 605818 merged by jenkins-bot:
[mediawiki/extensions/WikibaseLexeme@master] Disable exception logger for a test

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

Lucas_Werkmeister_WMDE closed this task as Resolved.Jun 17 2020, 9:36 AM

mw-error.log seems to be gone in the gate-and-submit builds for that change.