Page MenuHomePhabricator

wikibase-InjectRCRecords should not die with CannotCreateActorException because of missing CentralIdLookup in simple Wikibase wiki
Closed, ResolvedPublic

Description

On a wiki with Wikibase and mostly default settings that is both repo and client and uses the data of some of its own entities of some of its wiki pages, the wikibase-InjectRCRecords scheduled by the new Change Dispatching system fail with a CannotCreateActorException due to CentralIdLookup not being configured, if the respective changes to the entities were done by a logged-in user.

This problem has several negative consequences:

  • these failed wikibase-InjectRCRecords jobs are accumulating in the job table
  • the people watching the pages without watching the Items/Entities those are subscribed to, might miss changes to those Items/Entities

Acceptance criteria:

  • for simple wikis that are a both Wikibase repo and client to themselves, wikibase-InjectRCRecords will inject recent changes correctly even for users that are logged-in (with the correct attribution to that user)
NOTE: This does not affect Wikimedia production!

Event Timeline

Locally, I don’t get this error, and the reason seems to be that RecentChangesFactory detects that the user couldn’t be found, and asks the ExternalUserNames service to prefix it; ExternalUserNames then produces an rc_user_text string like repowiki>User name, and the > marks the name as not “usable”, so the ActorStore doesn’t complain. Apparently, sometimes (e.g. on @Michael’s local wiki), some part of this doesn’t happen, so that the rc_user_text is just the user name on the repo wiki, which is a “usable” name, and the ActorStore refuses to assign an actor ID to a name that’s usable but not registered (after all, such a user could register later!).

CannotCreateActorException: Cannot create an actor for a usable name that is not an existing user

Change 732937 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@master] Document requirement on item and property source

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

Change 732938 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@master] Warn before returning null in ExternalUserNames wiring

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

Change 732940 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@master] Catch CannotCreateActorException in InjectRCRecords

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

Change 732940 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Catch CannotCreateActorException in InjectRCRecords

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

Change 732938 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Warn before returning null in ExternalUserNames wiring

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

Change 732937 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Document requirement on item and property source

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

TL;DR: the most likely case for this is that your local entity source has a string as the repoDatabase (e.g. 'repoDatabase' => $wgDBname). Use false instead to refer to the local wiki, that’s easier for simple setups. In complicated setups, especially if the repo database actually points to a different (non-local) database, make sure that the database name is also a valid site global ID.

Change 734348 had a related patch set uploaded (by Michael Große; author: Michael Große):

[mediawiki/extensions/Wikibase@master] RC injection: Detect user from local database

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

Change 734348 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] RC injection: Detect user from local database

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