Topic on Extension talk:Math

Jump to navigation Jump to search

https://wikimedia.org/api/rest_v1/ returning code 0 and not 200

8
Nyet (talkcontribs)

Using mediawiki 1.31 and Math extension REL_31

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://wikimedia.org/api/rest_v1/":)

If i change it to allow code 0:

diff --git a/MathRestbaseInterface.php b/MathRestbaseInterface.php
 index 2dc5d45..5355177 100644
 --- a/MathRestbaseInterface.php
 +++ b/MathRestbaseInterface.php
 @@ -364,7 +364,7 @@ class MathRestbaseInterface {
          */
         public function evaluateRestbaseCheckResponse( $response ) {
                 $json = json_decode( $response['body'] );
 -               if ( $response['code'] === 200 ) {
 +               if ( $response['code'] === 200 || $response['code'] === 0) {
                         $headers = $response['headers'];
                         $this->hash = $headers['x-resource-location'];
                         $this->success = $json->success;
 
 

I get

Failed to parse (Conversion error. Server ("https://wikimedia.org/api/rest_") reported: "Cannot get mml. Server problem.")

Is the RESTBase server down?

Jdforrester (WMF) (talkcontribs)

Is the RESTBase server down?

No, but maybe the Mathoid service is?

87.123.120.67 (talkcontribs)

My Math extension have been failing with the same error since a few days.

38.140.29.18 (talkcontribs)

I've had this problem too. After some debugging, it appears that PHP's curl was refusing the SSL certificate of https://wikimedia.org/api/rest_ . I downloaded a cacert.pem file and pointed edited the php.ini to point to under under variable curl.cainfo and openssl.cafile. This fixed my problem.

[curl]

curl.cainfo = "C:\PHP7\cacert.pem"

[openssl]

openssl.cafile="C:\PHP7\cacert.pem"

J Ra Rose (talkcontribs)

Since today I have the same issue. Where did you download the cacert.pem file?

2001:B68:16:80:921B:EFF:FE13:C9A2 (talkcontribs)

We have the same issue as OP. Adding certificates to php.ini did not help.

2001:B68:16:80:921B:EFF:FE13:C9A2 (talkcontribs)

Our problems started after a system update. The issue is probably caused by changes in other packages.


2001:B68:16:80:921B:EFF:FE13:C9A2 (talkcontribs)
Reply to "https://wikimedia.org/api/rest_v1/ returning code 0 and not 200"