Page MenuHomePhabricator

ForeignDBFile attempts to load users in the context of the wrong wiki
Open, Needs TriagePublic

Description

When a wiki is configured to use another wiki as a shared image repository via the ForeignDBViaLBRepo abstraction, the ForeignDBFile objects produced by the repo always try to load the User object of the image uploader in the context of the client wiki, rather than the repository wiki. If the user tables of the two wikis are different, this can result in incorrect attribution being displayed, or cryptic Cannot create a user with no name, no ID, and no actor ID errors.

Instead, ForeignDBFile instances should always use the user table of the repository wiki to load uploader info.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Note: This is essentially T222212 but for images.

Change 673079 had a related patch set uploaded (by TK-999; owner: TK-999):
[mediawiki/core@master] [DNM] LocalFile: Load User objects in the context of the remote wiki

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

Tentatively tagging @daniel and @Pchelolo due to their recent work around similar issues. :)

Yeah, we've done much progress with converting everything to UserIdentity/ActorStore and thus supporting better cross-wiki users, but haven't touched the File yet, mostly cause it's a very large class hierarchy, so it's hard and didn't qualify as a low hanging fruit.

How high of a priority is this? We can put this next on our agenda.

Thanks for the quick response! This fix in itself would not solve our problems, as we still have to finish the actor migration across all of our wikis. I consider this patch more as a future insurance to ensure the problem doesn't pop up after that's done, so probably not so urgent.