Page MenuHomePhabricator

Error contacting the Parsoid/RESTBase server (HTTP 404)
Closed, ResolvedPublic

Description

I'm using the new integrated Parsoid (PHP Version). On one server it works without problems, but on another server i get the following error:

Error contacting the Parsoid/RESTBase server (HTTP 404)

The configuration on both servers should be identical.

Parsoid config:

wfLoadExtension('Parsoid', 'vendor/wikimedia/parsoid/extension.json');
$wgVirtualRestConfig['modules']['parsoid']['url'] = 'http://localhost' . $wgScriptPath . '/rest.php';
$wgVirtualRestConfig['modules']['parsoid']['forwardCookies'] = true;

When i enable the debug log there is one difference in the log when i'm opening the Visual Editor that i can't explain.
Working server:

Start request GET /w/rest.php/my.domain.net/v3/page/html/Main_Page/40?redirect=false&stash=true

(i replaced the actual domain name from the log with my.domain.net)

Not working server:

Start request GET /w/rest.php?redirect=false&stash=true

Do you have any idea why it doesn't work on one of the servers?

Information about the server where it works:
MediaWiki Version: 1.35.1
PHP Version: 7.3.26
Web-Server: IIS 10 (Windows Server 2016)

The server where it doesn't work:
MediaWiki Version: 1.35.1
PHP Version: 7.3.26
Web-Server: IIS 8.5 (Windows Server 2012 R2)

Event Timeline

Given your webserver is IIS, you may have a special config to do on IIS to correctly manage the endpoint rest.php, which is followed by other slashes, which may confuse the webserver about what is the executable file since URLs are like https://localhost/docs/rest.php/localhost/v3/page/html/Test/8651.

For instance on Apache it is needed to add AllowEncodedSlashes NoDecode. See also T265614, perhaps not the same issue but similar given it is IIS.

matmarex added a project: MW-1.41-notes.
matmarex subscribed.

This problem should no longer occur on MediaWiki 1.41 and later, as VisualEditor no longer uses HTTP requests internally to contact Parsoid, it just calls the PHP methods directly (see T320529 for related work).

Please try MediaWiki 1.41 and hopefully VisualEditor will now finally just work. If you still encounter some issues, please file a new task.