Jump to content

Topic on Extension talk:VisualEditor

Couldn't connect to server: parsoidserver-http-error: (curl error: 7)

23
Swennet (talkcontribs)

Hello, I have reinstalled MediaWiki recently since I wanted to update from 1.25.3 to 1.26.0. I had VisualEditor installed and working properly on my previous install of MediaWiki, but after updating (read: Full re-install of MediaWiki) it does not seem to work anymore.

When I click on Edit the VisualEditor loading bar appears but at around 25% it stops and gives me the following error:

"Error loading data from server: (curl error: 7) Couldn't connect to server: parsoidserver-http-error: (curl error: 7) Couldn't connect to server. Would you like to retry?"

I updated both the VisualEditor extension and did a full reinstall of Parsoid (to my knowledge) after VisualEditor stopped working but I still get the same error.

In my LocalSettings.php I have the following:

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

// Enable by default for everybody

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

// Don't allow users to disable it

$wgHiddenPrefs[] = 'visualeditor-enable';

// OPTIONAL: Enable VisualEditor's experimental code features

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

In my /etc/mediawiki/parsoid/settings.js I have the following:

parsoidConfig.setMwApi({ prefix: 'localhost', uri: 'http://mydomain.com/w/api.php', domain: 'mydomain.com'});

My log located at /var/log/parsoid/parsoid.log does not update when this error is created.

I run Ubuntu 14.04 and have Node.js installed.

Sorenweber (talkcontribs)

I have the same issue and configuration, trying to install 1.26.0 from scratch.

Swennet (talkcontribs)

@Sorenweber Did you manage to get it working?

88.109.25.153 (talkcontribs)

@Swennet, I can't see in your snippet where you're telling VisualEditor the URL of your Parsoid instance...

Check this section to make sure your setting is correct: Extension:VisualEditor#Linking with Parsoid using $wgVirtualRestConfig

92.110.165.206 (talkcontribs)

@88.109.25.153

I did not include that snippet since I have 5 of them, each for a separate Wiki database. I am certain that it was set up correctly since it worked perfectly fine on 1.25.3. So far I have not yet found a solution and ended up simply restoring my 1.25.3 installation. I will re-try sometime in the future since I do not want to update MediaWiki once my website is completed.

173.13.64.171 (talkcontribs)

Has anyone found a solution to this? I am having the same problem:

1.25.3 Visual Editor works fine

1.26.2 Visual Editor loads 75% then fails with this message in the log:

[caches] LocalisationCache: using store LCStoreDB

[MessageCache] MessageCache::load: Loading en... local cache is empty, global cache is expired/volatile, loading from database

[gitinfo] Computed cacheFile= for /var/lib/mediawiki-1.26.2/extensions/VisualEditor-1.26

[gitinfo] Cache incomplete for /var/lib/mediawiki-1.26.2/extensions/VisualEditor-1.26

[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.

Mpconnick (talkcontribs)

It's working for me using MediaWiki 1.26.2 and these settings in LocalSettings.php:

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

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

$wgDefaultUserOptions['minordefault'] = 1;

$wgHiddenPrefs[] = 'visualeditor-enable';

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

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

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

  'domain' => 'localhost',

  'prefix' => 'core_wiki'

);

And these settings in Parsoid localsettings.js:

parsoidConfig.setMwApi({

                prefix: 'core_wiki', // optional

                domain: 'localhost', // optional

                uri: 'http://localhost/api.php',

        });

77.154.204.235 (talkcontribs)

for version 0.3.0. change options format for setMwApi

Your cmd : parsoidConfig.setMwApi({prefix: 'core_wiki', domain: 'localhost', uri: 'http://localhost/api.php' });

new cmd : parsoidConfig.setMwApi( 'core_wiki', {domain: 'localhost', uri: 'http://localhost/api.php' });

...

see line 377 in file "/usr/lib/parsoid/src/lib/mediawiki.ParsoidConfig.js", method ParsoidConfig.prototype.setMwApi,...

Swennet (talkcontribs)

Hi everyone, it's working fine on 1.26.2 now. Not entirely sure what I did wrong, maybe it was a bug in 1.26.0...

My format right now is:

parsoidConfig.setMwApi({ prefix: 'main', uri: 'http://domain.com/w/api.php' });

parsoidConfig.setMwApi({ prefix: 'secondary', uri: 'http://secondary.domain.com/w/api.php' });

Thank you to everyone that helped :)

Nita1577 (talkcontribs)

Hi everyone,

I have follow the instruction on

Parsoid/Developer Setup#Quick start

My Environment is

1.Windows server 2012

2.xampp-win32-5.6.19-0-VC11

3.Media-Wiki 1.26.2

4.VisualEditor 1.26

5.git

6.Curl 7.47.1

7.VS2010

8.node-v4.4.0-x64

9.python-2.7.11

10. parsoid

When I want to active VisualEditor , It pop's up the error

(curl error:28)Timeout was reached:parsoidserver-http-error: (curl error:28) Timeout was reached,

Do you want to retry?

After retry many times still fail to active VisualEditor.

Swennet (talkcontribs)

Hi Nita,

I think you shouldn't follow the developer instructions for Parsoid unless you intent to help develop the software itself.

As stated on the Extension:VisualEditor page:

The master branch requires alpha builds of MediaWiki (currently, 1.27.0-wmf8) and will not work with the older, official releases of MediaWiki like 1.26.2; for that, use the REL1_26 branch (command: git clone -b REL1_26 https://gerrit.wikimedia.org/r/p/mediawiki/extensions/VisualEditor.git).

Basically, if you want to install Parsoid the "Developer" way, then you need to work with the latest development builds of MediaWiki and VisualEditor.

Flyingadrian (talkcontribs)

Hi

I’m having a similar problem “Couldn’t connect to server: parsoidserver-http-error: (curl error: 7)”

Firstly I’m new to using MediaWiki, VisualEditor and Parsoid although I’m very familiar with Linux OS over many years.  I’ve installed the above on to Linux workstation running Centos 6.5 as follow:

  1. MediaWiki from mediawiki-1.26.2.tar
  2. VisualEditor from VisualEditor-REL1_26-a733545.tar
  3. Parsoid from https://gerrit.wikimedia.org/r/p/mediawiki/services/parsoid

This Linux workstation is known to our LAN as “carme”

URL to my wiki is              http://carme/w

Path to my wiki is             /var/www/html/w

After configured Localsetting.js I started the parsoid service as follows:

cd /opt/parsoid

node bin/server.js

I get the following message:

[info][master][6165] initializing 5 workers

[info][worker][6167] loading ...

[info][worker][6170] loading ...

[info][worker][6169] loading ...

[info][worker][6172] loading ...

[info][worker][6167] ready on :8000

[info][worker][6174] loading ...

[info][worker][6170] ready on :8000

[info][worker][6169] ready on :8000

[info][worker][6172] ready on :8000

[info][worker][6174] ready on :8000


So it looks like parsoid service is functioning and in a Chrome browser on window pc within the same LAN if I enter:

http://carme:8000

I get the following page (between ==== ) displayed:

====

Welcome to the Parsoid web service.

See the API documentation on mediawiki.org.

There are also some convenient tools for experiments. These are not part of the public API.

====

And if I click these links and follow the instructions it all appears to work as expected.

On my wiki I can see the default main page http://carme/w/index.php/Main_Page with both the “Edit” and “Edit source” tabs displayed.  So it looks like my mediawiki is using the VisualEditor extension.  If on this page I click the “Edit” tab I get a progress bar but before it completes I get an error message box displaying:

carme says:

Error loading data from server: (curl error: 7) parsoidserver-http-error: (curl error: 7). Would you like to retry.

Also if I try to create a new page by entering: http://carme/w/index.php/New_test I get a “Create” and “Create source” tab. If I click “Create” tab then I get VisualEditor interface allowing me to create my new test page.  The VisualEditor appears to work as expected.  However when I do to Save page I get message box saying:

Something went wrong

Parsoidserver-http-error: (curl error: 7)

I think the problem is something to do with the configuration between Mediawiki, VisualEditor and Parsoid but I can’t seem to work it out.  I can provide configuration for Localsetting.php and localsettings.js if that would help.

I would be very grateful for any help that offered.

Swennet (talkcontribs)

@Flyingadrian

Parsoid and VisualEditor runs on port 8142 on Debian servers. Did you intentionally change this port or did you enter it incorrectly? Try using port 8142 and see if it works :)

Flyingadrian (talkcontribs)

Thanks Swennet for your input.

My Mediawiki, Parsoid and VisualEditor is installed on a Workstation running Cento 6.5 not Debian. I understand that for a Centos installation the default port is 8000. I can get Parsoid to work on port 8000 by entering http://carme:8000. I can also get VisualEditor to work on a new wiki page by entering http://carme/w/New_page. However, I can't get seem to get VisualEditor to communicate with Parsoid.

Swennet (talkcontribs)

@Flyingadrian

Sorry, I was under the impression that they were one and the same. Providing us with your Localsettings.php and Localsettings.js would definitely help troubleshooting the problem.

Flyingadrian (talkcontribs)

Thanks for your help. I'm sure it is a configuration problem somewhere. Anyway here is the code I've added to my wiki LocalSetting.php file relating to VisualEditor and Parsoid:

 # =======================================================================
 # This VisualEditor extension block has been added by ALB 31 Mar 2016 from code snippet found in:
 # https://www.mediawiki.org/wiki/Extension:VisualEditor
 #
 #
 require_once "$IP/extensions/VisualEditor/VisualEditor.php";
 // Enable by default for everybody
 $wgDefaultUserOptions['visualeditor-enable'] = 1;
 // Don't allow users to disable it
 $wgHiddenPrefs[] = 'visualeditor-enable';
 // OPTIONAL: Enable VisualEditor's experimental code features
 $wgDefaultUserOptions['visualeditor-enable-experimental'] = 1;
 $wgVisualEditorParsoidURL = 'http://carme:8000';
 // if you have a private wiki you will need these lines to enable parsoid to access
 // the mediawiki api (these settings must follow all other group permission settings)
 if ( $_SERVER['REMOTE_ADDR'] == 'carme' ) {
 $wgGroupPermissions['*']['read'] = true;
 $wgGroupPermissions['*']['edit'] = true;
 }
 # VisualEditor extension block end
 # ========================================================================
 # =======================================================================
 # This block has been added to get VisualEditor to talk to Parsoid has been added by ALB 01 Apr 2016 from
 # code snippet found in:
 # https://www.mediawiki.org/wiki/Extension:VisualEditor
 #
 $wgVirtualRestConfig['modules']['parsoid'] = array(
 // URL to the Parsoid instance
 // Use port 8142 if you use the Debian package
 // 'url' => 'http://localhost:8000',
 'url' => 'http://carme:8000',
 // Parsoid "domain", see below (optional)
 'domain' => 'carme',
 // Parsoid "prefix", see below (optional)
 'prefix' => 'carme'
 );
 # End Linking VisualEditor to talk to Parsoid
 # ========================================================================

Below is the code I've added to my localsetting.js file

/*
* This is a sample configuration file.
*
* Copy this file to localsettings.js and edit that file to fit your needs.
*
* Also see:
* - api/server.js for more information about passing config files via
*   the commandline.
* - lib/mediawiki.ParsoidConfig.js all the properties
*   that you can configure here. Not all properties are
*   documented here.
*/
'use strict';
exports.setup = function(parsoidConfig) {
// Set your own user-agent string
// Otherwise, defaults to "Parsoid/<current-version-defined-in-package.json>"
//parsoidConfig.userAgent = "My-User-Agent-String";
// Configure Parsoid to point to your MediaWiki instance.
parsoidConfig.setMwApi({uri: 'http://carme/w/api.php', domain: 'carme', prefix: 'main' } );


I feel sure it is something simple as independently my mediawiki, VisualEditor and Parsoid are working. Anyway thanks again for any help you can offer.

Swennet (talkcontribs)

@Flyingadrian No problem, sharing the knowledge what it's all about!

I don't know 100% sure if this is this issue, but I'd like you to try something which worked for me.


In your LocalSettings.php:

Comment out the parsoid domain line 'domain' => 'carme',.


Then in your LocalSettings.js:

Edit your parsoidConfig.setMwApi setting to so that the prefix value comes before the url, and delete the domain setting altogether.

parsoidConfig.setMwApi({prefix: 'main', uri: 'http://carme/w/api.php' } );


Now see if it works for you (don't forget to restart the Parsoid service on your server!)

I'm not sure if the problem is with the location of the prefix setting in LocalSettings.js, or if the issue is with the domain setting, but it worked for me. Note that the domain setting doesn't actually do anything (as far as I know), so omitting it shouldn't affect you in any way.

Let me know if that worked for you :)

Cirselrac (talkcontribs)

@Flyingadrian it work for me on centos 7 with this config :

/opt/parsoid/localsettings.js

'use strict'; exports.setup = function(parsoidConfig) { parsoidConfig.setMwApi('core_wiki', { uri: '<nowiki>http://localhost/api.php'</nowiki> }); };
/var/www/html/LocalSettings.php
require_once "$IP/extensions/VisualEditor/VisualEditor.php"; // Enable by default for everybody $wgDefaultUserOptions['visualeditor-enable'] = 1; // Don't allow users to disable it $wgHiddenPrefs[] = 'visualeditor-enable'; // OPTIONAL: Enable VisualEditor's experimental code features $wgDefaultUserOptions['visualeditor-enable-experimental'] = 1; # Linking with Parsoid $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' => 'core_wiki' );

when I start parsoid i just get deprecated warning but visual editor work

/usr/bin/node /opt/parsoid/bin/server.js

String arguments to ParsoidConfig#setMwApi are deprecated: core_wiki

[info][master][17699] initializing 11 workers

String arguments to ParsoidConfig#setMwApi are deprecated: core_wiki

[info][worker][17708] loading ...

[info][worker][17712] loading ...

[info][worker][17708] ready on :8000

unfortunately I have to run parsoid in terminal every time before starting visual editor to prevent parsoidserver-http-error: (curl error: 7)

I think I probably make an error in the /etc/systemd/system/parsoid.service file but I have put ExecStart=/usr/bin/node /opt/parsoid/bin/server.js and I dont understand where is the problem here.

Cirselrac (talkcontribs)

I found the solution : I forgot to enable the Parsoid-daemon to start on boot time:

systemctl enable parsoid.service

now visual editor work well for me in centos7

Flyingadrian (talkcontribs)

Sorry I haven't responded for several days but I had to drop trying to resolve my problem here to attend to other business matters.

Anyway, I've managed to solve my problem, well at least get around it. I'm running Centos 6.5 and SELinux was set to enforcing. This is an internal server and we don't really need enhanced security. Anyway, if I modify my /etc/selinux/config file to set SELINUX=permissive my curl error: 7 problem goes away and I can now get VisualEditor to work with my wiki. There is probably another way to stop SELinux from blocking port 8000 connections but I've spent too much time on this problem already so happy to live with my solution.

I would like to thank everyone for all the help and in particular the suggestions from @Swennet and @Cirselrac. Much appreciated.

NitaiDas (talkcontribs)

In my case also, i checked the boot process and found that while it was configured to start on boot, it was not running at the moment. I also could not start it, but for somer reason first stopping, then starting worked.

Chebbycraft34 (talkcontribs)

I cannot use the visual editor on the rest of miraheze, because it keep on stopping, so i will be moving to a new account next day.

Error loading data from server: apierror-visualeditor-docserver-http-error: (curl error: 52) Server returned nothing (no headers, no data). Would you like to retry?

93.188.143.2 (talkcontribs)

Worked for me downloading and installing another visual editor (mediawiki version 1.35.1) called TinyMCE, and disabling VisualEditor on LocalSettings.php; just deleting or commenting line wfLoadExtension ( 'VisualEditor' );

Reply to "Couldn't connect to server: parsoidserver-http-error: (curl error: 7)"