Extension talk:VisualEditor

Jump to navigation Jump to search

About this board

Please note that the Wikimedia Foundation does not provide support for installing VisualEditor on third-party wikis. However, if you have a question we may try to help.

Synonymshawfinch (talkcontribs)

I've got shared uploads configured on my wiki and it works fine, but VisualEditor doesn't seem to take it into account. Searching for files returns nothing because there are none of the local wiki, and the upload tab returns the disabled uploads message.

Is there any way for VisualEditor to search for images on the shared uploads wiki rather than the local ones?

Thanks!

Ivan Mudrik (talkcontribs)

I have the same problem, somebody help me! :)

Ivan Mudrik (talkcontribs)

Answering my own question (see Manual:$wgForeignFileRepos):

$wgLBFactoryConf = array(

'class' => 'LBFactoryMulti',

'sectionsByDB' => array(

'dewiki' => 's1',

'enwiki' => 's1',

'eswiki' => 's1',

'frwiki' => 's1',

'hiwiki' => 's1',

'itwiki' => 's1',

'jawiki' => 's1',

'plwiki' => 's1',

'ptwiki' => 's1',

'ruwiki' => 's1',

'svwiki' => 's1',

'zhwiki' => 's1',

),

'sectionLoads' => array(

's1' => array(

'localhost'  => 0, // All on section s1, which has single master, at localhost.

),

),

'serverTemplate' => array(

'dbname'        => $wgDBname,

'user'          => $wgDBuser,

'password'      => $wgDBpassword,

'type'          => 'mysql',

'flags'         => DBO_DEFAULT,

'max lag'       => 30,

),

);

$wgForeignFileRepos[] = [

'class' => 'ForeignDBViaLBRepo',

'wiki' => 'dewiki',

'name' => 'dewiki', # displayname (eg. the vector-skin-tab “View on OtherWiki“) may be set at wiki-specific MediaWiki:Shared-repo-name-<otherwiki>

'url' => 'https://de.companypedia.net/w/images',

'directory' => '/var/www/mediawiki/wiki/w/images',

'hashLevels' => 2, # This must be the same for the other family member

'tablePrefix' => '',

'hasSharedCache' => false,

'fetchDescription' => true,

'scriptDirUrl' => 'https://de.companypedia.net/w', # has effect whether description can be fetched

];

$wgForeignFileRepos[] = [

'class' => 'ForeignDBViaLBRepo',

'wiki' => 'enwiki',

'name' => 'enwiki',

'url' => 'https://en.companypedia.net/w/images',

'directory' => '/var/www/mediawiki/wiki/w/images',

'hashLevels' => 2,

'tablePrefix' => '',

'hasSharedCache' => false,

'fetchDescription' => true,

'scriptDirUrl' => 'https://en.companypedia.net/w',

];

$wgForeignFileRepos[] = [

'class' => 'ForeignDBViaLBRepo',

'wiki' => 'eswiki',

'name' => 'eswiki',

'url' => 'https://es.companypedia.net/w/images',

'directory' => '/var/www/mediawiki/wiki/w/images',

'hashLevels' => 2,

'tablePrefix' => '',

'hasSharedCache' => false,

'fetchDescription' => true,

'scriptDirUrl' => 'https://es.companypedia.net/w',

];

$wgForeignFileRepos[] = [

'class' => 'ForeignDBViaLBRepo',

'wiki' => 'frwiki',

'name' => 'frwiki',

'url' => 'https://fr.companypedia.net/w/images',

'directory' => '/var/www/mediawiki/wiki/w/images',

'hashLevels' => 2,

'tablePrefix' => '',

'hasSharedCache' => false,

'fetchDescription' => true,

'scriptDirUrl' => 'https://fr.companypedia.net/w',

];

$wgForeignFileRepos[] = [

'class' => 'ForeignDBViaLBRepo',

'wiki' => 'hiwiki',

'name' => 'hiwiki',

'url' => 'https://hi.companypedia.net/w/images',

'directory' => '/var/www/mediawiki/wiki/w/images',

'hashLevels' => 2,

'tablePrefix' => '',

'hasSharedCache' => false,

'fetchDescription' => true,

'scriptDirUrl' => 'https://hi.companypedia.net/w',

];

$wgForeignFileRepos[] = [

'class' => 'ForeignDBViaLBRepo',

'wiki' => 'itwiki',

'name' => 'itwiki',

'url' => 'https://it.companypedia.net/w/images',

'directory' => '/var/www/mediawiki/wiki/w/images',

'hashLevels' => 2,

'tablePrefix' => '',

'hasSharedCache' => false,

'fetchDescription' => true,

'scriptDirUrl' => 'https://it.companypedia.net/w',

];

$wgForeignFileRepos[] = [

'class' => 'ForeignDBViaLBRepo',

'wiki' => 'jawiki',

'name' => 'jawiki',

'url' => 'https://ja.companypedia.net/w/images',

'directory' => '/var/www/mediawiki/wiki/w/images',

'hashLevels' => 2,

'tablePrefix' => '',

'hasSharedCache' => false,

'fetchDescription' => true,

'scriptDirUrl' => 'https://ja.companypedia.net/w',

];

$wgForeignFileRepos[] = [

'class' => 'ForeignDBViaLBRepo',

'wiki' => 'plwiki',

'name' => 'plwiki',

'url' => 'https://pl.companypedia.net/w/images',

'directory' => '/var/www/mediawiki/wiki/w/images',

'hashLevels' => 2,

'tablePrefix' => '',

'hasSharedCache' => false,

'fetchDescription' => true,

'scriptDirUrl' => 'https://pl.companypedia.net/w',

];

$wgForeignFileRepos[] = [

'class' => 'ForeignDBViaLBRepo',

'wiki' => 'ptwiki',

'name' => 'ptwiki',

'url' => 'https://pt.companypedia.net/w/images',

'directory' => '/var/www/mediawiki/wiki/w/images',

'hashLevels' => 2,

'tablePrefix' => '',

'hasSharedCache' => false,

'fetchDescription' => true,

'scriptDirUrl' => 'https://pt.companypedia.net/w',

];

$wgForeignFileRepos[] = [

'class' => 'ForeignDBViaLBRepo',

'wiki' => 'ruwiki',

'name' => 'ruwiki',

'url' => 'https://ru.companypedia.net/w/images',

'directory' => '/var/www/mediawiki/wiki/w/images',

'hashLevels' => 2,

'tablePrefix' => '',

'hasSharedCache' => false,

'fetchDescription' => true,

'scriptDirUrl' => 'https://ru.companypedia.net/w',

];

$wgForeignFileRepos[] = [

'class' => 'ForeignDBViaLBRepo',

'wiki' => 'svwiki',

'name' => 'svwiki',

'url' => 'https://sv.companypedia.net/w/images',

'directory' => '/var/www/mediawiki/wiki/w/images',

'hashLevels' => 2,

'tablePrefix' => '',

'hasSharedCache' => false,

'fetchDescription' => true,

'scriptDirUrl' => 'https://sv.companypedia.net/w',

];

$wgForeignFileRepos[] = [

'class' => 'ForeignDBViaLBRepo',

'wiki' => 'zhwiki',

'name' => 'zhwiki',

'url' => 'https://zh.companypedia.net/w/images',

'directory' => '/var/www/mediawiki/wiki/w/images',

'hashLevels' => 2,

'tablePrefix' => '',

'hasSharedCache' => false,

'fetchDescription' => true,

'scriptDirUrl' => 'https://zh.companypedia.net/w',

];

Reply to "VisualEditor and shared uploads"

[Yes, I read other topic]Error loading data from server: apierror-visualeditor-docserver-http: HTTP 404

1
Demer Nkardaz (talkcontribs)

But other topics not help me with fixing this error

UPD-1: ⧼abusefilter-warning-linkspam⧽, I change some parts of "links" for not this posting warning


I have this error, parsoid installed on C:/Users/_PROFILE_NAME_/node_modules

MediaWiki on local server - OpenServer

Config.Yaml :

mwApis:

uri: 'http : // *** .net/w/api.php'

domain: 'localhost' ( and I have try domain: '*** .net' )

serverPort: 8000

LocalSettings.PHP :

variant 1:

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

  'url' => 'http: // *** .net',

);

variant 2:

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

   'url' => 'http : // *** .net',

   'domain' => 'localhost',

   'prefix' => 'localhost'

);

F12 console can't help, this not display domains errors for me

Reply to "[Yes, I read other topic]Error loading data from server: apierror-visualeditor-docserver-http: HTTP 404"

Every template on a page displayed as puzzle icon

2
2001:1AB8:2:0:B489:945B:6110:2041 (talkcontribs)
2001:1AB8:2:0:34BF:7FF0:3654:7947 (talkcontribs)

For anyone dealing with this : parsoid logs were filled with "non-200 response: 302" "Error: Template Expansion failure". It was because of HTTP to HTTPS redirect settings of the site. A fix was to alter apache config to not redirect on localhost. More on this problem here : https://phabricator.wikimedia.org/T65613

Reply to "Every template on a page displayed as puzzle icon"
TieMichael (talkcontribs)

I need some help configuring LocalSettings.php for getting Restbase working with VisualEditor.

If I stop the Restbase-service, and remove according entries from LocalSettings.php, I am able to use VisualEditor, able to switch from VE to 'EditSource', but not able to switch back to VE without discarding any changes. So it seems Parsoid is installed properly.

If I start the Restbase-Server and enable to settings in LocalSettings.php, I am unable to open VE, I receive the Message 'Error loading data from server: Could not connect to the server'.

The RestBase installation seems ok, as 'http://localhost:7231/localhost/v1/' and 'http://my_internal_serverip:7231/localhost/v1/' is working.

Accessing mediawiki from a client, Firefox tells me that I am trying to access 'http://localhost:7231/localhost/v1/' - which imho does not make sense, as this 'localhost' is refering to my PC, but should refer to the server. Firefox console also tells me: Blocked loading mixed active content “http://localhost:7231/localhost/v1/page/html/File?redirect=false”

Here is my configuration: Server running Ubuntu 16.04 with a private Mediawiki 1.28 installed. Parsoid, CXserver, Restbase are on the same server. Access to the Mediawiki is (only) via 'https://wiki.mypage.com/Main_Page'. Parsoid is 'seeing' the wiki via 'https://wiki.mypage.com:8243' with no problem.

Here is relevant part from my Localsettings.php:

$wgVisualEditorParsoidURL = 'https://wiki.mypage.com::8143';
$wgVisualEditorParsoidPrefix = 'localhost';
$wgVisualEditorParsoidForwardCookies = false;
$wgVisualEditorRestbaseURL = "http://localhost:7231/localhost/v1/page/html/";
$wgVisualEditorFullRestbaseURL = "http://localhost:7231/localhost/";
$wgVirtualRestConfig['modules']['parsoid'] = array(
        'url' => 'https://wiki.mypage.com:8143',
        'domain' => 'localhost',
        'prefix' => 'localhost' );

$wgSessionsInObjectCache = false;
$wgVirtualRestConfig['modules']['parsoid']['forwardCookies'] = false;
$wgVirtualRestConfig['modules']['restbase'] = array(
	'url' => 'http://localhost:7231',
	'domain' => 'localhost',
	'forwardCookies' => false,
	'parsoidCompat' => false );

Thanks for your help!

TieMichael (talk) 14:08, 3 March 2017 (UTC)

John p new (talkcontribs)

The key here is the message in your Firefox console: "Blocked loading mixed active content." You are running MediaWiki through SSL, but the server is making an unsecured RESTBase request to http://localhost:7231/... It looks as if you already run stunnel because you are serving Parsoid through SSL port 8143, so run RESTBase via stunnel through SSL port 7232. Of course, change all the references to port :7231 to port :7232.

Seb35 (talkcontribs)

Many thanks for this remark, I had a test wiki on HTTPS and got the error "Error loading data from server: Could not connect to the server" when switching WT -> VE. After severe doubts in my configuration given the sparse documentation, I thought it was because Restbase was only accessible on IPv6 in my installation, but indeed the issue was the mixed-content HTTPS (I thought Firefox would emit an alert but it (almost) silently refuse the connection, there is only this message in the console).

46.166.190.204 (talkcontribs)

If the MediaWiki is just accessed locally, then SSL is of no use, so instead of configuring RESTBase with SSL, you might want to just use plain HTTP for all other services.

If you, however, want to remotely access MediaWiki, then

>> $wgVisualEditorRestbaseURL = "http://localhost:7231/localhost/v1/page/html/";

needs to be modified; it defines the URL used by the client (e.g., Firefox) to access the RESTBase server directly, and "localhost" needs to be changed to a remotely accessible FQDN / IP address to make it work.

The comment by John p new would still apply.

(At least this is how I understood it — someone correct me if I am wrong.)

TieMichael (talkcontribs)

Thank you for our recommendation! If passible I'd like to access the wiki also remotely.

I changed the 3 instances in my Localhost.php but did not touch the Restbase config.yaml:


$wgVisualEditorRestbaseURL = "https://wiki.mypage.com:7232/localhost/v1/page/html/";
$wgVisualEditorFullRestbaseURL = "https://wiki.mypage.com:7232/localhost/";
$wgVirtualRestConfig['modules']['restbase'] = array(
	'url' => 'https://wiki.mypage.com:7232',
	'domain' => 'localhost',
	'forwardCookies' => false,
	'parsoidCompat' => false );

but, something is still wrong. I am able to access Restbase via https://wiki.mypage.com:7232/localhost/v1/.

When using VE, Firefox is not trying to access: https://wiki.mypage.com:7232/localhost/v1/page/html/Franx but I also see: 'Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://wiki.mypage.com:7232/localhost/v1/page/html/Franx?redirect=false. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).' followed by 'RESTBase load failed: error'

Any recommendations? My server uses nginx ... TieMichael (talk) 02:27, 4 March 2017 (UTC)

John p new (talkcontribs)

Aaaand you have run into the same CORS roadblock that I have (same error messages, same result). I was hoping you wouldn't run into it and I could get some advice from you. :-)

Now that someone else has the same issue, I'm going to head over to the wikitech-l mailing list and ask some questions (I've gotten a couple of answers so far that have helped me solve at least part of the VE/Parsoid/RESTBase setup puzzle).

When I get an answer from that list, I will come back here and report, hopefully with a solution.

TieMichael (talkcontribs)

One step further: I installed nginx-extras and added these lines to my nginx-config: to the server-part:

        more_set_headers 'Access-Control-Allow-Origin: * always';
        more_set_headers 'Access-Control-Allow-Methods: GET, POST, OPTIONS, PUT, DELETE, HEAD';
        more_set_headers 'Access-Control-Allow-Credentials: true';
        more_set_headers 'Access-Control-Allow-Headers: Origin,Content-Type,Accept,Authorization';

and to the 'location / {' part:

     if ($request_method = 'OPTIONS') {
        more_set_headers 'Access-Control-Allow-Origin: * always';
        more_set_headers 'Access-Control-Allow-Methods: GET, POST, OPTIONS, PUT, DELETE, HEAD';
        more_set_headers 'Access-Control-Max-Age: 1728000';
        more_set_headers 'Access-Control-Allow-Credentials: true';
        more_set_headers 'Access-Control-Allow-Headers: Origin,Content-Type,Accept,Authorization';
        more_set_headers 'Content-Type: text/plain; charset=UTF-8';
        more_set_headers 'Content-Length: 0';
        return 204;
        }

and now VE is working ok for existing pages i.e. I am able to switch back and forth without saving.

But creating new pages, still show the CORS error ....

I am optimistic we will find a solution, an I know I am not the only one fighting :=)

BTW: I also did a 'npm install cors', but not sure if need and/or helpful TieMichael (talk) 09:00, 4 March 2017 (UTC)

46.166.190.204 (talkcontribs)

>> Aaaand you have run into the same CORS roadblock

One way is to have the content served from the RESTBase server coming from the same domain:port as your MediaWiki content — this way, you won't have any cross origin issues.

I think this is the same way MediaWiki.org does it. I looked at the requests being sent when switching between editors, and they all go to mediawiki.org:80, so their RESTBase server gets accessed through the same domain:port (i.e., mediawiki:80).

To have the MediaWiki content and the RESTBase content both being served on the same domain:port, you have to configure a reverse proxy on your Web server (e.g., Apache or NGINX) to proxy all requests matching the URL-path of requests destined to the RESTBase server.

For example, if your RESTBase server URL is configured in your MediaWiki's LocalSettings.php as

>> $wgVisualEditorRestbaseURL = "https://wiki.mypage.com:7232/localhost/v1/page/html/";

where "localhost" is the domain on which MediaWiki is being served (it should actually be a remotely accessible domain, such as "wiki.mypage.com", since you want to give remote access to your MediaWiki), then you need to set up a reverse proxy handling all requests with a URL-path of "/localhost/" (or if you want remote access, "/wiki.mypage.com/").

You can exactly determine the URL-path by checking your MediaWiki's LocalSettings.php file and taking the value you specified as "domain" (remember, the "domain" value is an arbitrarily chosen string, but it must match across all configurations [MediaWiki, Parsoid, and RESTBase]).

I know that you are using NGINX, but I am using Apache, and my configuration looks like this:


   <VirtualHost *:80>
          ProxyPreserveHost On
   
          # Use a trailing slash to match everything starting with /wiki.mypage.com/...
          # See: https://httpd.apache.org/docs/2.2/en/mod/core.html#location
          <Location "/wiki.mypage.com/">
             ProxyPass http://restbase:7231/wiki.mypage.com/
             ProxyPassReverse http://restbase:7231/wiki.mypage.com/
          </Location>
   
          # MediaWiki is located here:
          DocumentRoot /var/www/html
   
    </VirtualHost>

Note that "/wiki.mypage.com/" in the <Location> directive above refers to the value you have specified as "domain" in your MediaWiki, Parsoid, and RESTBase configuration files (again, it is an arbitrarily chosen string).

In the context above, "restbase" is a hostname which resolves to your RESTBase server's IP address, so in your setup, it could just be "localhost", since you said you have all 3 services (MediaWiki, Parsoid, and RESTBase) running on the same machine.

John p new (talkcontribs)

The problem, at least in my case, is that my MediaWiki content is served from a shared host. Because of that, I can't run Node.js/Parsoid/RESTBase on that host, so I set up a home server and pointed MediaWiki to it.

Since I also don't have access to the web server configuration, can a reverse proxy be set up using the .htaccess file?

If I can't solve the CORS issue, I have considered transferring my MediaWiki server to my home server, which would avoid this issue. If I do this, I will definitely try your Apache configuration.

Another solution would be to set everything up on a VPS where you have root access, but of course with more control comes more cost.

46.166.190.204 (talkcontribs)

I got a VPS for ~3 USD per month, so no real costs there.

46.166.190.204 (talkcontribs)

>> Since I also don't have access to the web server configuration, can a reverse proxy be set up using the .htaccess file?

I don't know.

TieMichael (talkcontribs)

Thank you 46.166.190.204! Your approach is working for me!

to my nginx.conf I added:

  location  /wiki.mypage.com/ {
       proxy_pass http://localhost:7231/;
  }

and changed LocalSettings.php to

$wgVisualEditorRestbaseURL = 'https://wiki.mypage.com/wiki.mypage.com/localhost/v1/page/html/';
$wgVisualEditorFullRestbaseURL = 'https://wiki.mypage.com/wiki.mypage.com/localhost/';
$wgVirtualRestConfig['modules']['restbase'] = array(
        'url' => 'https://wiki.mypage.com/wiki.mypage.com',
        'domain' => 'localhost',
        'forwardCookies' => false,
        'parsoidCompat' => false
);

I was also able to remove all the CORS lines I added yesterday.

Now VisualEditor seems working fine for me, as I am able to create pages with VE, and switch back and forth between VE and the 'normal editor' without saving.

Thanks for all your help!

TieMichael (talk) 04:31, 5 March 2017 (UTC)

ElucTheG33K (talkcontribs)

Hello,

I went through the same issues as you did, more or less. I set up everything without SSL (http) then I added the SSL (https) and it broke Restbase (it was working only when the configuration lines related to RestBase in LocalSettings.php where deleted (commented). It was not making any error, it was not making anything, when I click edit, just nothing happen. Then I did the reverseproxy trick and change RestBase configuration without the specific port (as suggested) and now Restbase was able to go from text editor to VE, but VE was not able to pull any data from the page (it was starting a new page each time I edited from VE and if I try to save, I got an error with CURL: "docserver-http-error: (curl error: 60) Peer certificate cannot be authenticated with given CA certificates"

If I comment RestBase lines again, Parsoid and VE are again working fine. If I try to open in Firefox or Chrome the RestPage page at https://mywikiserver/mywiki/v1, I can see the page, but if I enter https://mywikiserver/mywiki/v1/page/html/Main_Page I don't see the content of the Main_Page (it was working without SSL).

Note about my install: it is a private wiki, accessible only from a local intranet but as we integrate LDAP we want to enforce SSL anyway (and by principle I want to do the thing right).

Any idea what could be wrong with my install ?

212.92.123.222 (talkcontribs)

Hello,

46.166.190.204 from above here.

@ElucTheG33K, you have to specify your web server's SSL certificate in your php.ini. Find the section below in php.ini, and modify the path to the SSL certificate to match your environment.

[curl]
; A default value for the CURLOPT_CAINFO option. This is required to be an
; absolute path.
curl.cainfo = "/usr/local/etc/php/ssl/mywiki.crt"

You can manually provoke the cURL error 60 by trying to access your web server from the server handling the PHP requests (possibly the same server).

bash-4.3# curl https://wiki.mypage.lcl
curl: (60) SSL certificate problem: self signed certificate
More details here: https://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
 of Certificate Authority (CA) public keys (CA certs). If the default
 bundle file isn't adequate, you can specify an alternate file
 using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
 the bundle, the certificate verification probably failed due to a
 problem with the certificate (it might be expired, or the name might
 not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
 the -k (or --insecure) option.

Now, the same, but with the web server's certificate specified.

bash-4.3# curl https://wiki.mypage.lcl --cacert /etc/nginx/ssl/mywiki.crt
<successful request>
Terrawide (talkcontribs)

This only indirectly relates to the original error stated, but because this page is at the top of Google's search results, and it can solve another problem related to SSL / TSL, Visual Editor, VisualEditor, Mediawiki, error 60 about peer certificate, and stunnel, I'm posting it here to hopefully save someone a lot of work.


I'm working with CentOS 7.6, Mediawiki 1.33, and other, as of 9.2019, up to date services like parsoid, etc. I'm not including all of the details to set up Visual Editor to work with SSL, just the solution for the issue I ran into.

I could not get VisualEditor, Parsoid, and Mediawiki to work with a self signed certificate, even when setting the strictSSL: false setting in the config.yaml file.

I also couldn't get a certificate obtained from GoDaddy to work until I found the solution.

Inexpensive SSL / TSL certificates usually come with and require an intermediate certificate. To get it to work I got a key tip from this posting: https://serverfault.com/questions/254795/how-do-i-ensure-that-stunnel-sends-all-intermediate-ca-certs

Solution: Configure the STUNNEL configuration files cert line to point to a single file that contain the server certificate and intermediate certificate.

Example line for STUNNEL configuration file:

cert = /WhatEverPathName/CertificateFile (can be a .crt or .pem file), where CertificateFile contains the signed server certificate and intermediate certificate in that order (IE intermediate at the end of the file).

Rajeshrajesh.35 (talkcontribs)

I was too getting same issue but i have resolved in my wiki1.31


These are the wiki config:

$wgMathFullRestbaseURL= 'https://mywikiurl.com/gd_endpoint/localhost/'; #Restbase Server

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

         'url' => 'https://mywikiurl.com/gd_endpoint/',

        'domain' => 'localhost',

);




These are the Proxy(Apache) setting:

#setting proxy start here

        SSLProxyEngine on

        <Location /gd_endpoint/>

                ProxyPass http://ashsd95054.becpsn.com:7231/

                ProxyPassReverse https://ashsd95054.becpsn.com:7231

                Order deny,allow

                Deny from all

                Allow from all

        </Location>

        #setting proxy end here


<VirtualHost *:443>

        DocumentRoot /var/www/html

        #ServerName www.yourdomain.com

        SSLEngine on

        #setting proxy start here

        SSLProxyEngine on

        <Location /gd_endpoint/>

                ProxyPass http://your restbase server .com:7231/

                ProxyPassReverse https://your restbase server .com:7231

                Order deny,allow

                Deny from all

                Allow from all

        </Location>

        #setting proxy end here

        SSLCertificateFile /etc/httpd/ssl/www.cer

        SSLCertificateKeyFile /etc/httpd/ssl/dev.key

        SSLCertificateChainFile /etc/httpd/ssl/crt.cer

</VirtualHost>

Reply to "RestBase Configuration"
Gwsampo (talkcontribs)

When trying to edit using the extension Parsoid is throwing a 406.

Is this a known response?

216.248.100.66 (talkcontribs)

I am seeing the same pattern. I am able to create a new page using VisualEditor without problem but if I try to edit it gives a 406 error. If I check the log file on the Parsoid server it has the error message "Not acceptable". In checking the code for Parsoid in its Git repository, it looks like the error is produced by a check of the content version.

Dbummy (talkcontribs)

I am also getting a 406 error. I was trying to set up parsoid on another server and getting this. I thought it was me configuring wrong but now I wonder. @Gwsampo, was this already working on your server and now it is giving 406 error?

Gwsampo (talkcontribs)

I'm a new install but wouldn't say I'm a battler at this kind of thing...

My setup (IP_ADRESS/index.php?title=Special:Version)

Installed software

Product Version
MediaWiki 1.30.0
PHP 7.0.28-0ubuntu0.16.04.1 (apache2handler)
MySQL 5.7.21-0ubuntu0.16.04.1
Parsoid 0.9.0all
Curl 7.47.0

Installed extensions

Other
Extension Version License Description Authors
VisualEditor 0.1.0 (61f161a)05:07, 3 October 2017 MIT Visual editor for MediaWiki Alex Monk, Bartosz Dziewoński, Christian Williams, Ed Sanders, Inez Korczyński, James D. Forrester, Moriel Schottlender, Roan Kattouw, Rob Moen, Timo Tijhof, Trevor Parscal, C. Scott Ananian and others
Mshannaq (talkcontribs)

I also has the same problem, I got apierror-visualeditor-docserver-http: HTTP 406. when editing any already exists wiki pages , but when I create a new wiki page no problem appear and everything goes fine the and page created with the visual editor.

any one know how to solve this?

Gwsampo (talkcontribs)

When using postman to GET

http://IP_ADDRESS/mediawiki/api.php?action=visualeditor&format=json&paction=parse&page=Main_Page&uselang=en

{

    "error": {

        "code": "apierror-visualeditor-docserver-http",

        "info": "HTTP 406",

        "*": "See http://IP_ADDRESS/mediawiki/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at &lt;https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce&gt; for notice of API deprecations and breaking changes."

    }

}

Mshannaq (talkcontribs)

Yes I got the same also when I use post man

http://IP/api.php?action=visualeditor&format=json&paction=parse&page=REST_API_using_PHP&uselang=en

{

    "error": {

        "code": "apierror-visualeditor-docserver-http",

        "info": "HTTP 406",

        "*": "See https://IP/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at &lt;https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce&gt; for notice of API deprecations and breaking changes."

    }

}

but when I try to request the same url for a non exists content I got

http://IP/api.php?action=visualeditor&format=json&paction=parse&page=not_exists_topic&uselang=en

{

    "visualeditor": {

        "result": "success",

        "notices": [

            "<p><strong>Warning:</strong> You are not logged in. Your IP address will be publicly visible if you make any edits. If you <strong><a rel=\"nofollow\" class=\"external text\" href=\"https://IP/index.php?title=%D8%AE%D8%A7%D8%B5:UserLogin&amp;returnto=Not_exists_topic\">log in</a></strong> or <strong><a rel=\"nofollow\" class=\"external text\" href=\"https:/IP/index.php?title=%D8%AE%D8%A7%D8%B5:UserLogin/signup&amp;returnto=Not_exists_topic\">create an account</a></strong>, your edits will be attributed to your username, along with other benefits.\n</p>",

            "<p>You have followed a link to a page that does not exist yet.\nTo create the page, start typing in the box below (see the <a class=\"external text\" href=\"https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents\">help page</a> for more info).\nIf you are here by mistake, click your browser's <strong>back</strong> button.\n</p>"

        ],

        "checkboxesDef": [],

        "checkboxesMessages": [],

        "templates": "<div class=\"templatesUsed\"></div>",

        "links": {

            "missing": [

                "Not exists topic"

            ],

            "known": []

        },

        "protectedClasses": "",

        "basetimestamp": "20180328002134",

        "starttimestamp": "20180328002134",

        "oldid": 0,

        "content": ""

    }

}

any advices?

Gwsampo (talkcontribs)

So frustrating but try in LocalSettings.php

Enabled skins (commenting out the other ones)

wfLoadSkin( 'MonoBook' );

wfLoadSkin( 'Vector' );

Gwsampo (talkcontribs)

Sorry that didn't work

Gwsampo (talkcontribs)

Maybe a bug in 1.30.0 mediawiki

Working in 1.31.0-alpha mediawiki

Steps to resolve was completing removing old mediwiki and installing latest development version from github and latest development version of visualeditor from git

Something like this

cd /var/lib/mediawiki

mv /var/lib/mediawiki /var/lib/mediawikiold

git clone https://gerrit.wikimedia.org/r/p/mediawiki/core.git

mv /var/lib/core /var/lib/mediawiki

Installed composer globallly (https://getcomposer.org/)

/var/lib/mediawiki composer update --no-dev

test mediawiki config page working

copied old skins

copied old extensions (excluding visual editor)

cd extensions

git clodn https://gerrit.wikimedia.org/r/p/mediawiki/extensions/VisualEditor.git

cd VisualEditor

git submodule update --init

completed wiki setup

worked

Installed software

Product Version
MediaWiki 1.31.0-alpha (6f9c30c)

09:38, 28 March 2018

PHP 7.0.28-0ubuntu0.16.04.1 (apache2handler)
MySQL 5.7.21-0ubuntu0.16.04.1
ICU 55.1

Installed extensions

Other
Extension Version License Description Authors
VisualEditor 0.1.0 (476a590)07:29, 28 March 2018 MIT Visual editor for MediaWiki Alex Monk, Bartosz Dziewoński, Christian Williams, David Lynch, Ed Sanders, Inez Korczyński, James D. Forrester, Moriel Schottlender, Roan Kattouw, Rob Moen, Timo Tijhof, Trevor Parscal, C. Scott Ananian and others
96.23.48.169 (talkcontribs)

I'm having the same problem ..

93.39.230.4 (talkcontribs)

Hi same problem here. Media Wiki 1.30, Visual Editor 1.30

Dbummy (talkcontribs)

Seems that MW1.30 works with Parsoid 0.8.0all but NOT with Parsoid 0.9.0all. if you run "dpkg -s parsoid" it will show you Parsoid version. I have mirrored setups (Ubuntu Server 16.04) with each of the versions of Parsoid and one is working and the other is giving 406 error. Trying to downgrade now.

Dbummy (talkcontribs)

Was able to get mine working (MW 1.30 / Parsoid 0.9.0all) by downgrading Parsoid to 0.8.0all.

--Ubuntu Server 16.04--

apt-get purge parsoid

wget https://people.wikimedia.org/~ssastry/parsoid/debs/parsoid_0.8.0all_all.deb

dpkg -i parsoid_0.8.0all_all.deb

apt-mark hold parsoid

82.204.2.90 (talkcontribs)

Worked for me, I couldn't find 0.8.0 via apt before so thanks for these steps

Don't forget to check your configs too!

185.154.146.37 (talkcontribs)

This worked for me!

216.248.100.66 (talkcontribs)

For me, changing the version of Parsoid to 0.8.0 was the solution. While it is noted in Parsoid's documentation that you need to be careful to use the right version of Parsoid for the version of VisualEditor you have, I didn't see any mention in the VE documentation as to which version was appropriate.

93.39.230.4 (talkcontribs)

I am on Centos 7 and I am not able to install the .deb file in the download page for the 0.8.0

I have tried:

dpkg -i parsoid_0.8.0all_all.deb

but I receive these errors:

parsoid depends on nodejs (>= 4.0.0); however:

  Package nodejs is not installed.

parsoid depends on logrotate; however:

  Package logrotate is not installed.

parsoid depends on adduser; however:

  Package adduser is not installed.

But I have installed node: v6.13.1 and npm: 3.10.10

Do you have any suggestion?

Thanks

Dbummy (talkcontribs)

The "deb" file is for Ubuntu or Debian based systems. I think with CentOS you would have to find the "rpm" file or compile from source. If using the rpm file, You would use "yum" instead of "apt-get". You may even be able to install the old version using yum. I know you can with apt-get in Ubuntu if the package is still available but it wasn't in my case.

217.148.121.13 (talkcontribs)

Already tried, in the repo there is only the last version.

I think I am stucked until they update the Visual Editor....

77.118.171.223 (talkcontribs)

Edit the file ParsoidConfig.js.

Its in ----> lib/config/ParsoidConfig.js

Change the following line from TRUE to FALSE:

ParsoidConfig.prototype.strictAcceptCheck = false;

Full Article is here

Greets,

Chris

217.18.193.124 (talkcontribs)

This "fixed" the issu for my setup.

60.11.42.35 (talkcontribs)

Thanks,It's work.Looks good.

62.2.90.162 (talkcontribs)

Googled for hours until i found this solution...works for me, a fresh installation of mediawiki & parsoid

12.118.115.198 (talkcontribs)

Thanks so much. Worked for me as well.

186.46.139.226 (talkcontribs)

Thank you that fixed it!

Just for documentation purposes the error I had on the parsoid.log file was:

Error:

{"name":"parsoid","hostname":"wiki","pid":1453,"level":60,"logType":"fatal/request","wiki":"wiki$1","title":"Ejemplo","oldId":null,"reqId":null,"userAgent":"VisualEditor-MediaWiki/1.30.0","msg":"Not acceptable.\ntext/html; charset=utf-8; profile=\"https://www.mediawiki.org/wiki/Specs/HTML/1.6.1\"\ntext/html; charset=utf-8; profile=\"https://www.mediawiki.org/wiki/Specs/HTML/2.0.0\"\n","stack":"","httpStatus":406,"longMsg":"Not acceptable.\ntext/html; charset=utf-8; profile=\"https://www.mediawiki.org/wiki/Specs/HTML/1.6.1\"\ntext/html; charset=utf-8; profile=\"https://www.mediawiki.org/wiki/Specs/HTML/2.0.0\"\n","levelPath":"fatal/request","time": ""}

Solution:

Edit the file ParsoidConfig.js.

Its in ----> lib/config/ParsoidConfig.js

Change the following line from TRUE to FALSE:

ParsoidConfig.prototype.strictAcceptCheck = false;

Thanks!

Compumatter (talkcontribs)

Yep that did it ! Solved.

  • sudo vim /usr/lib/parsoid/src/lib/config/ParsoidConfig.js
  • ParsoidConfig.prototype.strictSSL = false;
  • sudo service parsoid restart
  • Done
Oleolsenkjhølkølk (talkcontribs)

Wait, what should i do if there is no such line in my config file?

There is only a "strict check for ssl", but setting that to false didn't solve the problem.

Is there something missing from my files?

185.125.207.249 (talkcontribs)

Posting to let everyone know that the post above exposes a solution that doesn't involve manually downloading the previous version of parsoid and freezing it on Ubuntu via apt mark. Be sure to restart the parsoid service after making the change.

Seb35 (talkcontribs)

You can also change the config file instead of Parsoid code: edit /etc/mediawiki/parsoid/config.yaml and add strictAcceptCheck: false at the same level as "userAgent" in the beginning, i.e. just under "conf". Example:

services:
  - module: lib/index.js
    entrypoint: apiServiceWorker
    conf:
        # For backwards compatibility, and to continue to support non-static
        # configs for the time being, optionally provide a path to a
        # localsettings.js file.  See localsettings.example.js
        #localsettings: ./localsettings.js
        
        # Set your own user-agent string
        # Otherwise, defaults to:
        #   'Parsoid/<current-version-defined-in-package.json>'
        #userAgent: 'My-User-Agent-String'
        
        # /!\ COMPATIBILITY for Parsoid 0.9.0 with MediaWiki before 1.31
        strictAcceptCheck: false
        
        # Configure Parsoid to point to your MediaWiki instances.
        mwApis:
...

PS: this is just an improvement over the above solution, all merits are due to .

213.33.64.46 (talkcontribs)

Don't forget to restart Parsoid with `service parsoid restart` after changing the configuration! This is the cleanest solution to get Parsoid 0.9.0all working with Mediawiki 1.30!

117.136.45.110 (talkcontribs)

Thank you too much, my friends!

I spend hours to search in baidu and google, it really frustrated me.

Thanks! All my friends!

真的非常感谢,前辈们!

Rajeshrajesh.35 (talkcontribs)

I am still getting error "apierror-visualeditor-docserver-http","info":"HTTP 406"

Using these configs:

OS : GNU bash, version 4.2.46(2)-release (x86_64-redhat-linux-gnu)

NAME="Red Hat Enterprise Linux Server"

VERSION="7.6 (Maipo)"


MediaWiki 1.31.1

VisualEditor 0.1.0 (6854ea0)22:33, 5 November 2018

"parsoid" : 0.10.0+git

Parso log:

"name": "parsoid",

"hostname": "ashsd.xxx.com",

"pid": 19229,

"level": 60,

"logType": "fatal/request",

"wiki": "Wiki2",

"title": "Bot",

"oldId": null,

"reqId": null,

"userAgent": "VisualEditor-MediaWiki/1.31.1",

"msg": "Not acceptable.\ntext/html; charset=utf-8; profile=\"\"\ntext/html; charset=utf-8; profile=\"/HTML/999.0.0\"\n",

"stack": "",

"httpStatus": 406,

"longMsg": "Not acceptable.\ntext/html; charset=utf-8; profile=\""\ntext/html; charset=utf-8; profile=\"/HTML/999.0.0\"\n",

"levelPath": "fatal/request",

"time": "2019-06-19T09:00:58.714Z",

"v": 0


This post was hidden by Rajeshrajesh.35 (history)
Rajeshrajesh.35 (talkcontribs)

I have solved this error, there was missing domain name in these files, i would suggest all of you to check the domains in these files.


[Root]/config.yaml,

[Root]/sys/mathoid.js,

[Root]/v1/mathoid.yaml

Rajeshrajesh.35 (talkcontribs)

These errors are related to restbase.

192.196.142.91 (talkcontribs)

@Rajeshrajesh.35

Hi,

I have the same error but it seems that I have no problem with domain names.

Have you change anything else ?

Rajeshrajesh.35 (talkcontribs)

No, is individual services running as

Parsoid?

Restbase?

Method?

Also, check port is enabled so that API connect internally, still you have problem drop me email [my user name] @ gmail.com

Reply to "httpResponse 406 from Parsoid"

Troubleshooting HTTP 404 and http 500

1
KermitLiu (talkcontribs)

total two 404 error appear :

  1. Error loading data from server: apierror-visualeditor-docserver-http: HTTP 404. Would you like to retry?

2. something went wrong http 404 when save the modify page

i dont know how to resolve the problem, why not upload image?

Reply to "Troubleshooting HTTP 404 and http 500"
T. Nordlund (talkcontribs)

I run version 1.33.0 MediaWiki as a private Wiki and followed the installation guide for both Parsoid and VisualEditor. Upon finishing configuration I receive the following error when I click on edit on any existing page:

apierror-visualeditor-docserver-http: HTTP 500.


What I checked so far:

7.2 curl is installed

setMwApi is correctly set


My guess is the problem is within the configuration and therefore trouble with the API.


LocalSettings.php:

wfLoadExtension( 'VisualEditor' );

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

$wgHiddenPrefs[] = 'visualeditor-enable';

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

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

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

    'domain' => 'localhost',

    'prefix' => 'localhost'

);

$wgVisualEditorAllowLossySwitching=false;

$wgSessionsInObjectCache = true;

$wgVirtualRestConfig['modules']['parsoid']['forwardCookies'] = true;


config.yaml:

uri: 'http://xyz/mediawiki/api.php'

(only line that was configured)


Any help is greatly appreciated.

120.244.164.144 (talkcontribs)

same problem, sad

Bttfvgo (talkcontribs)

Not sure if it will help, but what I have (and it works) changes two lines.

LocalSettings.php 'url' => 'http://xyz:8142', reads 'url' => 'http://localhost:8142',

and config.yaml uri: 'http://xyz/mediawiki/api.php' reads uri: 'http://localhost/api.php' (Yours might have to read uri: 'http://localhost/mediawiki/api.php' but I'm not quite sure. That should only apply if your wiki's endpoint is accessed by http://xyz.com/mediawiki/api.php. If it's just http://xyz.com/api.php, use localhost/api.php.)

Perhaps it may work for you, as well.

T. Nordlund (talkcontribs)

I've posted this question in the MediaWiki support desk and received enough answers to figure out the problem. What @Bttfvgo mentioned seems to work, with the addition that I needed to also set the domain variable to my IP address. See here for reference.

Feasibility check on a few possible features

1
Evolution and evolvability (talkcontribs)

The WikiJournals are looking to form a possibly new WMF sister project. As part of this, there are a number of new features that'd be useful (WikiJournal technical wishlist), some of which are related to VisualEditor.

We don't really have the technical expertise to assess which are trivial and which are difficult/impossible so any feedback from more knowledgeable people is welcomed (either direct-editing the page, or leaving a talkpage comment). Thanks!

Reply to "Feasibility check on a few possible features"

Got VE working with workaround '$wgUser' - unclear why

5
MW Kappa (talkcontribs)

We got the following configuration to work

ComponentVersion
MediaWiki1.32.2
Parsoid0.10.0
VisualEditor0.1.0 (e82e120) 23:48, 18. Mär. 2019
PHP 7.3.6

This is the activation of VE in LocalSettings.php

# ----------------------------------------------------------------------
# VisualEditor                              
# ----------------------------------------------------------------------
wfLoadExtension( 'VisualEditor' );
$wgDefaultUserOptions['visualeditor-enable']	= 1;
$wgDefaultUserOptions['visualeditor-editor']	= 'visualeditor';
$wgHiddenPrefs[]				= 'visualeditor-enable';
$wgVirtualRestConfig['modules']['parsoid']	= array(
							'url' => 'http://localhost:8142',
							'domain' => 'mediawikitest');

// this workaround is needed for the functioning of VE - unclear why

function workaround_for_ve() {
	global $wgUser;
	$wgUser->getID();
	return true;
}

$wgHooks['SpecialPage_initList'][]='workaround_for_ve';

The corresponding entry in /etc/mediawiki/parsoid/config.yaml is

services:
  - module: ../src/lib/index.js
    entrypoint: apiServiceWorker
    conf:
        # Configure Parsoid to point to your MediaWiki instances.
        mwApis:
        - # Editorsettings for mediawikitest
          uri: 'http://localhost/mediawikitest/api.php'
          domain: 'mediawikitest'

Before adding this workaround our wiki had the following behaviour: Upon clicking the 'edit' tab the loading bar of VE shortly flashed up, disappeared and left the browser address '..mediawikitest/index.php/mainpage?veaction=edit'

The strange thing is the workaround we needed, and we would like to know if someone has an explanation, why this workaround works, and whether there is a direct solution for achieving the same result. MW Kappa (talk) 16:32, 22 July 2019 (UTC)

Spas.Z.Spasov (talkcontribs)

Hello. As I know MediaWiki doesnt't support PHP 7.3 yet, but I can't say whether this is the reason of your issue. I'm using the same MW, Parsoid and VE versions, but PHP on my server is 7.2 - and there is no such issue. Probably it will be usefull here to post also the Rewrite rules of your MediaWiki virtual host (or .htaccess) configuration.

MW Kappa (talkcontribs)

Thank you very much for your quick reply. I have not tested going back to PHP 7.2. MW 1.32.2 and lots of extensions are running well with PHP 7.3. But my question is: are there special requirements for rewrite rules for Parsoid? MW Kappa (talk) 15:46, 24 July 2019 (UTC)

Spas.Z.Spasov (talkcontribs)

Yes, most of the extensions and MW itself behave well with PHP 7.3, but I found that, some of the CLI scripts doesn't work with PHP 7.3, so probably and the web interface could experience some issues. Also recently, on the support desk, I found a discussion, where was described that MW 1.32 doesn't support officially PHP 7.3.

Actually I've used PHP 7.3 with my wiki for few weeks, before switch back to 7.2, and can't remember such issue as yours, so probably the cause of the issue is elsewhere, but who knows :)

I think there are not special requirements for rewrite rules for Parsoid. I meant that, if you already have some (incomplete) rules they could cause some problems.

This is not related to the issue, but I would like to edit the server's hosts file in order to access the wiki via FDQN instead of localhost or IP address, an example configuration is shown in the bottom of this post of mine.

84.254.96.125 (talkcontribs)

Hello

I have also a MediaWiki (Bluespice) and running it with PHP 7.3. Im also having this issue that a blank site opens if i want to edit. Im running my MediaWiki with XAMPP on a Shared Host. Thats why i have to run Parsoid with Heroku. Unfortunately your workaround dont work with Heroku :/


Any help please

Reply to "Got VE working with workaround '$wgUser' - unclear why"

Parsoid worker failing on startup

1
WanderingUser (talkcontribs)

Hi, I am unsure if I am posting this in the correct space but I am having issues with Parsoid starting up. Basically whenever I try to start Parsoid I cannot get any workers to start.

Here is the output from when I start up:

\node_modules\parsoid>node bin\server.js

{"name":"parsoid","hostname":"SonicWiki","pid":6760,"level":30,"levelPath":"info/service-runner","msg":"master(6760) initializing 8 workers","time":"2019-07-19T14:43:38.612Z","v":0}

{"name":"lib/index.js","hostname":"SonicWiki","pid":2388,"level":30,"levelPath":"info","msg":"loading ...","time":"2019-07-19T14:43:39.796Z","v":0}

here

{"name":"parsoid","hostname":"SonicWiki","pid":2388,"level":60,"errno":"EACCES","code":"EACCES","syscall":"bind","address":"127.0.0.1","port":8000,"levelPath":"fatal/service-runner/unhandled","msg":"bind EACCES 127.0.0.1:8000","time":"2019-07-19T14:43:39.814Z","v":0}

{"name":"parsoid","hostname":"SonicWiki","pid":2388,"level":60,"errno":"EACCES","code":"EACCES","syscall":"bind","address":"127.0.0.1","port":8000,"levelPath":"fatal/service-runner/unhandled","msg":"bind EACCES 127.0.0.1:8000","time":"2019-07-19T14:43:39.815Z","v":0}

{"name":"parsoid","hostname":"SonicWiki","pid":6760,"level":40,"message":"first worker died during startup, continue startup","worker_pid":2388,"exit_code":1,"startup_attempt":1,"levelPath":"warn/service-runner/master","msg":"first worker died during startup, continue startup","time":"2019-07-19T14:43:39.933Z","v":0}

{"name":"parsoid","hostname":"SonicWiki","pid":6760,"level":30,"levelPath":"info/service-runner/master","msg":"master shutting down, killing workers","time":"2019-07-19T14:43:45.839Z","v":0}

{"name":"parsoid","hostname":"SonicWiki","pid":6760,"level":30,"levelPath":"info/service-runner/master","msg":"Exiting master","time":"2019-07-19T14:43:45.844Z","v":0}

Here in the information about the environment that I am using:

- Windows 10 environment.

- node version 10.16.0

- parsoid version 0.10.0


If there is any other information that could be helpful please let me know. Thank you very much for whatever help you can give

Reply to "Parsoid worker failing on startup"