-1

Because of firewall restrictions, I have to install a local method and RESTBase server for our mediawiki installation.

However RESTBase is giving me this error when accessing a mediawiki page with a formula on it:

I formatted it to make it easier to read:

{"name":"restbase","hostname":"dabicho","pid":27387,"level":20,"message":"404: not_found#route","res":
 {"status":404,"headers":
  {"access-control-allow-origin":"*","access-control-allow-methods":"GET,HEAD",
   "access-control-allow-headers":"accept, content-type, content-length, cache-control, accept-language, api-user-agent, if-match, if-modified-since, if-none-match, dnt, accept-encoding",
   "access-control-expose-headers":"etag","x-content-type-options":"nosniff",
   "x-frame-options":"SAMEORIGIN","referrer-policy":"origin-when-cross-origin",
   "x-xss-protection":"1; mode=block","content-security-policy":"default-src 'none'; frame-ancestors 'none'",
   "x-content-security-policy":"default-src 'none'; frame-ancestors 'none'",
   "x-webkit-csp":"default-src 'none'; frame-ancestors 'none'",
   "cache-control":"private, max-age=0, s-maxage=0, must-revalidate",
   "x-request-id":"5e514e00-bd54-11e9-b0fc-3b7f2c4dac26","server":"dabicho"}},
 "stack":"HTTPError: 404: not_found#route\n    at HyperSwitch._request (/Development/RESTBase/restbase.git/restbase/node_modules/hyperswitch/lib/hyperswitch.js:268:19)\n
at _createFilteredHandler (/Development/RESTBase/restbase.git/restbase/node_modules/hyperswitch/lib/hyperswitch.js:170:26)\n
at tryCatcher (/Development/RESTBase/restbase.git/restbase/node_modules/bluebird/js/release/util.js:16:23)\n
at /Development/RESTBase/restbase.git/restbase/node_modules/bluebird/js/release/method.js:15:34\n    at handlerWrapper (/Development/RESTBase/restbase.git/restbase/node_modules/hyperswitch/lib/hyperswitch.js:422:37)\n    at next (/Development/RESTBase/restbase.git/restbase/node_modules/hyperswitch/lib/hyperswitch.js:408:42)\n    at Object.normalizeHeaders [as filter] (/Development/RESTBase/restbase.git/restbase/lib/normalize_headers_filter.js:11:12)\n
at handlerWrapper (/Development/RESTBase/restbase.git/restbase/node_modules/hyperswitch/lib/hyperswitch.js:420:27)\n    at next (/Development/RESTBase/restbase.git/restbase/node_modules/hyperswitch/lib/hyperswitch.js:408:42)\n    at Object.addCSPHeaders [as filter] (/Development/RESTBase/restbase.git/restbase/lib/security_response_header_filter.js:60:22)\n
at handlerWrapper (/Development/RESTBase/restbase.git/restbase/node_modules/hyperswitch/lib/hyperswitch.js:420:27)\n
at /Development/RESTBase/restbase.git/restbase/node_modules/hyperswitch/lib/hyperswitch.js:426:28\n
at HyperSwitch._filteredRequest (/Development/RESTBase/restbase.git/restbase/node_modules/hyperswitch/lib/hyperswitch.js:171:19)\n
at HyperSwitch.request (/Development/RESTBase/restbase.git/restbase/node_modules/hyperswitch/lib/hyperswitch.js:160:21)\n
at parsePOST.catchThrow.then (/Development/RESTBase/restbase.git/restbase/node_modules/hyperswitch/lib/server.js:357:27)\n
at tryCatcher (/Development/RESTBase/restbase.git/restbase/node_modules/bluebird/js/release/util.js:16:23)",
 "latency":14,"root_req":{
  "method":"post","uri":"/wiki.host.name/v1/media/math/check/tex",
  "headers":{
   "content-length":"294","content-type":"multipart/form-data; boundary=----------------------------72e54beb925b",
   "user-agent":"wikimedia/multi-http-client v1.0","x-client-ip":"::ffff:192.168.122.104",
   "x-forwarded-for":"::ffff:192.168.122.104","x-request-id":"5e514e00-bd54-11e9-b0fc-3b7f2c4dac26",
   "x-request-class":"external"}},
 "request_id":"5e514e00-bd54-11e9-b0fc-3b7f2c4dac26",
 "levelPath":"debug/request","msg":"404: not_found#route",
 "time":"2019-08-12T22:56:06.894Z","v":0}

When tested by themselves, both servers seem to work Ok

curl -d 'q=E=mc^2' 172.19.78.54:10044/mml
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block" alttext="E=mc^{2}">
<semantics>
 <mrow>
  <mi>E</mi>
  <mo>=</mo>
  <mi>m</mi>
  <msup>
    <mi>c</mi>
    <mrow class="MJX-TeXAtom-ORD">
      <mn>2</mn>
    </mrow>
  </msup>
</mrow>
<annotation encoding="application/x-tex">E=mc^{2}</annotation>
</semantics>

And

curl http://172.19.78.54:7231/wiki.host.name/v1/
{"items":["page","transform"]}

I have this configuration on the wikimedia installation

wfLoadExtension( 'Math' );
$wgMathValidModes[] = 'mathml';
$wgMathMathMLUrl = 'http://172.19.78.54:10044/';
$wgDefaultUserOptions['math'] = 'mathml';
$wgMathFullRestbaseURL = 'http://172.19.78.54:7231/wiki.host.name/';

As I have read at various places.

It seems to query a path named media/math/check from the restbase or the mediawiki but I don't know what to make off it

Don't know what I am missing. Results from google have not helped me understand what I'm doing wrong.

Can you point me in the right direction?

New contributor
dabicho is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
  • 2
    I'm voting to close this question as off-topic because it's asking about self-hosted software configuration. – ale Aug 13 at 0:08

Your Answer

dabicho is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.