Topic on Project:Support desk

MediaWiki 1.35 Error contacting the Parsoid/RESTBase server: (curl error: 28) Timeout was reached

12
CharlesCivi (talkcontribs)

I just installed MediaWiki 1.35 on an Amazon Linux EC2 server, with php 7.3 and MariaDB

Everything seems to work fine, except when I try to edit a page using VisualEditor.

I cannot load a page for editing, I get the error:

Error contacting the Parsoid/RESTBase server: (curl error: 28) Timeout was reached

I can edit a new page with VisualEditor, but I when I try to save it, I get the same error.

Error contacting the Parsoid/RESTBase server: (curl error: 28) Timeout was reached

I have no trouble reaching the page via the REST endpoint:

http://MyWayCoolIPAddress/rest.php/v1/page/Main_Page

Which returns:

// 20201019142902

// http://MyWayCoolIPAddress/rest.php/v1/page/Main_Page

{

 "id": 1,
 "key": "Main_Page",
 "title": "Main Page",
 "latest": {
   "id": 1,
   "timestamp": "2020-10-14T17:17:27Z"
 },
 "content_model": "wikitext",
 "license": {
   "url": "",
   "title": ""
 },
 "source": "MediaWiki has been installed.\n\nConsult the User's Guide for information on using the wiki software.\n\n== Getting started ==\n* Configuration settings list\n* MediaWiki FAQ\n* MediaWiki release mailing list\n* Localise MediaWiki for your language\n* Learn how to combat spam on your wiki"

}


If I try to call the API endpoint directly:

http://MyWayCoolIPAddress/api.php?action=visualeditor&paction=parse&page=Main_Page

I get a similar error:

{

   "error": {
       "code": "apierror-visualeditor-docserver-http-error",
       "info": "Error contacting the Parsoid/RESTBase server: (curl error: 28) Timeout was reached",
       "*": "See http://MyWayCoolIPAddress/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes."
   }

}

This is MediaWiki 1.35, and as far as I know it includes Parsoid-PHP, so I don't need to do any additional configuration.

I assume VisualEditor is not the problem because I can edit a new page, I just can't save it.

MarkAHershberger (talkcontribs)
CharlesCivi (talkcontribs)

SELinux status: disabled

CharlesCivi (talkcontribs)

Is it trying to reach parsoid from the client, or from the server side and then pass it to the client?

MarkAHershberger (talkcontribs)

VE connects to MW via api.phpand then, because of the way VE was originally created, MW makes an http call to itself via rest.php. I'm pretty sure this will change in the next version of MW/VE.


The connections (from the instances I've seen) are made on localhost. Maybe your webserver isn't listening on localhost?


In any, case check the "Linking with Parsoid" section of the documentation. It may help.

CharlesCivi (talkcontribs)

On the server I execute: curl http://localhost/rest.php/v1/page/Main_Page and I get a good result

I checked the Link with Parsoid section, and it suggests adding the URL parameter, which I do,

But, setting it to 'url' => $wgServer . $wgScriptPath . '/rest.php' as suggested merely results in a timeout, as I would expect, because it can't reach itself by domain name

I set it specifically to 'url' => 'http://localhost/rest.php' Which I've proven works through curl, but I receive a different error - 404, not found.

I added to the apache server to Listen localhost:8000 and then modified the url to use: 'url' => 'http://localhost:8000/rest.php' but that gets the 404


Based on those results, I assume that parsoid is using $wgServer by default, which is why it can't reach itself.

CharlesCivi (talkcontribs)

Based on my last response, I realized parsoid is using $wgServer to connect to rest.php

So, I added the domain name to /etc/hosts using 127.0.0.1 and now it works!

Thanks for helping me work it through

QJLYH (talkcontribs)

After added the domain name to /etc/hosts, I got:

Error contacting the Parsoid/RESTBase server: (curl error: 77) Problem with the SSL CA cert (path? access rights?)

CharlesCivi (talkcontribs)

But it does make me wonder why it got a 404 when I changed the URL to localhost?

MarkAHershberger (talkcontribs)

Your webserver probably thought that it wasn't serving a site named "localhost" but when you gave it your domain name, it worked. If you had told your server to serve the same site on localhost and your domain name, it probably would have worked.

Ryansbudza (talkcontribs)

I am getting the same error above on Mediawiki 1.35, but only on large pages with large tables. Visual Editor works on all other pages without issue. On large pages, the progress bar for loading gets about 75% of the way and then this error pops up.


Is there a way to increase the time limit?

MarkAHershberger (talkcontribs)

Please ask a new question instead of replying to old ones with new issues.

Reply to "MediaWiki 1.35 Error contacting the Parsoid/RESTBase server: (curl error: 28) Timeout was reached"