Extension talk:Math

About this board

Previous discussions were archived for 2011–2014 and 2015–2016 on 2016-10-20.

Failed to parse. Math extension cannot connect to Restbase.

4
Blyatman9000 (talkcontribs)

I am new to MediaWiki, and I have created private wiki and was able to display math in my wiki pages. However, after having a certain number of equations, I get these error messages:

Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle y=x+1}

The page contains text and about 15 equations spread throughout. The error occurs when I try to add a 16th equation, which causes all the equations to display a similar error. I also simplified the page so that the page just contained numerous lines of <math>0</math>, but it was the same issue.

Can anyone assist me on this issue? I know this error has been discussed many times before, but I couldn't get a proper fix for it.

I am using MediaWiki 1.39.3 and PHP 8.2.0 (apache2handler). In LocalSettings.php, I have simply added wfLoadExtension( 'Math' ) with no other configurations.

Fokebox (talkcontribs)

I often receive such message "Math extension cannot connect to Restbase." Especially if I have a lot of formulas at the page. Is there a way to resolve the problem?

138.100.155.219 (talkcontribs)
Agatnor (talkcontribs)

I also have the same problem of "Math extension cannot connect to Restbase", can someone help me fix it?

Reply to "Failed to parse. Math extension cannot connect to Restbase."
*Surak* (talkcontribs)

I am not sure if I identified the following as true issues, therefore, I didn't dare to change the documentaiton on myself. Maybe one of the devlopers can have a short look here?

In chapter 4 List of significant configuration settings, the table has in rows 3 and 4:

Setting name Default value Description
$wgMathFullRestbaseURL false The math extension gets the default config from the Visual Editor, if available. Details.
$wgMathPreferRestbaseURL true Whether to allow using of internal RESTBase path instead of $wgMathFullRestbaseURL and $wgVisualEditorFullRestbaseURL. Set false if you want to use external RESTBase in any case.

The table would make more sense to me, if the setting name '$wgMathFullRestbaseURL' is replaced by '$wgVisualEditorFullRestbaseURL', since '$wgMathFullRestbaseURL' is already defined in chapter 3.1.1 Mathoid as a service as https://wikimedia.org/api/rest_, and cannot be set to a boolean value at the same time.

Another question in regard to the Details link: It currently refers to MathRestbaseInterface.php#182 ($rbi = $rbis[$i++];). Is the link potentially broken?

Reply to "Documentation issue"

Setup Proxy for curl used by Math extension

1
Cheellaz (talkcontribs)

I am fairly new to MediaWiki, please be kind :)


I have the Math extension installed (version 3.0.0) with the recommended output mode 'mathml', using Mathoid as the default service. My MediaWiki version is 1.39.4.

I receive "Fatal exception of type "MWException" when loading my wiki's page Special:MathStatus (e.g. Special:MathStatus)


In my MediaWiki log I read:

[Math] Start rendering "x^2+\text{a sample Text}" in mode mathml

[http] HTTP start: POST https://wikimedia.org/api/rest_v1/media/math/check/tex

[http] Error fetching URL "https://wikimedia.org/api/rest_v1/media/math/check/tex": (curl error: 28) Timeout was reached

[Math] Tex check failed


It looks like I have a connection issue to the Mathoid service hosted by wikimedia.org.


I must use proxy for all external webrequests in the network my Wiki is hosted.

I have set option $wgHTTPProxy in my Wiki's LocalSettings.php and confirmed this setting took affect by enabling images on my wiki hosted by InstantCommons.

The manual pages for $wgHTTPProxy (Manual:$wgHTTPProxy) states that it sets the proxy for curl.


Does this setting also apply to curl used by the Math extension?


Or do I have to separately configure a proxy for curl used by Math extension? How can I do this?

Reply to "Setup Proxy for curl used by Math extension"

User interface suggestion

1
Joshuardavis (talkcontribs)

Recently at English Wikipedia's Help talk:Displaying_a_formula (sorry, the editor here won't actually let me link), a user raised a reasonable complaint. In Preferences / Appearance / Math, the two radio button options are to render math as LaTeX source or as SVG. The typical user doesn't know what either one is. They just want to see well-typeset math, like in publications. So how about re-wording the second option? Maybe "publication-like notation rendered via SVG"? Or something better! Thanks.

Reply to "User interface suggestion"

Installing math problem

1
1957Harry (talkcontribs)

I have installed Math version 3.0.0 (7fac46b) today, as seen in the Special:Version page( My wiki version 1.37.1). Following the instructions I run the updatescript, my screen show's this:

...collations up-to-date.

...index rc_name_type_patrolled_timestamp already set on recentchanges table.

...rev_page_id index already non-unique.

...pl_namespace, tl_namespace, il_to indices are already non-UNIQUE.

...h


and Its still running.

Is there a so;lution/option to shorten this process??

Reply to "Installing math problem"
Summary by Tacsipacsi

Giving it loads of RAM solved the issue.

Oravela (talkcontribs)

Hi,

I'm trying to understand where the Math extension writes temporary files as I want to check the folder permissions. Can anyone point me in the right direction?

I am basically trying to solve an issue where the rendering fails and when I check Math Status in the special pages on my wiki it shows:

MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools)

Running backend tests for rendering mode MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools).

Test Rendering the input "x^2+\text{a sample Text}" succeeded.

Test Comparing to the reference rendering succeeded.

Test Rendering of a+b in plain MathML mode succeeded.

Test Checking the presence of '+' in the MathML output succeeded.

Test Comparing the generated SVG with the reference failed.

Test Checking if MathML input is supported succeeded.

Test Rendering Presentation MathML sample failed.

Test Checking if the link to SVG image is correct failed.

Backend tests for rendering mode MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools) completed.

As you can see the first failure is where it tries to compare the generated SVG with the reference. I am curious as to whether it is unable to save the generated SVG to the temporary directory.

Hope someone can help me out as I've been trying to solve this for several days now.

Many thanks in advance.

Tacsipacsi (talkcontribs)

The code is quite complicated, but I don’t think it tries to save the image into a temporary directory at all – instead, it reads the reference image from the images/ directory, and compares it with the generated image in memory. Since SVGs are text files, one possible issue may be wrong line ending. Are you on Windows?

Special:MathStatus also seems to log a fair amount of information. Did you enable debug logging (see Manual:$wgDebugLogFile)?

Oravela (talkcontribs)

Hi @Tacsipacsi,

Many thanks for getting back to me.

I have been further investigating and found an example in the logs where the first three math equations in a page fail, but the fourth is successful. The error log shows:

(curl error: 56) Failure when receiving data from the peer

(curl error: 27) Out of memory

(curl error: 27) Out of memory

[http] HTTP complete: code=200 size=133 total=0.167406 connect=0.039775

This leads me to think that the failed to parse error is actually due to a memory issue on my web server. I will post any further updates I have here to hopefully help others that may have issues with the math extension.

If you think there is any there issue causing these errors, of course, please let me know.

Oravela (talkcontribs)

Update.

My log file also showed the following error:

[http] Error fetching URL "https://wikimedia.org/api/rest_v1/media/math/check/tex": (curl error: 6) Couldn't resolve host name

The visible error on the media wiki page looked like:

Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":

I tried, but they did not work, the fixes explained by @Johanngan in this discussion topic:

https://www.mediawiki.org/w/index.php?title=Topic:Uo3kkmmop1jj9vhw&topic_showPostId=v2pfwaghxx0fmu0c#flow-post-v2pfwaghxx0fmu0c

What did work was increasing the memory on my web server to 2048MB. This should not have been necessary but it did solve my problem. I hope this may help others who run into the Math extension cannot connect to Restbase error message.

Tacsipacsi (talkcontribs)

Thanks for sharing your solution. I’s indeed strange, 2 GiB is a lot… I’ll now close this thread, but feel free to reopen it if you have anything to add.

$wgMathValidModes are ignored on Mediawiki 1.35.1

2
166.104.144.95 (talkcontribs)

$wgMathValidModes does not forbid user or server to use the excluded options. I tested only on Mediawiki 1.35.1. For example, the below LocalSettings.php allows user to use 'source' or 'png':

wfLoadExtension( 'Math' );
$wgMathValidModes[] = 'mathml';
$wgDefaultUserOptions['math'] = 'mathml';
Kghbln (talkcontribs)

Same here. 1.35.x appears to ignore the settings to the configuration parameter.

Reply to "$wgMathValidModes are ignored on Mediawiki 1.35.1"

configure size of the formuls

1
PetaloAzul (talkcontribs)

hello, at the moment the extension simple math jax is the extension with setting for personalizate the formuls of math and chemistry, the extension have the config $wgSmjScale for change the size of the formuls, the extension math have that config similar?

Reply to "configure size of the formuls"

"Math extension cannot connect to Restbase"

1
Jameshfisher (talkcontribs)
Reply to ""Math extension cannot connect to Restbase""

Google Chrome bug causes incorrect formula display

1
Lady G2016 (talkcontribs)

The MediaWiki support desk is reporting a bug with the Windows 10 version of Chrome. Chrome fails to display the minus '-' sign when zooming at certain levels of magnification.

Please see: Minus sign not visible in chrome on following page

How can this be reported to the Chrome developers?

Reply to "Google Chrome bug causes incorrect formula display"
Return to "Math" page.