Page MenuHomePhabricator

Math extension cannot connect to Restbase
Closed, ResolvedPublicBUG REPORT

Description

What happens?: in wikidata all math formulas (for example in https://www.wikidata.org/wiki/Q74760821) gives MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "http://localhost:6011/www.wikidata.org/v1/v1/":):

Other information (browser name/version, screenshots, etc.): Chrome, Ubuntu

Event Timeline

Caenus triaged this task as Unbreak Now! priority.Jun 7 2023, 7:56 PM

It is not only a problem for items, but also pages with wikitext as content model see for example https://m.wikidata.org/wiki/User:Physikerwelt#Test

@daniel

I wonder if someone has access to the actual settings of wikidata. The change in question would be. https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Math/ /922166/8/src/Hooks.php

Really quick digging here, so might be missing the mark — MathUseInternalRestbasePath defaults to true, and MathInternalRestbaseURL is null, so it's going to fall back to VirtualRestConfig, which I know T334842: Replace usage of VirtualRESTServiceClient in Math extension hasn't yet replaced, but..

this is not wikidata specific, and already hit the "early upgrade" wikipedias such as cawiki and hewiki. for details and links, see T338405

removing "wikidata" tag from task - it's pure noise. this is 1.41.0-wmf.12 (e54da81), and has nothing to do with wikidata per se.

Change 928178 had a related patch set uploaded (by Samtar; author: Samtar):

[mediawiki/extensions/Math@master] MathRestbaseInterface: Correct wgMathInternalRestbaseURL path

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

Some trial and error on the beta cluster found that either wgMathInternalRestbaseURL is being set with trailing v1/v1/ or return "{$wgMathInternalRestbaseURL}v1/$path" was improper — the (WIP, CI failing) patch above trims return "{$wgMathInternalRestbaseURL}v1/$path" to return "{$wgMathInternalRestbaseURL}$path", but I still think setting wgMathInternalRestbaseURL might make more sense?


Conversely, setting

'wgMathInternalRestbaseURL' => [
       'default' => 'https://wikimedia.org/api/rest_',
],

in IS-labs.php resolved the issue on Beta

The reason wgMathInternalRestbaseURL is not set, is because it did not exist prior to this change. I wonder if we don't see config warnings in the logs like
"The MathInternalRestbaseURL is falling back to VirtualRestConfig. Please set MathInternalRestbaseURL explicitly."

The reason wgMathInternalRestbaseURL is not set, is because it did not exist prior to this change. I wonder if we don't see config warnings in the logs like
"The MathInternalRestbaseURL is falling back to VirtualRestConfig. Please set MathInternalRestbaseURL explicitly."

Only one instance of that it seems;

Error
normalized_message
The MathInternalRestbaseURL is falling back to VirtualRestConfig. Please set MathInternalRestbaseURL explicitly.

This was reported on Wikisource as well (on this page)

Change 928182 had a related patch set uploaded (by Physikerwelt; author: Physikerwelt):

[mediawiki/extensions/Math@master] Remove additional v1 suffix when computing internalRestbaseURL

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

Change 928178 abandoned by Samtar:

[mediawiki/extensions/Math@master] MathRestbaseInterface: Correct wgMathInternalRestbaseURL path

Reason:

see If2719fb9106e1414ce8814a2fbafa5dcedb84e39

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

Change 928182 merged by jenkins-bot:

[mediawiki/extensions/Math@master] Remove additional v1 suffix when computing internalRestbaseURL

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

Change 928158 had a related patch set uploaded (by Samtar; author: Physikerwelt):

[mediawiki/extensions/Math@wmf/1.41.0-wmf.12] Remove additional v1 suffix when computing internalRestbaseURL

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

Fix verified on beta cluster, I intend to backport to .12 — many thanks @Physikerwelt

Change 928158 merged by jenkins-bot:

[mediawiki/extensions/Math@wmf/1.41.0-wmf.12] Remove additional v1 suffix when computing internalRestbaseURL

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

Mentioned in SAL (#wikimedia-operations) [2023-06-08T02:44:49Z] <samtar@deploy1002> Started scap: Backport for [[gerrit:928158|Remove additional v1 suffix when computing internalRestbaseURL (T334842 T338381)]]

Mentioned in SAL (#wikimedia-operations) [2023-06-08T02:46:33Z] <samtar@deploy1002> samtar: Backport for [[gerrit:928158|Remove additional v1 suffix when computing internalRestbaseURL (T334842 T338381)]] synced to the testservers: mwdebug2001.codfw.wmnet, mwdebug1001.eqiad.wmnet, mwdebug2002.codfw.wmnet, mwdebug1002.eqiad.wmnet

Mentioned in SAL (#wikimedia-operations) [2023-06-08T02:54:40Z] <samtar@deploy1002> Finished scap: Backport for [[gerrit:928158|Remove additional v1 suffix when computing internalRestbaseURL (T334842 T338381)]] (duration: 09m 50s)

TheresNoTime lowered the priority of this task from Unbreak Now! to Needs Triage.Jun 8 2023, 2:58 AM

Issue resolved in production, resetting priority. I'll leave this open for any follow-up work which might be needed.

I am not seeing the error...

Ah, it's fixed. Sorry. I should have reloaded this page before investigating. Thank you all!

It has been fixed in https://gerrit.wikimedia.org/r/928158. I think we should close the issue.

It has been fixed in https://gerrit.wikimedia.org/r/928158. I think we should close the issue.

Sorry for my mistake keeping you up all night...

Caenus claimed this task.

Thank you for your fix @Physikerwelt !