Jump to content

Topic on Extension talk:Math

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.