Topic on Project:Support desk

Error loading data from server: 404: parsoidserver-http: HTTP 404

18
Hvdeynde (talkcontribs)

Environment:

OS: Ubuntu 14.04.4 LTS

MediaWiki: 1.26.2

wiki url: http://intranet.hit.local/wiki-hitit/

parsoid listener port: 8142

After a good day of trying to set up VirtualEditor, the above error is still with us.

I think I followed the instructions in

- https://www.mediawiki.org/wiki/Extension:VisualEditor

- https://www.mediawiki.org/wiki/Parsoid/Setup

though, I'm still uncertain about the url/uri.

/var/www/html/wiki-hitit/LocalSettings.php has the following entries for VisualEditor:

### VisualEditor

require_once( "$IP/extensions/VisualEditor/VisualEditor.php" );

$wgDefaultUserOptions['visualeditor-enable'] = 1;

$wgSessionsInObjectCache = true;

$wgVirtualRestConfig['modules']['parsoid'] = array(

'url' => 'http://localhost:8142/wiki-hitit/',

'prefix' => 'wiki-hitit'

);

/etc/mediawiki/parsoid/localsettings.js has the following entries:

'use strict';

exports.setup = function(parsoidConfig) {

parsoidConfig.setMwApi({ prefix: 'wiki-hitit', uri: 'http://localhost/wiki-hitit/api.php' });

parsoidConfig.useSelser = true;

};

/var/www/html/wiki-hitit/extensions/parsoid/localsettings.js has these:

'use strict';

exports.setup = function(parsoidConfig) {

parsoidConfig.setMwApi({

prefix: 'wiki-hitit', // optional

uri: 'http://localhost/wiki-hitit/api.php' });

parsoidConfig.useSelser = true;

};

The api.php is accessible:

$ curl 'http://localhost/wiki-hitit/api.php' | head

% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

Dload  Upload   Total   Spent    Left  Speed

0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0

<!DOCTYPE html>

<html lang="en" dir="ltr" class="client-nojs">

<head>

<meta charset="UTF-8" />

<title>MediaWiki API help - Hitit</title>

The wiki pages now have both an 'edit' and an 'edit source' tab.  But when you press the 'edit' tab, you get a pop-up with this error message:

"Error loading data from server: 404: parsoidserver-http: HTTP 404. Would you like to retry?"

I've found several articles about this issue, but none that helped.

Is the url/uri definition correct? (All examples I found used simple urls.)

Are there any log files I can check?  I tried the parsoid and apache2 logs, but there's nothing there.

Any other suggestions?

Kind regards,

Herta

Ciencia Al Poder (talkcontribs)

There's a 404 error somewhere, try to find in apache error logs the URL being requested, that should give you a hint what configuration is wrong. Maybe you need to omit the "prefix" configuration part

Hvdeynde (talkcontribs)

Thanks for your reply.

There's nothing in the apache error log. The access log has this entry:

10.32.14.57 - - [29/Feb/2016:09:59:13 +0100] "GET /wiki-hitit/api.php?action=visualeditor&format=json&paction=parse&page=Main_Page&uselang=en HTTP/1.1" 200 511 "http://intranet.hit.local/wiki-hitit/index.php/Main_Page?veaction=edit" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:44.0) Gecko/20100101 Firefox/44.0"

10.32.14.57 - - [29/Feb/2016:09:59:13 +0100] "GET /wiki-hitit/load.php?debug=false&lang=en&modules=ext.visualEditor.base%2Ccore%2Cdata%2CdesktopArticleTarget%2Cicons%2Clanguage%2Cmediawiki%2Cmwalienextension%2Cmwcore%2Cmwformatting%2Cmwgallery%2Cmwimage%2Cmwlink%2Cmwmeta%2Cmwreference%2Cmwtransclusion%7Cext.visualEditor.core.desktop%7Cext.visualEditor.mwimage.core%7Cext.visualEditor.mwreference.core%7Cext.visualEditor.mwtransclusion.core%7Cjquery.autoEllipsis%2CbyteLimit%7Cjquery.uls.data%7Cmediawiki.ForeignApi%2Cwidgets%7Cmediawiki.ForeignApi.core%7Cmediawiki.action.history.diff%7Cmediawiki.api.options%7Cmediawiki.language.names%2CspecialCharacters%7Cmediawiki.page.gallery.styles%7Cmediawiki.skinning.content.parsoid%7Cmediawiki.widgets.CategorySelector%2Cstyles%7Cmoment%2Coojs%2Coojs-ui%2Cpapaparse%2Crangefix%2Cunicodejs%7Coojs-ui.styles%7Coojs-ui.styles.icons%2Cicons-editing-advanced%2Cicons-editing-core%2Cicons-editing-list%2Cicons-editing-styling%2Cindicators%2Ctextures&skin=monobook&version=10061a186059 HTTP/1.1" 200 2196466 "http://intranet.hit.local/wiki-hitit/index.php/Main_Page?veaction=edit" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:44.0) Gecko/20100101 Firefox/44.0"

Hvdeynde (talkcontribs)

P.S. I removed the prefix from the three config files and restarted parsoid and apache2, but the error remains.

Swennet (talkcontribs)

I think the URI in your LocalSettings.php file should be

'url' => 'http://localhost:8142'

.

So without the

/wiki-hiti/

part. Let us know if that works :)

Hvdeynde (talkcontribs)

After much trial and error, that is indeed what fixed it.

Thanks, Swennet.

Andreyshade84 (talkcontribs)

@Hvdeynde, how you solve this issue? Pleace post your config files

143.196.159.101 (talkcontribs)

Hello all,

After spending a LOT of time to let VisualEditor extension be able to work on my Wiki (I tried every possibilities for both parsoid setting file and LocalSettings file), I finally found a simple conf that actually works for me. So, that's what I am sharing below.

For your information :

-running on Debian,

-mediawiki 1.26.2,

-wiki's name si WikiName,

-it's located in /var/www/WikiName,

-IP adress of my wiki is IP_adress (like 123.123.123.123).

In /etc/mediawiki/parsoid/setting.js, what has changed from the original file is following below:

parsoidConfig.setMwApi({ prefix: 'IP_adress', uri: 'http://IP_adress/WikiName/api.php' );

In LocalSettings.php:

$wgVirtualRestConfig[‘modules’][‘parsoid’] = array(

           

‘url’ => ‘http://IP_adress:8142’

);

Everything else is useless for me (like domain for instance). I think that 'Localhost' is not working on recent wiki (my visual editor was not working since I updated my wiki), that's why I think you should try to put some IP adress of yours to make it work insteasd of localhost.

I hope it will help a few of you!

@+

KrazyMax

143.196.159.101 (talkcontribs)

Sorry for the bad layout, looked much better before it was actually posted!

KrazyMax

YasoKuuhl42 (talkcontribs)

Hello,

it dosnt work to me.

MediaWiki 1.28.0

i become 404

LocalConfig.php:

wfLoadExtension( 'VisualEditor' );

// Enable by default for everybody $wgDefaultUserOptions['visualeditor-enable'] = 1;

// Optional: Set VisualEditor as the default for anonymous users // otherwise they will have to switch to VE // $wgDefaultUserOptions['visualeditor-editor'] = "visualeditor";

// Don't allow users to disable it $wgHiddenPrefs[] = 'visualeditor-enable';

// OPTIONAL: Enable VisualEditor's experimental code features

$wgDefaultUserOptions['visualeditor-enable-experimental'] = 1;

$wgVirtualRestConfig['modules']['parsoid'] = array(

      // URL to the Parsoid instance
      // Use port 8142 if you use the Debian package
      'url' => 'http://XXX.XXX.XXX.XXX:8142',
      // Parsoid "domain", see below (optional)
      //'domain' => 'XXX',
      // Parsoid "prefix", see below (optional)
      //'prefix' => 'XXX'

);

localsettings.js:

parsoidConfig.setInterwiki( { prefix: 'XXX.XXX.XXX.XXX', uri: 'http://XXX.XXX.XXX.XXX/mediawiki/api.php' } );

Ciencia Al Poder (talkcontribs)

From previous messages I see the config is parsoidConfig.setMwApi, not parsoidConfig.setInterwiki. Can you check that's correct?

YasoKuuhl42 (talkcontribs)
Ciencia Al Poder (talkcontribs)
YasoKuuhl42 (talkcontribs)

yes

YasoKuuhl42 (talkcontribs)

Other ideas?

Ciencia Al Poder (talkcontribs)
172.251.84.63 (talkcontribs)

Note:

I got this exact error due to putting a forward slash at the end of the Parsoid URI. In other words, http://localhost:8142/ caused the error, and changing it to http://localhost:8142 fixed it.

This is what it looks like in my MediaWiki 1.28 LocalSettings.php--this works!

# Visual Editor

require_once("$IP/extensions/VisualEditor/VisualEditor.php");

$wgDefaultUserOptions['visualeditor-enable'] = 1;

$wgHiddenPrefs[] = 'visualeditor-enable';

$wgVisualEditorParsoidURL = 'http://localhost:8142';

$wgVirtualRestConfig['modules']['parsoid'] = array(

        'url' => 'http://localhost:8142',

        'domain' => 'localhost'

);

TerraBase (talkcontribs)

...sometimes it's the simple things too. Have you checked your Apache, HTTPD (or whatever web server your using) configuration files? Read this; MediaWiki Visual Editor Parsoid 404 Error.

Sorry for re-opening this closed issue, but in all the reading I did on all the different sites that address this issue, no one actually came out and said check the web server configuration. Yes it seems obvious in hind site to me, but while working the problem, I became so fixated on the Mediawiki and Parsoid stuff, the 'basics' never crossed my mind. I also posted here because this page happens to be first in the Google search results.