Page MenuHomePhabricator

Wikidata Bridge badtoken error
Closed, ResolvedPublic5 Estimated Story Points

Description

Problem:
This error was previously discussed in T274149. To find the origin of the error, logging was enhanced. The error popped up again. The author of the most recent reports (this and the related T285066) added the following for context:

I was trying to edit a picture of a template, but it gave me an error, I think it was because I was doing it from the mobile. When I tried to do it from the computer, I had no problem.

There are additional stack traces in the bug reports marked as duplicates.

Acceptance criteria:
We try out Lucas's idea:

  • when we get this error, the initialization is restarted from scratch once (not infinitely many times!)
  • optional: we log or track whether it worked that second time or not (e.g. in Grafana)

(after the ticket is closed, we can wait and see if this pops up again)

Original:
The error happened on: https://ca.m.wikipedia.org/wiki/Carles_Sala_i_Vila
Item title: Q16187514
Property: P106
Error message: INITIALIZATION_ERROR
Approximate time of request: 2021-06-16T18:15:23.867Z
Debug information:

[
    {
        "type": "INITIALIZATION_ERROR",
        "info": {
            "errors": [
                {
                    "code": "badtoken",
                    "key": "badtoken",
                    "params": [
                        "apierror-centralauth-badtoken"
                    ],
                    "module": "main"
                }
            ],
            "name": "Error",
            "message": "badtoken",
            "stack": "_r@https://ca.m.wikipedia.org/w/load.php?lang=ca&modules=wikibase.client.data-bridge.app.modern&skin=minerva&version=tyb9e:31:63082\nmwApiRejectionToError@https://ca.m.wikipedia.org/w/load.php?lang=ca&modules=wikibase.client.data-bridge.app.modern&skin=minerva&version=tyb9e:31:63933\nmightThrow@https://ca.m.wikipedia.org/w/load.php?lang=ca&modules=jquery%2Coojs-ui-core%2Coojs-ui-widgets&skin=minerva&version=16h4x:49:838\nhttps://ca.m.wikipedia.org/w/load.php?lang=ca&modules=jquery%2Coojs-ui-core%2Coojs-ui-widgets&skin=minerva&version=16h4x:50:508"
        }
    }
]

Event Timeline

Cross linking with T285066: Wikidata Bridge error which is similar but with a different stack

Yes, these are related and there are a couple more. We have a view in Wikidata bridge that asks them to create a ticket here on Phabricator with a template that results in reports like this. These reports are intended to help us figure out what is going on and decide how to fix this.

This report now includes two things: a precise timestamp and the apierror-centralauth-badtoken code. With those things together, maybe we have now a chance at figuring out where exactly and why exactly these errors happen. Once we know that, we can then come up with a suggestion what to do about it.

Hi @Patrigopla! Thank you for reporting this error and the related T285066! We would like to fix this error. For this, it would be extremely helpful to know what steps you took before you saw the error. Could you please tell us?

Hi @Patrigopla! Thank you for reporting this error and the related T285066! We would like to fix this error. For this, it would be extremely helpful to know what steps you took before you saw the error. Could you please tell us?

Yes, please!
And could you also tell us the following (based on a hunch):

  • Did you happen to log in or log out just before this error occurred, maybe in a different tab?
  • Or were you forced to log in again after you encountered this problem?
Manuel renamed this task from Wikidata Bridge error to Wikidata Bridge badtoken error.Jun 18 2021, 8:22 AM

I can speak in spanish?

Sí 👍
Yes, you can! We have people that can translate it back for us :)

Estava intentando editar una fotografía de una plantilla, pero me daba error, creo que era porque lo hacía desde el movil. Al intentarlo hacer desde el ordenador, no he tenido ningun problema.

I think this might be due to some strange interaction between CentralAuth trying to log in the user in the background, and us doing the Bridge initialization in the meantime…

Maybe it would help if, when we get this error, we restart the initialization from scratch and see if it works that time? (But only retry it once, not infinitely many times.)

Manuel updated the task description. (Show Details)
Addshore set the point value for this task to 5.Jun 23 2021, 10:21 AM

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

[mediawiki/extensions/Wikibase@master] bridge: WIP: retry initialization once

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

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

[mediawiki/extensions/Wikibase@master] bridge: use errorformat=raw for all API requests

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

Change 701366 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] bridge: use errorformat=raw for all API requests

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

Change 701120 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] bridge: retry initialization once

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

I’ve added a panel for recovered errors to the Bridge Grafana board, let’s see if anything shows up there.

No data yet, but lets close this and see if someone else encounters the issue