Jump to content

Extension talk:VisualEditor/2017/12

Add topic
From mediawiki.org

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.

VisualEditor doesn't work with wiki markups since MW 1.29.2

[edit]

The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.


Hello!

Yesterday I've updated to MW 1.29.2 (16.04 LTS + Apache2). Now VisualEditor produces the following HTTP 500 error message when on the page have wiki markups as [[page name]]:

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

The problem doesn't appear within '2017 wikitext editor'. The problem doesn't appear with the master branch of MW and VE.

Here is an animated screenshot: https://drive.google.com/file/d/1wFCwG_ZSdhs6ZXisdkD6tHZdNFrzXLCw/view

How could I solve this issue? Any ideas? Spas.Z.Spasov (talk) 19:12, 1 December 2017 (UTC)Reply

Same problem! I'm working on it...
Ubuntu 16.04 LTS + NGINX + 1.29.2
[02/Dec/2017:20:04:54 +0100] "GET /Main_Page HTTP/1.1" 200 5630 "http://wiki.*.info/Main_Page?action=edit&veswitched=1&oldid=7" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/62.0.3202.94 Chrome/62.0.3202.94 Safari/537.36"
[02/Dec/2017:20:04:56 +0100] "GET /api.php?action=visualeditor&format=json&paction=parse&page=Main_Page&uselang=en HTTP/1.1" 200 334 "http://wiki.*.info/Main_Page?veaction=edit" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/62.0.3202.94 Chrome/62.0.3202.94 Safari/537.36"
[02/Dec/2017:20:04:57 +0100] "POST /api.php HTTP/1.1" 200 32 "http://wiki.*.info/Main_Page?veaction=edit" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/62.0.3202.94 Chrome/62.0.3202.94 Safari/537.36"
[02/Dec/2017:20:05:03 +0100] "POST /api.php HTTP/1.1" 200 32 "http://wiki.*.info/Main_Page?veaction=edit" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/62.0.3202.94 Chrome/62.0.3202.94 Safari/537.36"
Now appear error and ...
[02/Dec/2017:20:05:03 +0100] "GET /Main_Page?action=edit&veswitched=1&oldid=7 HTTP/1.1" 200 7686 "http://wiki.*.info/Main_Page?veaction=edit" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/62.0.3202.94 Chrome/62.0.3202.94 Safari/537.36"
Parsoid write this error on log:
"name":"parsoid","hostname":"*","pid":23269,"level":60,"err":{"message":"Failed to parse the JSON response for Config Request","name":"lib/index.js","stack":"lib/index.js: Failed to parse the JSON response for Config Request\n at ConfigRequest.ApiRequest._handleBody (/usr/local/lib/node_modules/parsoid/lib/mw/ApiRequest.js:470:12)\n at ConfigRequest.ApiRequest._requestCB (/usr/local/lib/node_modules/parsoid/lib/mw/ApiRequest.js:421:8)\n at Request.self.callback (/usr/local/lib/node_modules/parsoid/node_modules/request/request.js:186:22)\n at emitTwo (events.js:126:13)\n at Request.emit (events.js:214:7)\n at Request.<anonymous> (/usr/local/lib/node_modules/parsoid/node_modules/request/request.js:1163:10)\n at emitOne (events.js:116:13)\n at Request.emit (events.js:211:7)\n at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/parsoid/node_modules/request/request.js:1085:12)\n at Object.onceWrapper (events.js:313:30)\n at emitNone (events.js:111:20)\n at IncomingMessage.emit (events.js:208:7)\n at endReadableNT (_stream_readable.js:1056:12)\n at _combinedTickCallback (internal/process/next_tick.js:138:11)\n at process._tickCallback (internal/process/next_tick.js:180:9)","httpStatus":500,"levelPath":"fatal/request"},"msg":"Failed to parse the JSON response for Config Request","time":"2017-12-02T19:11:30.770Z","v":0} kraba 19:07, 2 December 2017 (UTC)
now it work.
config.yaml:
worker_heartbeat_timeout: 300000
logging:
level: info
services:
- module: ../src/lib/index.js
entrypoint: apiServiceWorker
conf:
mwApis:
- uri: 'http://wiki.MYSITE.info/api.php'
serverPort: 8142
LocalSettings.php:
...
$wgServer = "http://wiki.MYSITE.info";
..
WfLoadExtension( 'VisualEditor' );
$wgDefaultUserOptions['visualeditor-enable'] = 1;
$wgHiddenPrefs[] = 'visualeditor-enable';
$wgVirtualRestConfig['modules']['parsoid'] = array(
'url' => 'http://localhost:8142',
'domain' => 'wiki.MYSITE.info',
); kraba 14:43, 3 December 2017 (UTC)
I also managed to solve this issue in a similar way.
1. I switched the Parsoid configuration from using of settings.js to using of config.yaml.
2. I simplified the setup as it is possible.
----
Here is the setup of my wiki family:
  • wiki-BG/LocalSettings.php
$wgServer = "https://bg.example.org";
...
## Visual Editor -----
wfLoadExtension( 'VisualEditor' );
        $wgVisualEditorAvailableNamespaces = array( 
                NS_USER => true, NS_HELP => true, NS_PROJECT => true, NS_DEF => true
        );
        $wgDefaultUserOptions['visualeditor-enable'] = 1;
        $wgVisualEditorEnableExperimentalCode = true;
        $wgDefaultUserOptions['visualeditor-enable-experimental'] = 1;
        $wgVisualEditorEnableWikitext = true;
        $wgDefaultUserOptions['visualeditor-newwikitext'] = false;
        //$wgVisualEditorEnableTocWidget = true;
## Flow -----
wfLoadExtension( 'Flow' );
        $wgFlowContentFormat = 'html';
        $wgFlowEditorList = array( 'visualeditor', 'none' );
        $wgFlowParsoidTimeout = 100;
        $wgFlowParsoidForwardCookies = true;
## Parsoid ----
wfLoadExtension( 'ParsoidBatchAPI' );
$wgVirtualRestConfig['modules']['parsoid'] = array(
                'url' => 'http://127.0.0.1:8142',
        );
        $wgSessionsInObjectCache = true;
        $wgVirtualRestConfig['modules']['parsoid']['forwardCookies'] = true;
  • wiki-EN/LocalSettings.php
$wgServer = "https://en.example.org";
...
## Parsoid ----
wfLoadExtension( 'ParsoidBatchAPI' );
$wgVirtualRestConfig['modules']['parsoid'] = array(
                'url' => 'http://127.0.0.1:8142',
        );
        $wgSessionsInObjectCache = true;
        $wgVirtualRestConfig['modules']['parsoid']['forwardCookies'] = true;
  • /etc/mediawiki/parsoid/config.yaml
worker_heartbeat_timeout: 300000
logging:
    level: info
 
services:
  - module: ../src/lib/index.js
    entrypoint: apiServiceWorker
    conf:
        #localsettings: /etc/mediawiki/parsoid/settings.js
        mwApis:
        - uri: 'https://bg.example.org/api.php'
        - uri: 'https://en.example.org/api.php'
        serverPort: 8142
        serverInterface: '127.0.0.1'
Spas.Z.Spasov (talk) 21:02, 3 December 2017 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

Question about Pasoid and HTTPS

[edit]

I have the following configuration, that is working like a charm:

  • wiki/LocalSettings.php

$wgServer = "https://wiki.example.org";

...

    1. Parsoid ----

wfLoadExtension( 'ParsoidBatchAPI' );

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

               'url' => 'http://127.0.0.1:8142',
       );
       $wgSessionsInObjectCache = true;
       $wgVirtualRestConfig['modules']['parsoid']['forwardCookies'] = true;
  • /etc/mediawiki/parsoid/config.yaml

worker_heartbeat_timeout: 300000

logging:

   level: info

services:

 - module: ../src/lib/index.js
   entrypoint: apiServiceWorker
   conf:
       #localsettings: /etc/mediawiki/parsoid/settings.js
       mwApis:
       - uri: 'https://wiki.example.org/api.php'
       #- uri: 'https://another-wiki-instance.example.org/api.php'
       serverPort: 8142
       serverInterface: '127.0.0.1'

I'm confused of then next sentence from the section Parsoid over HTTPS:

Setting up such a configuration allows you to avoid the security implications of transmitting parsoid cookies in cleartext.

So my question is:

Is the above configuration secure enough while only ports 80 and 443 are open into the firewall? And if the answer is "yes" - could we add a clarification note like the follow into the bottom of the section Parsoid over HTTPS?

You do not need to setup stunnel4 when the Parsoid service is on the same server as the MediaWiki instance.

Spas.Z.Spasov (talk) 23:15, 3 December 2017 (UTC)Reply

No Hooks emitted by Visual Editor

[edit]

In the process of porting an extension recording the user activity (edit, save, view, etc) on every page. My port works for the wiki editor but not for VisualEditor; it looks as if no hooks are emitted when I click on the "Edit" link that starts VisualEditor. So,

- Does anyone know if there are any hooks I can use to trigger the call to my function?

- If there are none, which function(s) is called when clicking on the "Edit" link (maybe I can add a hook there)?

- Any other ideas (internal solution only so no Google analytics and the likes)? Ti infotrad (talk) 16:36, 19 December 2017 (UTC)Reply