Page MenuHomePhabricator

MW 1.35.0 "Error contacting the Parsoid/RESTBase server: http-bad-status" on a private wiki
Open, Needs TriagePublicBUG REPORT

Description

VisualEditor does not work in private wikis.

Steps to Reproduce:

  1. Include the following in LocalSettings.php:
$wgGroupPermissions['*']['edit'] = false;
$wgGroupPermissions['*']['read'] = false;
  1. Open an existing page, and click the "Edit" link.

Actual Results:

The VisualEditor editor loads, but then we get an error, "Error contacting the Parsoid/RESTBase server: http-bad-status".

Expected Results:

VisualEditor works as expected.

Notes

When creating a new page, the editor loads fine, but if you hit "Save" you get the same error message.

If you change the lines in step 1 to be "true", VisualEditor works as expected.

Relevant discussion/others having the same issue or similar:

Event Timeline

ppelberg added a subscriber: ppelberg.

hi @Technoabyss – thank you for filing this issue. We think the issue you are experiencing can be resolved by following the instructions documented on this help page. [i]

Please let us know if after reading that you still have questions.


i. https://www.mediawiki.org/wiki/Extension:VisualEditor#Linking_with_Parsoid_in_private_wikis

@ppelberg
To be honest, I'm not sure what these instructions are telling me to do? My wiki is served over HTTPS, so I imagine I shouldn't set up forwarding cookies. Do I need to serve my wiki over http and forward my cookies for VisualEditor to work?

For posterity, this is the current revision of the VisualEditor extension page: https://www.mediawiki.org/w/index.php?title=Extension:VisualEditor&oldid=4220814

I've closed the Talk page now that there is a working workaround for this issue, where you turn off the read/edit restrictions for connections coming from the server Mediawiki is installed on.

The same issue is happening to me with a wiki configured as

$wgGroupPermissions['*']['read'] = true;
$wgGroupPermissions['*']['edit'] = false;

but, more importantly, the bug persists even if I change permissions to

$wgGroupPermissions['*']['read'] = true;
$wgGroupPermissions['*']['edit'] = true;

and the workaround doesn't work for me either.

  1. Install a private personal mediawiki 1.35 on a ubuntu 20.04 laptop without short url.
  2. Install semantic mediawiki with composer
  3. disable the ufw firewall

Visual editor doesn't work out of the box in a private personal mediawiki.

I tried each of the following tricks one by one in LocalSettings.php. I restart the apache2 service after using each trick. I didn't try any two tricks at the same time. Visual editor doesn't work in all cases. I get the error: Error contacting the Parsoid/RESTBase server: http-bad-status

  • Set $wgVirtualRestConfig['modules']['parsoid']['forwardCookies'] = true;
  • Set $wgGroupPermissions['user']['writeapi'] = true;
  • Use the follow trick with the <ip> as localhost or 127.0.0.1
if ( $_SERVER['REMOTE_ADDR'] == 'localhost ) {
        $wgGroupPermissions['*']['read'] = true;
        $wgGroupPermissions['*']['edit'] = true;
}

If the wiki is readable by everyone, visual editor works. But I want to have a private wiki for myself.

$wgGroupPermissions['*']['read'] = true;
$wgGroupPermissions['*']['edit'] = false;

Same problem here, no workaround did the trick for me.

Setting up Mediawiki with Visual Editor is the most frustrating thing i have ever done websitewise...