Page MenuHomePhabricator

"Invalid revision ID -1" error for VisualEditorFeatureUse events, mostly from officewiki
Closed, ResolvedPublic

Description

I was searching the errors logs for "DiscussionTools" today (to watch for errors from the maint. script in T315510) and I noticed these errors (completely unrelated to that):

https://logstash.wikimedia.org/goto/02e74c1a49cf73e89e7e64f9b88f2418

image.png (546×2 px, 61 KB)

Very pronounced weekday-weekend pattern… yep, looks like about 99% of the errors are from officewiki ;) (and the other 1% from various other private and closed wikis).

This is probably some unimportant mistake in the configuration for special wikis and not worth worrying about. I couldn't figure out quickly where the -1 is coming from; I don't think it's from our code.

Event Timeline

Adding Data-Engineering in the hope that someone there might know the cause of this problem. It's making it more difficult to spot real errors in the logs.

I had a look at this today, as I was also looking into T334157.

First of all, note that "revision ID" in the error message doesn't refer to a revision of a MediaWiki page (as I first assumed), but to a revision of the schema. The error is generated here: https://gerrit.wikimedia.org/g/mediawiki/extensions/EventLogging/+/901a47a72cbfe1edf5f92d77bb295c4ee1e830c0/devserver/eventlogging/schema.py#91

The error rate has dropped significantly after T332438.

image.png (533×2 px, 62 KB)

All of the errors in the last few days are in events for features that are logged server-side in WikiEditor ("source-has-js", "preview-nonlive").

The value of -1 is hardcoded here, with a comment that says it is "overridden by the EventLoggingSchemas extension attribute in WikimediaEvents/extension.json": https://gerrit.wikimedia.org/g/mediawiki/extensions/WikiEditor/+/7eae49ae094dac46d82320dbbbb50f05f4f542e6/includes/Hooks.php#221

The override is here: https://gerrit.wikimedia.org/g/mediawiki/extensions/WikimediaEvents/+/42fa4449217f7f355668ae5cc8988040eef05485/extension.json#78

But WikimediaEvents is not actually enabled on officewiki and other private wikis, so it does not get overridden: https://gerrit.wikimedia.org/g/operations/mediawiki-config/+/77f1c207a12e12c03623593c0be8cd618583b6ec/wmf-config/InitialiseSettings.php#8339

So the cause is that we were trying to log these events even though we were not supposed to. This also explains why T332438 lowered the error rate – the logging code was moved to WikimediaEvents, so it was no longer being loaded.

Change 906647 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/WikiEditor@master] Skip server-side event logging unless WikimediaEvents is installed

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

Change 906647 merged by jenkins-bot:

[mediawiki/extensions/WikiEditor@master] Skip server-side event logging unless WikimediaEvents is installed

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