Page MenuHomePhabricator

What can cause a "[failed-save] The save has failed" Exception when calling the API ?
Open, Needs TriagePublic

Description

When sending updates to Wikidata through Wikidata toolkit, I get tons of these Exceptions below.

All these exceptions seem to happen in a row, then processing resumes back to normal, which indicates it is not caused by the nature of the updates being requested, but by the server being too busy or blocking the requests.

The calls are made sequentially, not in parallel. Should I pause a little between each API call ?

17:22:04.667 ERROR o.i.i.IssnBot - [failed-save] The save has failed.
org.wikidata.wdtk.wikibaseapi.apierrors.MediaWikiApiErrorException: [failed-save] The save has failed.
	at org.wikidata.wdtk.wikibaseapi.apierrors.MediaWikiApiErrorHandler.throwMediaWikiApiErrorException(MediaWikiApiErrorHandler.java:68)
	at org.wikidata.wdtk.wikibaseapi.ApiConnection.checkErrors(ApiConnection.java:524)
	at org.wikidata.wdtk.wikibaseapi.ApiConnection.sendJsonRequest(ApiConnection.java:464)
	at org.wikidata.wdtk.wikibaseapi.WbEditingAction.performAPIAction(WbEditingAction.java:747)
	at org.wikidata.wdtk.wikibaseapi.WbEditingAction.wbEditEntity(WbEditingAction.java:308)
	at org.wikidata.wdtk.wikibaseapi.StatementUpdate.performEdit(StatementUpdate.java:254)
	at org.wikidata.wdtk.wikibaseapi.TermStatementUpdate.performEdit(TermStatementUpdate.java:385)
	at org.wikidata.wdtk.wikibaseapi.WikibaseDataEditor.updateTermsStatements(WikibaseDataEditor.java:738)
	at org.wikidata.wdtk.wikibaseapi.WikibaseDataEditor.updateTermsStatements(WikibaseDataEditor.java:578)
	at org.issn.issnbot.IssnBot.processSerial(IssnBot.java:265)
	at org.issn.issnbot.IssnBot.processBatch(IssnBot.java:173)
	at org.issn.issnbot.IssnBot.process(IssnBot.java:150)
	at org.issn.issnbot.IssnBot.processFolder(IssnBot.java:114)
	at org.issn.issnbot.app.load_issn.LoadIssn.execute(LoadIssn.java:48)
	at org.issn.issnbot.app.Main.run(Main.java:100)
	at org.issn.issnbot.app.Main.main(Main.java:107)

Event Timeline

Here a screenshot from my log files showing the errors happening in a row, then some successfull calls, then errors again, then normal, etc.
Is the server refusing updates when maxLag is too high ?

image.png (821×763 px, 98 KB)

Seeing this too for a few weeks now. The fail rate is 10-20% on average, up to one third of added statements. I'm using wikibase-cli, in one thread, nothing else.

Like Tfrancart says, editing speed increases slowly (which is unusual) then a batch of 20-30 fast fails sets in, then starting slow again.

I don't want this. Give me a constant rate without fails. If you can't, I need to hack in a delay on my side. This was not necessary for years, until recently.

Update: The wikibase-cli author resolved the problem with a new version of his toolkit, see https://github.com/maxlath/wikibase-cli/issues/150