Topic on Extension talk:VisualEditor

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

9
Escalatr (talkcontribs)

Hello, Visual Editor cannot connect to Parsoid properly, the web browser displays the message Error loading data from server: 404: parsoidserver-http: HTTP 404.

The mediawiki is running inside an intranet at http://172.18.200.40/himtwiki/, I have disabled short URLs for now, it is a private wiki.

$wgGroupPermissions['*'    ]['read']            = false;
  • The system is running on openSUSE 13.1 (Bottle) (x86_64).
  • MediaWiki: 1.25
  • Parsoid: 0.6.1 / 2016-11-14
  • NodeJS: v4.2.4

Parsoid

  • I followed the steps from Parsoid/Developer Setup
  • Parsoid resides in /root/parsoid/ for testing now
  • Created config.yaml as following:
        # Configure Parsoid to point to your MediaWiki instances.
        mwApis:
        - # This is the only required parameter,
          # the URL of you MediaWiki API endpoint.
          uri: 'http://172.18.200.40/himtwiki/api.php'
          # The "domain" is used for communication with Visual Editor
          # and RESTBase.  It defaults to the hostname portion of
          # the `uri` property below, but you can manually set it
          # to an arbitrary string.
          domain: 'localhost'  # optional
          prefix: 'localhost'
  • Service is running node bin/server.js
  • Command line output:
{"name":"parsoid","hostname":"server223","pid":793,"level":30,"levelPath":"info/service-runner","msg":"master(793) initializing 4 workers","time":"2017-02-07T13:08:11.107Z","v":0}
{"name":"lib/index.js","hostname":"server223","pid":802,"level":30,"levelPath":"info","msg":"loading ...","time":"2017-02-07T13:08:11.858Z","v":0}
{"name":"lib/index.js","hostname":"server223","pid":802,"level":30,"levelPath":"info","msg":"ready on :8000","time":"2017-02-07T13:08:11.879Z","v":0}
{"name":"lib/index.js","hostname":"server223","pid":807,"level":30,"levelPath":"info","msg":"loading ...","time":"2017-02-07T13:08:12.637Z","v":0}
{"name":"lib/index.js","hostname":"server223","pid":807,"level":30,"levelPath":"info","msg":"ready on :8000","time":"2017-02-07T13:08:12.656Z","v":0}
{"name":"lib/index.js","hostname":"server223","pid":812,"level":30,"levelPath":"info","msg":"loading ...","time":"2017-02-07T13:08:13.403Z","v":0}
{"name":"lib/index.js","hostname":"server223","pid":812,"level":30,"levelPath":"info","msg":"ready on :8000","time":"2017-02-07T13:08:13.422Z","v":0}
{"name":"lib/index.js","hostname":"server223","pid":817,"level":30,"levelPath":"info","msg":"loading ...","time":"2017-02-07T13:08:14.171Z","v":0}
{"name":"lib/index.js","hostname":"server223","pid":817,"level":30,"levelPath":"info","msg":"ready on :8000","time":"2017-02-07T13:08:14.189Z","v":0}
{"name":"parsoid","hostname":"server223","pid":793,"level":40,"levelPath":"warn/service-runner","msg":"Startup finished","time":"2017-02-07T13:08:14.190Z","v":0}

Visual Editor

  • I can try to edit existing pages with the Visual Editor, but it fails with Error loading data from server: 404: parsoidserver-http: HTTP 404, now I am looking at other users´ issues with the same error, but nothing has helped so far.
  • Question: I could not really figure out, whether I really need Extension:UniversalLanguageSelector? This one fails to run with error 500.

LocalSettings.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://localhost:8000',
	// Parsoid "domain", see below (optional)
	'domain' => 'localhost',
	// Parsoid "prefix", see below (optional)
	'prefix' => 'localhost'
);
$wgSessionsInObjectCache = true;

Settings for private wiki from https://www.mediawiki.org/wiki/Extension:VisualEditor#Linking_with_Parsoid_in_private_wikis are added, I have also tried switching the wiki to public already.

// This feature requires a non-locking session store. The default session store will not work and
// will cause deadlocks (connection timeouts from Parsoid) when trying to use this feature.
$wgSessionsInObjectCache = true;

// Forward users' Cookie: headers to Parsoid. Required for private wikis (login required to read).
// If the wiki is not private (i.e. $wgGroupPermissions['*']['read'] is true) this configuration
// variable will be ignored.
//
// WARNING: ONLY enable this on private wikis and ONLY IF you understand the SECURITY IMPLICATIONS
// of sending Cookie headers to Parsoid over HTTP. For security reasons, it is strongly recommended
// that $wgVirtualRestConfig['modules']['parsoid']['url'] be pointed to localhost if this setting is enabled.
$wgVirtualRestConfig['modules']['parsoid']['forwardCookies'] = true;

Logs

  • /var/log/apache2/error_log shows
    [Wed Feb 08 14:02:15.578020 2017] [php5:error] [pid 8819] [client 172.18.241.85:52765] PHP Notice: Undefined index: prefix in /srv/www/htdocs/himtwiki/includes/libs/virtualrest/ParsoidVirtualRESTService.php on line 71, referer: http://172.18.200.40/himtwiki/index.php/Text_editor?veaction=edit
    but only if prefix is not explicitly defined
  • wiki/tmp/wiki.log
Start request GET /himtwiki/api.php?action=visualeditor&format=json&paction=parse&page=Text_editor&uselang=en
HTTP HEADERS:
HOST: 172.18.200.40
CONNECTION: keep-alive
ACCEPT: application/json, text/javascript, */*; q=0.01
X-REQUESTED-WITH: XMLHttpRequest
USER-AGENT: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36
DNT: 1
REFERER: http://172.18.200.40/himtwiki/index.php/Text_editor?veaction=edit
ACCEPT-ENCODING: gzip, deflate, sdch
ACCEPT-LANGUAGE: de,en-US;q=0.8,en;q=0.6
COOKIE: templates-used-list=expanded; himtwikiUserID=170; himtwikiUserName=Imo; himtwikiToken=adc6df740fb9cb31ba950042d64e03d6; himtwiki_session=mg4fnk3071t700afah9bliasf2fknjljfjn0di4hq0sukrv1h5v1; wikiEditor-0-toolbar-section=advanced
[caches] main: EmptyBagOStuff, message: SqlBagOStuff, parser: SqlBagOStuff
Connected to database 0 at 172.18.200.40
Connected to database 0 at 172.18.200.40
[caches] LocalisationCache: using store LCStoreDB
[caches] main: EmptyBagOStuff, message: SqlBagOStuff, parser: SqlBagOStuff
[caches] main: EmptyBagOStuff, message: SqlBagOStuff, parser: SqlBagOStuff
Unstubbing $wgParser on call of $wgParser::setHook from ExtDynamicPageList::setupDPL
Parser: using preprocessor: Preprocessor_DOM
[caches] LocalisationCache: using store LCStoreDB
[caches] LocalisationCache: using store LCStoreDB
Fully initialised
User: cache miss for user 170
[MessageCache] MessageCache::load: Loading en... got from global cache
Gadget::loadStructuredList: MediaWiki:Gadgets-definition parsed, cache entry himtwiki:gadgets-definition:7 updated
User: loading options for user 170 from database.
User: logged in from session
[visualeditor] called on 'Text editor' with paction: 'parse'
[MessageCache] MessageCache::load: Loading en... got from global cache
[MessageCache] MessageCache::load: Loading en... got from global cache
[gitinfo] Computed cacheFile= for /srv/www/htdocs/himtwiki/extensions/VisualEditor
[gitinfo] Cache incomplete for /srv/www/htdocs/himtwiki/extensions/VisualEditor
ApiMain::setCacheMode: setting cache mode private
IP: 172.18.241.85
[GlobalTitleFail] MessageCache::parse called by VisualEditorDataModule::getScript/Message::parse/Message::toString/Message::parseText/MessageCache::parse with no title set.
[GlobalTitleFail] MessageCache::parse called by VisualEditorDataModule::getScript/Message::parse/Message::toString/Message::parseText/MessageCache::parse with no title set.
[GlobalTitleFail] MessageCache::parse called by VisualEditorDataModule::getScript/Message::parse/Message::toString/Message::parseText/MessageCache::parse with no title set.
[GlobalTitleFail] MessageCache::parse called by VisualEditorDataModule::getScript/Message::parse/Message::toString/Message::parseText/MessageCache::parse with no title set.
[GlobalTitleFail] MessageCache::parse called by VisualEditorDataModule::getScript/Message::parse/Message::toString/Message::parseText/MessageCache::parse with no title set.
[GlobalTitleFail] MessageCache::parse called by VisualEditorDataModule::getScript/Message::parse/Message::toString/Message::parseText/MessageCache::parse with no title set.
[GlobalTitleFail] MessageCache::parse called by VisualEditorDataModule::getScript/Message::parse/Message::toString/Message::parseText/MessageCache::parse with no title set.


Thanks in advance

Spas.Z.Spasov (talkcontribs)

Have you checked Troubleshooting section? Could you create a new page with VE? I'm almost sure the problem is this:

Usually for new installs, this is due to "curl", "php5-curl", or "php7.0-curl" not being installed on your server.
Escalatr (talkcontribs)

I can create a new page but Visual Editor fails to save it. I have already checked the Troubleshooting section, missing curl would actually cause a different one: error 500.

r223:/etc/init.d # curl zypper search curl
Loading repository data...
Warning: Repository 'openSUSE-13.1-Update' appears to be outdated. Consider using a different mirror or server.
Reading installed packages...

S | Name                | Summary                                                  | Type
--+---------------------+----------------------------------------------------------+-----------
i | curl                | A Tool for Transferring Data from URLs                   | package
  | curl                | A Tool for Transferring Data from URLs                   | srcpackage
  | curlftpfs           | Filesystem for mounting FTP hosts using FUSE and libcurl | package
  | curlftpfs           | Filesystem for mounting FTP hosts using FUSE and libcurl | srcpackage
  | flickcurl           | Command-Line Tools for the Flickr Web Service            | package
  | flickcurl           | Command-Line Tools for the Flickr Web Service            | srcpackage
  | flickcurl-doc       | C Library API to the Flickr Web Service (Documentation)  | package
  | libcurl-devel       | A Tool for Transferring Data from URLs                   | package
  | libcurl-devel-32bit | A Tool for Transferring Data from URLs                   | package
i | libcurl4            | Version 4 of cURL shared library                         | package
  | libcurl4-32bit      | Version 4 of cURL shared library                         | package
  | libflickcurl-devel  | C Library API to the Flickr Web Service                  | package
  | libflickcurl0       | C Library API to the Flickr Web Service                  | package
  | libflickcurl0-32bit | C Library API to the Flickr Web Service                  | package
  | perl-WWW-Curl       | Perl extension interface for libcurl                     | package
i | php5-curl           | PHP5 Extension Module                                    | package
i | python-pycurl       | PycURL -- cURL library module                            | package
  | python-pycurl-doc   | Documentation for python-curl                            | package
  | python3-pycurl      | PycURL -- cURL library module                            | package
  | python3-pycurl-doc  | Documentation for python-curl                            | package
  | tclcurl             | Tcl Binding to libcurl                                   | package
  | xmms2-plugin-curl   | Curl Support for xmms2                                   | package
Escalatr (talkcontribs)

According to https://www.mediawiki.org/wiki/Offline_content_generator/Installation/en#Starting I called netstat -tuln, the output:

server223:/etc/init.d # netstat -tuln
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 0.0.0.0:873             0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:6379          0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:9200            0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:9300            0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:21              0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:6556            0.0.0.0:*               LISTEN
tcp        0      0 :::8000                 :::*                    LISTEN
tcp        0      0 :::873                  :::*                    LISTEN
tcp        0      0 :::3306                 :::*                    LISTEN
tcp        0      0 :::22                   :::*                    LISTEN
udp        0      0 0.0.0.0:57053           0.0.0.0:*
udp        0      0 0.0.0.0:57231           0.0.0.0:*
udp        0      0 0.0.0.0:33014           0.0.0.0:*
udp        0      0 0.0.0.0:54328           0.0.0.0:*
udp        0      0 0.0.0.0:5353            0.0.0.0:*
udp        0      0 0.0.0.0:43376           0.0.0.0:*
udp        0      0 0.0.0.0:47603           0.0.0.0:*
udp        0      0 :::38093                :::*
udp        0      0 :::5353                 :::*
Escalatr (talkcontribs)
  • Is there any chance to debug the URL request by VisualEditor? I have already tried to trace it with Xdebug, but with no success.
  • I am comparing it with mwoffliner.js script which uses Parsoid for dumping Mediawiki content. It gives at least a more concrete message
    Unable to download content [1] http://localhost:8142/Main_Page?oldid=28384 (statusCode=404).
    In my understanding he URL is pointing to a wrong path, it should be something like http://localhost:8142/localhost/v3/page/html/Main_Page/8384 instead (?)
  • The only error messages I can find in wiki.log
    [visualeditor] called on 'Text editor' with paction: 'parse' [MessageCache] MessageCache::load: Loading en... got from global cache [MessageCache] MessageCache::load: Loading en... got from global cache [gitinfo] Computed cacheFile= for /srv/www/htdocs/himtwiki/extensions/VisualEditor [gitinfo] Cache incomplete for /srv/www/htdocs/himtwiki/extensions/VisualEditor ApiMain::setCacheMode: setting cache mode private IP: 172.18.241.85 [GlobalTitleFail] MessageCache::parse called by VisualEditorDataModule::getScript/Message::parse/Message::toString/Message::parseText/MessageCache::parse with no title set. [GlobalTitleFail] MessageCache::parse called by VisualEditorDataModule::getScript/Message::parse/Message::toString/Message::parseText/MessageCache::parse with no title set. [GlobalTitleFail] MessageCache::parse called by VisualEditorDataModule::getScript/Message::parse/Message::toString/Message::parseText/MessageCache::parse with no title set. [GlobalTitleFail] MessageCache::parse called by VisualEditorDataModule::getScript/Message::parse/Message::toString/Message::parseText/MessageCache::parse with no title set. [GlobalTitleFail] MessageCache::parse called by VisualEditorDataModule::getScript/Message::parse/Message::toString/Message::parseText/MessageCache::parse with no title set. [GlobalTitleFail] MessageCache::parse called by VisualEditorDataModule::getScript/Message::parse/Message::toString/Message::parseText/MessageCache::parse with no title set. [GlobalTitleFail] MessageCache::parse called by VisualEditorDataModule::getScript/Message::parse/Message::toString/Message::parseText/MessageCache::parse with no title set.
WeitongYan (talkcontribs)

I have the same problem, plz let me know if you fix it one day.

Escalatr (talkcontribs)

I could not fix anything yet, probably need to update Mediawiki and all the software

84.112.225.67 (talkcontribs)
8000 means that IPv6 is used (also on my ubuntu 18.04 server).

Remove the "-" in the parsoid config:

       mwApis:
       - # This is the only required parameter,

Dont know why there is a "-" in the standard-config but this is one issue ...

After that it was possible to change port and so on.

84.112.225.67 (talkcontribs)

the webside removed the ":::" at beginning ... ":::8000" means ipv6

Reply to "Parsoid error: Error loading data from server: 404: parsoidserver-http: HTTP 404"