Talk:Parsoid

Jump to navigation Jump to search

About this board

Pagebanner template at Wikivoyage

5
Summary by Whatamidoing (WMF)
Whatamidoing (WMF) (talkcontribs)

Hello,

I've noticed that voy:en:Template:Pagebanner has a strange behavior in the visual editor. Inspired by @SSastry (WMF)'s excellent explanation of the '''foo {{1x|'''a'''}} bar''' parsing problem, I wanted to ask if there might be something wrong/unbalanced about the template code.

The behavior that I see is that if the wikitext says:

{{pagebanner}}

First sentence


then the first sentence is treated as a complex transclusion of the two parts. See https://en.wikivoyage.org/wiki/Catalina_Island?veaction=edit as an example of this. However, if there is a blank line between the first sentence and the pagebanner template, then it is not treated as a complex transclusion, and the first line is (properly/as expected) separate from the template. What do you think is wrong here?

SSastry (WMF) (talkcontribs)

You are on the right track. :-)

The reason why Parsoid expands the scope of the template is because parts of its output is combined with that sentence to create a paragraph.

In this case, it seems to be because the pagebanner template uses the <indicator> extension and Parsoid seems to think that it should be wrapped in a paragraph. That is more likely a problem with Parsoid's interpretation of the <indicator> extension's output and we may be able to fix that. Can you file a bug for us? Thanks!

Glad you found the explanation useful.

SSastry (WMF) (talkcontribs)

There is another (un)related issue that Parsoid should fix as well. If you look at https://en.wikivoyage.org/api/rest_v1/page/html/Catalina_Island, you see that the banner is missing. This is another issue with Parsoid's handling of the indicator extension. This is likely to get addressed once Parsoid is ported with PHP and integrated with core.

Whatamidoing (WMF) (talkcontribs)

I filed one bug mentioning both, since it sounds like the second is a problem that will automagically disappear without requiring any specific effort. If you want them split, please reply here. I stopped watching this page after the Tidy/Remex change was completely wrapped up, but I am subscribed to this thread (and of course you are welcome to ping me in any conversation on any wiki).

SSastry (WMF) (talkcontribs)

Thanks! That bug report is good enough. We will split if required.

Parsoid is not running Ubuntu 18.10

3
2A0B:33C0:2:22:A4FA:7E0C:919F:30E7 (talkcontribs)

I installed the parsoid as described in the official doc. But it is not running and throws that error:


1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'start' ]

2 info using npm@5.8.0

3 info using node@v8.11.4

4 verbose run-script [ 'prestart', 'start', 'poststart' ]

5 info lifecycle parsoid@0.10.0~prestart: parsoid@0.10.0

6 info lifecycle parsoid@0.10.0~start: parsoid@0.10.0

7 verbose lifecycle parsoid@0.10.0~start: unsafe-perm in lifecycle true

8 verbose lifecycle parsoid@0.10.0~start: PATH: /usr/share/npm/node_modules/npm-lifecycle/node-gyp-bin:/usr/lib/parsoid/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin

9 verbose lifecycle parsoid@0.10.0~start: CWD: /usr/lib/parsoid

10 silly lifecycle parsoid@0.10.0~start: Args: [ '-c', 'service-runner' ]

11 silly lifecycle parsoid@0.10.0~start: Returned: code: 126  signal: null

12 info lifecycle parsoid@0.10.0~start: Failed to exec start script

13 verbose stack Error: parsoid@0.10.0 start: `service-runner`

13 verbose stack Exit status 126

13 verbose stack     at EventEmitter.<anonymous> (/usr/share/npm/node_modules/npm-lifecycle/index.js:283:16)

13 verbose stack     at emitTwo (events.js:126:13)

13 verbose stack     at EventEmitter.emit (events.js:214:7)

13 verbose stack     at ChildProcess.<anonymous> (/usr/share/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)

13 verbose stack     at emitTwo (events.js:126:13)

13 verbose stack     at ChildProcess.emit (events.js:214:7)

13 verbose stack     at maybeClose (internal/child_process.js:925:16)

13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)

14 verbose pkgid parsoid@0.10.0

15 verbose cwd /usr/lib/parsoid

16 verbose Linux 4.18.0-16-generic

17 verbose argv "/usr/bin/node" "/usr/bin/npm" "start"

18 verbose node v8.11.4

19 verbose npm  v5.8.0

20 error code ELIFECYCLE

21 error errno 126

22 error parsoid@0.10.0 start: `service-runner`

22 error Exit status 126

23 error Failed at the parsoid@0.10.0 start script.

23 error This is probably not a problem with npm. There is likely additional logging output above.

24 verbose exit [ 126, true ]


does anybody have an idea how to fix it?

Arlolra (talkcontribs)

The exit status 126 is probably a permission error when trying to execute service-runner.

2A0B:33C0:2:22:A4FA:7E0C:919F:30E7 (talkcontribs)

Thanks a lot. Seems like the service-runner.js caused the problems.

Installation of Parsoid in a Windows Server Environment Without Internet Access

2
Summary by Mbrooksham

Downloaded the files via npm onto a machine with internet, then simply copied them over.

Mbrooksham (talkcontribs)

Hi all,

Looking to install Parsoid in a Windows Server Environment without an internet connection.

Can anyone give me some advice/point me in the direction of some documentation of how to accomplish this?

Thanks!

Mbrooksham (talkcontribs)

Working on MediaWiki vers 1.32 by the way, php 7.1.26

installing on machine that is not internet facing

5
Summary by Mbrooksham

Downloaded the files via npm onto a machine with internet, then simply copied them over.

Squeak24 (talkcontribs)

Hi,

I am trying to install Parsoid on a machine that is not facing the internet, it is on a firewalled internal network with no access to the outside world.

So, the question is, is there anyway to install parsoid onto a server that is not internet facing? If so, how?

Any help is appreciated.

Gary

Squeak24 (talkcontribs)
SSastry (WMF) (talkcontribs)

All Parsoid needs is a config to point it to a wiki. It can be an internal / local wiki. In that case, it won't need to access the internet. You can set up the wiki config via config.yaml. See Parsoid/Setup#Configuration

Arlolra (talkcontribs)
Mbrooksham (talkcontribs)

Hi Squeak24,

Can you give me some information about how you performed your install in an offline environment? I'm not that familar with npm

83.243.48.51 (talkcontribs)
Spas.Z.Spasov (talkcontribs)

I'm experiencing the same problem on Ubuntu. I've setup Parsoid on another server 2 weeks ago and everything went fine then.

At the moment I've applied the following workaround to install Parsoid 0.10:

wget https://releases.wikimedia.org/debian/pool/main/p/parsoid/parsoid_0.10.0all_all.deb
sudo dpkg -i parsoid_0.10.0all_all.deb

In addition:

  • Here is how to test whether the service listen after the installation:
sudo systemctl status parsoid.service
sudo lsof -i -n -P | grep ':8142'
sudo netstat -peanut | grep ':8142'
Reply to "pgp keys still valid/existing ?"
Tealk (talkcontribs)
212.211.192.4 (talkcontribs)

I have disable the "domain: 'rollenspiel.wiki' # optional" line and now it run fine, strange, the last time i have enable it

Reply to "Invalid domain"

Multiple wikis sharing the same parsoid service

3
LP371906 (talkcontribs)

Hi

i can't share multiple wikis on the same parsoid service.

"config.yaml" looks like that:


     mwApis:

- # First wiki

uri: 'http://wiki1.mysite.com/api.php'

  domain: 'wiki1.mysite.com'  # optional

- # If you have another wiki on a different domain

uri: 'http://wiki2.mysite.com/api.php'

domain: 'wiki2.mysite.com'  # optional


"Wiki1" is fully functionally

but in "wiki2" i can't edit a page. there is an error:

"apierror-visualeditor-docserver-http: HTTP 401"


i can do a change in "LocalSettings_wiki2.php" of Parsoid "Domain" to "wiki1.mysite.com". And now i can edit a page, but there is showing an other page of wiki1.

i have a LocalSettings.php who switch pages:

       switch ( $_SERVER['SERVER_NAME'] ) {

               case 'wiki1.mysite.com':

                       require_once 'LocalSettings_wiki1.php';

                       break;

    case 'wiki2.mysite.com':

                       require_once 'LocalSettings_wiki2.php';

                       break;


and my "LocalSettings_wiki2.php" is showing:

#Link with Parsoid

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

   // URL to the Parsoid instance

   'url' => 'http://wiki2.mysite.com:8000',

   // Parsoid "domain", see below (optional)

   'domain' => 'wiki2.mysite.com',


LocalSettings_wiki1.php is almost similar, only "url" and "Domain" are different but also port 8000


can someone help?

thanks a lot!

PenDragyn21 (talkcontribs)

When I got this working, Parsoid had set its main service up on the top-level domain (localhost:8000 or mysite.com:8000). I believe the 'url' parameter in LocalSettings wants this value or where ever the shared instance of parsoid is running. Not the domain for your individual wikis.

First, with parsoid running, check to see if it's running on the TLD.

Either type 'curl http://mysite.com:8000' at a commandline or use a web browser to visit 'http://mysite.com:8000'. If that's where parsoid is running, you'll get back HTML code from the curl command or a 'Welcome to Parsoid' page.

If that works, change the 'url' in $wgVirtualRestConfig to just 'http://mysite.com:8000' in your LocalSettings_wiki1.php and _wiki2.php. (But leave your config.yaml as is.) See if that fixes the errors.


LP371906 (talkcontribs)

Hi PenDragyn21

i've change my LocalSettings Config to:


#Link with Parsoid

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

   // URL to the Parsoid instance

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

   // Parsoid "domain", see below (optional)

   'domain' => 'wiki2.mysite.com',

   // Parsoid "prefix", see below (optional)

   'prefix' => 'wiki2.mysite.com'

);

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



but i think the Problem was "forwardCookies" = true.


many thanks!

Reply to "Multiple wikis sharing the same parsoid service"

Why does "node roundtrip-test.js "Main Page"" work, but "node roundtrip-test.js "Main Page" --domain http://<my wiki's domain>" does not?

1
TheMystics (talkcontribs)

I'm doing a new install on Windows 2012 and I haven't gotten visual editor to work on saved pages at all yet. I'm on MediaWiki 1.31.1, PHP 7.0.7 (apache2handler), MySQL 5.7.13-log, and VisualEditor 0.1.0 (6854ea0) 22:33, 5 November 2018.

I've gotten to the point where I can use visual editor to create pages, but I can't edit pages (due to a "Error loading data from server: apierror-visualeditor-docserver-http: HTTP 404. Would you like to retry?" error).

As a debugging step, I checked that I

1) Can run "node bin/roundtrip-test.js "Main Page"" in a command prompt with only expected errors,

2) "node bin/roundtrip-test.js "Main Page" --domain <my wiki's domain>" fails due to a 404 error,

3) "node bin/roundtrip-test.js "Main Page" --apiURL http://<domain>/mediawiki/api.php" keeps trying to reconnect (even though http://<domain>/mediawiki/api.php brings me to the API page of my wiki), and

4) Doing both of #2 & #3 above's switches in the same command makes it keep trying to reconnect.

What can I do next to diagnose the issue so I can get Visual Editor up and running?

Reply to "Why does "node roundtrip-test.js "Main Page"" work, but "node roundtrip-test.js "Main Page" --domain http://<my wiki's domain>" does not?"

HTTP 406 error when editing existing pages using Parsoid version 0.10.0

2
Hoefsldyla (talkcontribs)

Mediawiki 1.31.1

Parsoid 0.10.0

VisualEditor 1.31 as of 11/01/2019

Latest RESTBase as of 11/01/2019

NodeJS v8.10.0


Parsoid works fine by itself but if i try set it up in combination with RESTBase for the ability to switch from source code to visual editor

I get HTTP 406. (Failed to transform content, requested_version:1.6.0, existing_version:2.0.0)

It worked fine before I upgraded Parsoid from 0.9.0.

This post was hidden by Hoefsldyla (history)
Reply to "HTTP 406 error when editing existing pages using Parsoid version 0.10.0"

upgrade from 9 to 10 resulted in curl error: 7

6
RobFantini (talkcontribs)

Hello, after the upgrade clicking on edit displayed:

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


/var/log/parsoid/parsoid.log ;

{"name":"parsoid","hostname":"wiki","pid":4318,"level":30,"levelPath":"info/service-runner","msg":"master(4318) initializing 2 workers","time":"2018-12-08T16:22:00.405Z","v":0}

{"name":"parsoid","hostname":"wiki","pid":4328,"level":60,"levelPath":"fatal/service-runner/worker","msg":"Cannot set property 'worker_id' of null","time":"2018-12-08T16:22:01.185Z","v":0}

{"name":"parsoid","hostname":"wiki","pid":4318,"level":40,"message":"first worker died during startup, continue startup","worker_pid":4328,"exit_code":1,"startup_attempt":1,"levelPath":"warn/service-runner/master","msg":"first worker died during startup, continue startup","time":"2018-12-08T16:22:02.196Z","v":0}



we are using Debian Stretch

MediaWiki         1.31.1 (a4c8065)  13:59, September 20, 2018

nodejs  Version: 4.8.2~dfsg-1

curl Version: 7.52.1-5+deb9u8


parsoid settings:

# cat /etc/mediawiki/parsoid/settings.js
'use strict';
exports.setup = function(parsoidConfig) {
        parsoidConfig.setMwApi({ uri: 'http://localhost/mediawiki/api.php'  , prefix: 'localhost', domain: 'localhost'  });
        parsoidConfig.useSelser = true;
};

Any suggestions to try to fix this appreciated!

Arlolra (talkcontribs)
RobFantini (talkcontribs)

thank you, so this fixed it

apt-get -t stretch-backports install nodejs
109.199.10.165 (talkcontribs)

Hello,


updating node.js to 8.11.1 will restore functionality of creating new pages, however editing of existing does not work: "apierror-visualeditor-docserver-http: HTTP 406"


any support in this matter will be appreciated.

Arlolra (talkcontribs)

Which version of Parsoid are you coming from?

Magol (talkcontribs)

I also get HTTP 406 when I edit existing pages using the latest Parsoid version (10.0.0)

Reply to "upgrade from 9 to 10 resulted in curl error: 7"