Topic on Talk:Parsoid

Summary by Arlolra

User went away

37.1.253.18 (talkcontribs)

This is an update for the following archived thread : Talk:Parsoid/Archive#Failed_API_request

If I directly call a Parsoid page (" curl http://localhost:8000/localhost/myPageName?oldid=883 " for instance) it works as expected. The parsoid.log indicates that parsing was done in half a second.

But using the VisualEditor (when I click "Modify" in the Wiki) parsoid starts parsing and ends with a timeout as explained in the archived topic...

I tried to activate parsoid debug and I can see some JSON output before "completed parsing in 100439 ms" (at the timeout). This output and the debug output when calling parsoid directly seem to be identical (some identifiers are different, but the content is the same)

Should I look on the VE side instead ?

Arlolra (talkcontribs)

I think what's happening is that your MediaWiki instance doesn't support any concurrency. So, the initial VE request ties up the process, it calls Parsoid, which call back to the MediaWiki API, and that just hangs. Are you using a webserver like Apache to run MediaWiki? php's build-in webserver is single threaded, last I checked.

37.1.253.18 (talkcontribs)

Yes I'm running Apache. And it worked on mediawiki 1.23.

I'll check if something on the Apache side could make it single-threaded...

37.1.253.18 (talkcontribs)

Apache side seems ok.

New info : If I use curl by replacing "localhost" with the local network IP, it doesn't work anymore:

curl: (7) couldn't connect to host

Could this be the cause of the trouble ?

Note that in parsoids' localsettings.js, the Interwiki address uses localhost (and not the local network IP).

Arlolra (talkcontribs)

You said (in the archive) the request VE is making is to the above url, right? And then you tested that directly with curl and it worked. It seems like Parsoid is configured correctly.

How did you verify that Apache is ok? What's your MediaWiki API url? I would try opening a hanging connection to the MediaWiki API (using telnet, or nc, or some such) and then curl'ing it to confirm that multiple request are handled alright.

37.1.253.18 (talkcontribs)

Yes Parsoid seems to work correctly.

And for Apache, I called a php script that sleeps for 10 seconds (from another IP in the network), and launched curl during these 10 seconds. It worked.

2A03:2260:118:0:E8C2:8BFF:FE44:E1CF (talkcontribs)

same here? Anything new? http 0.

Cscott (talkcontribs)

We recently updated the recommended configuration instructions for both Visual Editor and Parsoid. This should make misconfigurations less likely. You might want to try going through the new configuration steps carefully, ideally with the latest Parsoid package and latest MediaWiki and Visual Editor, ensuring that any "prefix" and "domain" you specify is consistent between the mediawiki and parsoid configuration files.

Arlolra (talkcontribs)

I wonder if setting $wgMessageCacheType = CACHE_NONE; in your LocalSettings.php will help.

37.1.253.18 (talkcontribs)

I could not work on this during several months, but I thank you for your help.

In the meantime, while installing another extension, I had problems with URL prefixes because I use :

$wgServer = "//my.domain.com";

$wgCanonicalServer = "https://my.domain.com";

Which should allowed.

Could this be the cause ?

Anyway, I'll try to update to the latest version and reinstall parsoid and VisualEditor from Scratch.

And if I still have problems, I'll give a try to $wgMessageCacheType = CACHE_NONE;

Cscott (talkcontribs)

Yes, I believe that Parsoid correctly supports protocol-relative URLs. In this case it will try to make the connection using https, I believe, so you might want to double-check that your SSL certificates are valid as well. Let us know how it goes.