Error contacting the Parsoid/RESTBase server: http-bad-status on Fresh Mediawiki 1.35.0 LTS

Viewed 6761

https://www.mediawiki.org/wiki/MediaWiki_1.35 is out and one of the advertise features seems to be the "built in"/"out of the box" Visual Editor that doesn't need an external server anymore.

So downloaded and installed the version just released and clicked "VisualEditor" so that it would appear in my LocalSettings.php as:

wfLoadExtension( 'VisualEditor' );

But when trying to edit a page the error message:

Error contacting the Parsoid/RESTBase server: http-bad-status

With no further hint on what to do.

The information in https://www.mediawiki.org/wiki/Extension:VisualEditor is still intimidating for me - it doesn't look like an "out of the box" configuration at all. I did not find anything there about the dialog's message content.

Where do i find the official information on how to avoid this dialog?

Screenshot

4 Answers

Making sure that $wgServer in LocalSettings.php has https and not http in the string solved it for me.

I've managed to wake up visual editor on an apache / ubuntu with mediawiki 1.37 set to private wiki.

This is what I've done

$wgServer = "https://example.org";

Note the https in wgServer!

End of my LocalSettings.php

if ( isset( $_SERVER['REMOTE_ADDR'] ) &&
     in_array( $_SERVER['REMOTE_ADDR'], [ $_SERVER['SERVER_ADDR'], '127.0.0.1' ] ) ) {
  $wgGroupPermissions['*']['read'] = true;
  $wgGroupPermissions['*']['edit'] = true;
  $wgGroupPermissions['*']['writeapi'] = true;
}

In my case I only run into this problem, when I use a "nested" or structured wiki page.

It works for pages like TestPage, VideoCut, BestPractices but not pages like

TestPage/Test1, TestPage/Hugo and so on.

When looking at the webserver log page it seams the rest.php URL is not build correctly.

In the good case the build rest.php send the following POST request:

POST /wiki/rest.php/localhost/v3/transform/html/to/wikitext/TestPage/12 HTTP/1.1" 200 521 "-" "VisualEditor-MediaWiki/1.38.2"

In the bad case the request looks like:

POST /wiki/rest.php/localhost/v3/transform/html/to/wikitext/TestPage%2FTest1 HTTP/1.1" 404 981 "-" "VisualEditor-MediaWiki/1.38.2"

It ends-up in a 404 instead of a successful 200. The problem seams to be the coded %2F (/) inside the Page-Path (TestPage/Test1 -> TestPage%2FTest1).

If you are using the HTTP based authentication of your webserver you have to allow localhost to be whitelisted, so MediaWiki can reach itself.

For Apache you can do this with

Require local

at the same spot where you configured the authentication. You can find detailed configuration descriptions in the MediaWiki Wiki.

https://www.mediawiki.org/wiki/Topic:Vwkv6abtipmknci8

However i would not recommend to use whitelisting based on the user agent. Attackers could circumvent the authentication just by changing their user agent string.

Related