Jump to content

Talk:Parsoid/2016

Add topic
From mediawiki.org
Latest comment: 8 years ago by Kghbln in topic how to run parsoid over https

View developer tasks

Report a new bug in Phabricator

Join the IRC channel

Previous discussion was archived at Talk:Parsoid/Archive on 24 June 2015.

Parsoid log file not generated

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


I have installed Parsoid (successfully!) on a Centos 6 server, the only thing that is wrong is that no log file is produced. Any hints on how to troubleshoot this (in the absence of a log?). 111.69.143.217 (talk) 22:55, 9 January 2016 (UTC)Reply

Could you describe your installation in more detail? I don't think Centos 6 is one of our main supported platforms, so presumably you installed from source? cscott (talk) 17:28, 26 January 2016 (UTC)Reply
Oh -- if you followed the instructions in the question below, note that console output is deliberately sent to /dev/null. In that case you'll need to do logging with https://www.npmjs.com/package/bunyan -- something like the following inside your localsettings.js:
    parsoidConfig.loggerBackend = {
	name: ':Logger.bunyan/BunyanLogger',
	options: {
            name: 'parsoid',
            streams: [
                { stream: process.stdout, level: 'debug' }
            ]
        }
    };
Of course the above just send the logs to standard out again, you'll need to consult the bunyan documentation to configure a "better place" (like a file, syslog, etc). cscott (talk) 17:34, 26 January 2016 (UTC)Reply
I am still confused. The Ubuntu/Debian setup instructions at Parsoid/Setup say: "The log file is /var/log/parsoid/parsoid.log, and is automatically rotated." How are the logfiles generated on those platforms? 111.69.161.237 (talk) 04:53, 1 February 2016 (UTC)Reply
The Ubuntu/Debian packages contains an /etc/init.d/parsoid file which contains:
do_start()
{
	# up the number of fds [sockets] from 1024
	ulimit -n 64000
	# Return
	#   0 if daemon has been started
	#   1 if daemon was already running
	#   2 if daemon could not be started
	# calling /bin/sh is a hack needed to get output redirection on Ubuntu
	# 12.04 LTS, see below
	start-stop-daemon --start --quiet --pidfile $PIDFILE -bm \
		-c parsoid:parsoid --test \
		--exec /bin/sh -- \
		-c "$DAEMON $DAEMON_ARGS >> /var/log/parsoid/parsoid.log 2>&1" \
		|| return 1
	start-stop-daemon --start --quiet --pidfile $PIDFILE -bm \
		-c parsoid:parsoid \
		--exec /bin/sh -- \
		-c "$DAEMON $DAEMON_ARGS >> /var/log/parsoid/parsoid.log 2>&1" \
		|| return 2
	echo "Started Parsoid server on port $PORT"
	# Cleaner version of the above, but does not work with Ubuntu 12.04
	# LTS as the --no-close parameter is not yet supported there
	#start-stop-daemon --start --quiet --pidfile $PIDFILE -bm --no-close \
	#	-c parsoid:parsoid \
	#	--exec $DAEMON -- $DAEMON_ARGS >> /var/log/parsoid/parsoid.log 2>
&1 \
	#	|| return 2
}
It's a bit hard to see, but it explicitly redirects stdout and stderr to /var/log/parsoid/parsoid.log at startup. It also contains a /etc/logrotate.d/parsoid file to rotate this log file. cscott (talk) 19:08, 1 February 2016 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

Multiple wikis, one domain, one parsoid server - visual editor delivering wrong page ?

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


Hi,

I have a number of wikis on a single domain all trying to use the same parsoid server.

I have added a separate parsoidConfig.setMwApi into the "settings.js" file, such as:

parsoidConfig.setMwApi({ prefix: 'name1', uri: 'http://example.server.name/name1/api.php', domain: 'http://example.server.name' });

parsoidConfig.setMwApi({ prefix: 'name2', uri: 'http://example.server.name/name2/api.php', domain: 'http://example.server.name' });

Etc .......

I have followed the instructions for set up, when I have multiple parsoidConfig.setMwApi lines and then restart the Parsoid server things start to go wrong. The final wiki listed seems to work fine but the other seem to return the wrong page or give me errors.

It seems like the system is getting confused between the apis and trying to pull data from the wrong wikis. I have checked and the prefix values all match the corresponding LocalSettings values, so I am not sure how to bug test this ?

All of the apis seem to work individually with: "curl http://example.server.name/name1/api.php", etc and as mentioned they all seem to work fine when there is only one parsoidConfig.setMwApi line.

When I comment out all of the parsoidConfig.setMwApi lines except one and restart the Parsoid server the individual wiki listed works fine.

I should say that this is all related to multiple wikis on the same domain, there seems to be no problem using the single parsoid server for multiple wikis when they are under different domains.

Any ideas how I might track down what I have done wrong here ?

Thanks

Joe Jpadfield (talk) 18:42, 22 January 2016 (UTC)Reply

Can you reconfigure your site so that the wikis are on separate virtual servers?
Then you can give give each virtual server a server alias ServerAlias name1.alias (etc), put both virtual server aliases for 127.0.0.1 in your hosts file, and configure $wgVirtualRestConfig in LocalSettings.php to use the alias as the domain =>, then it should all start working.
Pity it isn't documented, or easier. 111.69.161.237 (talk) 08:14, 24 January 2016 (UTC)Reply
Thanks for the suggestion, I will have a look but it would probably start to get a bit to complex to administer, as there are quite a few already. Jpadfield (talk) 10:15, 25 January 2016 (UTC)Reply
Both the "prefix" and the "domain" part in the parsoidConfig.setMwApi calls should be unique for each of your wikis. Your example uses the same "domain" for both of your wikis, which is why Parsoid is getting confused.
Note that the "domain" listed here doesn't have to be the actual server domain. I believe the docs are clear about this, but perhaps they can be improved. It just has to be a unique string which identifies the wiki. In your case, I'd suggest:
parsoidConfig.setMwApi({ prefix: 'name1', uri: 'http://example.server.name/name1/api.php', domain: 'name1' });
parsoidConfig.setMwApi({ prefix: 'name2', uri: 'http://example.server.name/name2/api.php', domain: 'name2' });
That should work fine. cscott (talk) 17:27, 26 January 2016 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

How to install Parsoid via SSH ? on Shared host Server

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


Help Me!

hi is there any way to install Parsoid via ssh on shared host server. where u can not perform sudo operation on ssh terminal. 39.41.219.84 (talk) 12:24, 3 February 2016 (UTC)Reply

Yes. Follow the "developer install" instructions. No root/sudo is required. cscott (talk) 17:24, 8 February 2016 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

VisualEditor Error (curl error: 28)

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


I have just updated our mediawiki from 1.24 to 1.26.2 and everything appears to be fine except that when editing a page using VisualEditor it gives the above error, the parsoid cmd window also doesnt show anything at all when trying to edit a page.

http://localhost:8000/ - Works fine and all test pages work, i can see parsoid in the cmd window parsing pages.

http://vm-wiki:8000/localhost/Main_Page - Works and i can see parsoid parsing the page.

I can only assume i have a VE issue but i cannot seem to find where, anyone have any ideas? - Its a Windows install with php and mysql - any help appreciated. Slysi123 (talk) 16:24, 19 February 2016 (UTC)Reply

Is your VE configured correctly? That may have changed between those versions,
https://www.mediawiki.org/wiki/Extension:VisualEditor#Linking_with_Parsoid Arlolra (talk) 01:11, 20 February 2016 (UTC)Reply
unfortunately i have already been through the settings and updated the localsettings.php file, i have also matched the localsetting.js file for parsoid, tried a combination of the two and a combination of localhost and the server name, nothing seems to work but i do agree this points to a VE issue talking to parsoid because i can go to http://localhost:8000, tests check out fine and i can see the parsoid workers processing pages. Slysi123 (talk) 15:15, 22 February 2016 (UTC)Reply
Are you using "domain" or "prefix" in your LocalSettings.php? Does Parsoid's localsettings.js file have a "domain" and/or "prefix" that matches?
A quick google seems to indicate that "curl error: 28" is a PHP configuration error of some sort. See, for example, http://stackoverflow.com/questions/6678487/getting-error-code-28-with-curl cscott (talk) 19:27, 4 May 2016 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

Error loading data from server: HTTP 200

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


I have installed Parsoid and Visual Editor according to the instructions available on MediaWiki but unfortunately I am receiving the following error:

Error loading data from server: HTTP 200

It is displayed as pop-up (alert) message generated client-side.

My Parsoid configuration is as follows:

'use strict';

exports.setup = function(parsoidConfig) {

// The URL of your MediaWiki API endpoint.

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

// Use selective serialization (default false)

parsoidConfig.useSelser = false;

};

LocalSettings.php:

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

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

$wgDefaultUserOptions['minordefault'] = 1;

$wgHiddenPrefs[] = 'visualeditor-enable';

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

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

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

'domain' => 'localhost',

'prefix' => 'wiki'

);

$wgSessionsInObjectCache = true;

The Parsoid itself appears to be working as expected:

[info][master][7807] initializing 5 workers

[info][worker][7810] loading ...

[info][worker][7809] loading ...

[info][worker][7811] loading ...

[info][worker][7814] loading ...

[info][worker][7816] loading ...

[info][worker][7809] ready on :8142

[info][worker][7810] ready on :8142

[info][worker][7814] ready on :8142

[info][worker][7816] ready on :8142

[info][worker][7811] ready on :8142

[info][wiki/Operational_Development?oldid=130] started parsing

[info][wiki/Operational_Development?oldid=130] completed parsing in 2756 ms

[info][wiki/Operational_Development?oldid=130] started parsing

[info][wiki/Operational_Development?oldid=130] completed parsing in 2493 ms

[info][wiki/Operational_Development?oldid=130] started parsing

[info][wiki/Operational_Development?oldid=130] completed parsing in 2963 ms

[info][wiki/Operational_Development?oldid=130] started parsing

[info][wiki/Operational_Development?oldid=130] completed parsing in 771 ms

As far as I can see, there is nothing wrong. I am running the latest stable version of MediaWiki on Ubuntu 14.

Does anyone have any suggestions on how to resolve this problem? A HTTP 200 response generally means "successful" so I'm not sure where to look next. Ldbrizzle (talk) 09:49, 9 March 2016 (UTC)Reply

Update
I tried the suggestion from Wdamien but unfortunately the page just freezes on the Progress bar.
I was getting this same error, and in my case I removed another package from the server, that removal unintentionally removed php5-curl, so apt-get install php5-curl and a restart of my php5-fpm service fixed the issue. Fyi; I tracked it down by using a local proxy to introspect the request packets mediawiki was sending / receiving and saw the php curl error in there.
The Parsoid log file is still displaying no errors. Ldbrizzle (talk) 11:09, 9 March 2016 (UTC)Reply
New client side error:
Error loading data from server: internal_api_error_MWException: [49652611] Exception Caught: CAS update failed on user_touched for use ID '2' (read from slave); the version of the user to be saved is older than the current version. Would you like to try again?
However this was resolved by a log-out-login. Not sure if it is related.
Apache2 and Parsoid have been restarted. No change. Ldbrizzle (talk) 11:19, 9 March 2016 (UTC)Reply
Resolution:
It appears that another script was appending an unexpected character to every page served by Apache2. After amending this script, Parsoid works perfectly.
For those who get a similar error, use Firefox's debugger. I wouldn't have located the error without it. Ldbrizzle (talk) 12:23, 9 March 2016 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

Unable to connect to parsoid.wmflabs.org

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


Running "sudo apt-get update" gives me:

W: Failed to fetch http://parsoid.wmflabs.org:8080/deb/dists/wmf-production/InRelease

W: Failed to fetch http://parsoid.wmflabs.org:8080/deb/dists/wmf-production/Release.gpg  Unable to connect to parsoid.wmflabs.org:8080:

W: Some index files failed to download. They have been ignored, or old ones used instead.

I've tried this several times the past two weeks.

Does anyone have any idea what could be the problem? Waanders (talk) 09:11, 22 March 2016 (UTC)Reply

That subdomain was decommissioned a ways back. The repository is at https://releases.wikimedia.org/debian now.
See https://www.mediawiki.org/wiki/Parsoid/Setup#Installation Arlolra (talk) 16:59, 19 April 2016 (UTC)Reply
Solved. I removed "# deb [arch=amd64] http://parsoid.wmflabs.org:8080/deb wmf-production main" from /etc/apt/sources.list and now the warning has gone. Waanders (talk) 12:55, 20 April 2016 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

Parsoid install on Windows 2012 R2 x64 fails

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


I followed the following instructions to install parsoid on Windows but I am getting an error when trying to run the "npm install" or "npm install --force" command. I have also tried to run "npm cache clean" and disable my antivirus but still get the same error message.

Parsoid/Developer Setup#Windows setup

The below is the detailed error from my npm-debug.log file. I get the same error while trying to use npm v5.11.0 and npm v6.0.0. Per the instructions I am using the x86 version of npm.

109388 silly install printInstalled
109389 verbose stack Error: EPERM: operation not permitted, rename 'E:\parsoid\node_modules\express-handlebars\node_modules\glob' -> 'E:\parsoid\node_modules\express-handlebars\node_modules\.glob.DELETE'
109389 verbose stack     at moveAway (E:\nodejs\node_modules\npm\lib\install\action\finalize.js:38:5)
109389 verbose stack     at destStatted (E:\nodejs\node_modules\npm\lib\install\action\finalize.js:27:7)
109389 verbose stack     at FSReqWrap.oncomplete (fs.js:82:15)
109389 verbose stack
Impulse0022 (talk) 14:04, 4 May 2016 (UTC)Reply
I cleaned up those instructions a bit. All that stuff about contextify is outdated and removed.
That looks like a permission error. This link https://github.com/npm/npm/issues/10826 suggests either trying npm cache clean or installing as administration (which doesn't seem great).
The entire process on Windows should just be,
git clone https://github.com/wikimedia/parsoid
cd parsoid/
npm install Arlolra (talk) 16:19, 4 May 2016 (UTC)Reply
Thanks for the updated instructions and the quick reply. In my case the permission error was caused by "CA ARCserve" running in the background. I stopped all "CA ARCserve" services and then the npm install command finally completed successfully. Impulse0022 (talk) 16:42, 4 May 2016 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

missing TableContext.js

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


For 2 days I've been trying to debug my set up. Someone else in an old post said "check JS console in browser", so I did, and lo and behold, the plugin is looking for that file, but I only have ve.ui.TableLineContext.js in my dir. I checked out REL1_26 for the wiki, and extensions. Kjikaqawej (talk) 03:42, 8 May 2016 (UTC)Reply

The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

Ubuntu 'service parsoid status' fails with 'could not access PID file for parsoid'

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


On Ubuntu 14.04 LTS, parsoid 0.4.1all

> service parsoid status

fails with

/etc/init.d/parsoid: invalid arguments
* could not access PID file for parsoid

Parsoid has been installed via official package sources. Can someone confirm this behavior? Planetenxin (talk) 06:07, 23 May 2016 (UTC)Reply

Same error here. Scharesoft (talk) 13:27, 3 June 2016 (UTC)Reply
root@WIKI:/etc/mediawiki/parsoid# service parsoid status
/etc/init.d/parsoid: invalid arguments
* could not access PID file for parsoid
same error.. 191.32.54.165 (talk) 13:31, 7 June 2016 (UTC)Reply
I am facing the same problem. On further debugging it seems I have an outdated parsoid version (through apt-get)
Install Logs:
sudo apt-get install parsoid
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
parsoid
0 upgraded, 1 newly installed, 0 to remove and 4 not upgraded.
Need to get 0 B/6,650 kB of archives.
After this operation, 66.5 MB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
parsoid
Install these packages without verification? [y/N] Y
Selecting previously unselected package parsoid.
(Reading database ... 70190 files and directories currently installed.)
Preparing to unpack .../parsoid_0.4.0_amd64.deb ...
Unpacking parsoid (0.4.0) ...
Processing triggers for ureadahead (0.100.0-16) ...
Setting up parsoid (0.4.0) ...
Started Parsoid server on port 8142
Afterwards it shows version 0.3.0
/mediawiki$ nodejs /usr/lib/parsoid/src/api/server.js -v
parsoid 0.3.0
On trying to manually start it throws an error:
/mediawiki$ nodejs /usr/lib/parsoid/src/api/server.js
module.js:340
throw err;
^
Error: Cannot find module 'handlebars'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/usr/lib/parsoid/src/api/ParsoidService.js:11:11)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
And on starting it says started but actually doesn't start. And gives the HTTP 500 error on using VE (see Extension:VisualEditor#Troubleshooting)
Hopefully someone can help on how to fix the errors or get a new release?
Tagging @SSastry (WMF) Nischayn22 (talk) 14:12, 26 June 2016 (UTC)Reply
Please download the 0.5.1 deb from https://releases.wikimedia.org/debian/pool/main/p/parsoid/ and install it. SSastry (WMF) (talk) 14:48, 29 June 2016 (UTC)Reply
Thanks a lot. I was able to upgrade to this version.
Faced a lot of issues later configuring it, kept getting 404s. These got fixed after I added the prefix and domain statements to my LocalSettings.php.
Apparently they are not so optional.
$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' );
Hopefully this will help someone else :) Nischayn22 (talk) 19:08, 29 June 2016 (UTC)Reply
Thank you, I was having exactly the same problem. Adding both prefix and domain helped me get rid of the 404 error messages! Noboddy (talk) 07:12, 14 July 2016 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

parsoidserver-http: HTTP 0 problem

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


I installed parsoid and check settings on Localsettings.php and settings.js

When i click "edit" button return this error with pop-up: parsoidserver-http: HTTP 0 problem Bekircem (talk) 04:25, 24 May 2016 (UTC)Reply

How did you install Parsoid? Are you able to get Parsoid to work independently of VE? (As in, localhost:8000/localhost/) Arlolra (talk) 02:38, 19 July 2016 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

Parsoid question from IRC/StackOverflow

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


Please see https://stackoverflow.com/questions/37430725/wikimedia-with-parsoid-0-4-0-doesnt-start-or-doesnt-connect-properly-with-node . Thanks! Elitre (WMF) (talk) 09:26, 25 May 2016 (UTC)Reply

It looks like you may not have the right version of express installed.
Here is a simpler solution. Can you upgrade to version 0.4.1all and see if that works for you? If not, we can investigate more. SSastry (WMF) (talk) 13:36, 25 May 2016 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

Problem getting 0.4.1 version -- install manually from deb pkg

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


Please see : http://stackoverflow.com/questions/37430725/wikimedia-with-parsoid-0-4-0-doesnt-start-or-doesnt-connect-properly-with-node/37436348#37436348

I can't find any solution , I need help, thanks 217.12.16.56 (talk) 09:19, 27 May 2016 (UTC)Reply

I responded to this in an earlier thread as well. But, it looks like you may not have the right version of express installed. Not sure how that happened. But, here is a simpler solution. Can you upgrade to version 0.4.1all and see if that works for you? If not, we can investigate more. SSastry (WMF) (talk) 16:37, 27 May 2016 (UTC)Reply
hi, ssastry I suppose you mean that I might install the 0.4.1 parsoid version and try to see if every thing run correctly, Is that right?, I'm a bit confuse with what is express, thank you any way we'll be in contact. 217.12.16.56 (talk) 09:17, 30 May 2016 (UTC)Reply
I case I must install 0.4.1 parsoid version, can any body give the steps to install via apt-get in linux, thanks?, the 0.4.0 version I installed from Parsoid/Setup.
that link install 0.4.0. thanks 217.12.16.56 (talk) 09:21, 30 May 2016 (UTC)Reply
Someone else (not sure if it was you) reported on IRC that they had to install it manually from the deb pkg. "works with 0.4.1! But I had to dowload the .deb manually from the repo, apt does not propose it to me!"
I am not sure yet why you and some others cannot get the 0.4.1 version via apt. But, if the "sudo apt-get update && sudo apt-get install parsoid" does not get you the 0.4.1 version, you can get the deb pkg from https://releases.wikimedia.org/debian/pool/main/p/parsoid/parsoid_0.4.1all_all.deb SSastry (WMF) (talk) 15:59, 1 June 2016 (UTC)Reply
0.4.1 has been replaced with a newer 0.5.1 version. Please use that instead. SSastry (WMF) (talk) 19:43, 3 June 2016 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

After update to 0.5.0 version in Ubuntu Error

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


Parsoid is now getting Curl error 7 neverthless of how i change settings.js in /etc/mediawiki/parsoid.

npm test show this:

npm ERR! Error: ENOENT, open '/etc/mediawiki/parsoid/package.json' npm ERR! If you need help, you may report this log at: npm ERR! <http://github.com/isaacs/npm/issues> npm ERR! or email it to: npm ERR! <npm-@googlegroups.com>

npm ERR! System Linux 3.19.0-59-generic npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "test" npm ERR! cwd /etc/mediawiki/parsoid npm ERR! node -v v0.10.25 npm ERR! npm -v 1.3.10 npm ERR! path /etc/mediawiki/parsoid/package.json npm ERR! code ENOENT npm ERR! errno 34 npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /etc/mediawiki/parsoid/npm-debug.log npm ERR! not ok code 0 LTM666 (talk) 08:30, 3 June 2016 (UTC)Reply

Sorry .. I think I may have uploaded a broken package. Will fix today. SSastry (WMF) (talk) 15:14, 3 June 2016 (UTC)Reply
And in combintation with the Visual Editor and 0.5.0 from parsoid the editor isn't working. Instead there is an error in the log:
/usr/lib/parsoid/src/lib/config/extapi.js:16
throw new Error(
Error: Parsoid version 0.5.0 is inconsistent with required version ^0.4.1
at Object.module.exports.versionCheck (/usr/lib/parsoid/src/lib/config/extapi.js:16:10)
at Object.<anonymous> (/usr/lib/parsoid/src/lib/ext/Cite/index.js:9:58)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Function.ParsoidConfig.loadExtension (/usr/lib/parsoid/src/lib/config/ParsoidConfig.js:625:12)
at /usr/lib/parsoid/src/lib/config/ParsoidConfig.js:619:26 Scharesoft (talk) 17:48, 3 June 2016 (UTC)Reply
same error here,
/etc/init.d/parsoid: invalid arguments
* could not access PID file for parsoid 191.32.54.165 (talk) 18:24, 3 June 2016 (UTC)Reply
Yes, we are in the process of uploading a new deb package to the repository ... but in the interim, you can download the 0.5.1 deb from https://releases.wikimedia.org/debian/pool/main/p/parsoid/ and install it manually. SSastry (WMF) (talk) 18:28, 3 June 2016 (UTC)Reply
Thank you! 189.45.38.190 (talk) 18:52, 3 June 2016 (UTC)Reply
Okay, 0.5.0 deb has been removed and 0.5.1 has been uploaded. I am going to resolve this now. SSastry (WMF) (talk) 19:42, 3 June 2016 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

Error when running Parsoid welcome webpage tests: "Invalid prefix: mediawikiwiki" or "Invalid prefix: enwiki"

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


Installation was done as a normal client (not the dev version). Have tried it without SELinux running. Also, checked the permissions on the file system in Parsoid and everyone has R+X.
The Parsoid service is running and I have also tried running the server.js manually. When a user tries to access the site on port 8000, the get the Welcome to the Parsoid service web page. But when they try to do one of the tests, such as the "round trip test-pages" it gets a page that says "Invalid prefix: mediawikiwiki"
or if the HTML DOM test is run, you get "Invalid prefix: enwiki"
The verbose output from the server, if you run it manually, just says the same thing locally. No information beyond that.
Can someone point me in a direction?
Thanks! 75.140.224.158 (talk) 20:52, 7 June 2016 (UTC)Reply
Check https://phabricator.wikimedia.org/T137122 where @Arlolra provides a solution till such time we make the default behavior better. SSastry (WMF) (talk) 02:57, 8 June 2016 (UTC)Reply
That did the trick, thanks! Once I uncommented (or added) the following config line to localsettings.js, all the tests started working:
parsoidConfig.loadWMF = true;
If you get a second, would you mind explaining what is going on that causes that? I'm new here.
Thanks again! Kingadjon (talk) 11:52, 8 June 2016 (UTC)Reply
loadWMF loads the WMF's mediawiki config into Parsoid. This shouldn't be necessary for non-WMF installs. Instead, a better workaround would be to use /_html/localhost kind of endpoints as in T137122.
Separately, we will try to fix the defaults on these debugging endpoints so it doesn't default to WMF wiki prefixes. SSastry (WMF) (talk) 17:51, 8 June 2016 (UTC)Reply
More information:
Linux version: Centos-release-7-2.1511.el7.centos.2.10.x86_64
PHP: 5.6.20 (apache2handler)
MariaDB: 5.5.47-MariaDB
MediaWiki: 1.26.2
Node.js: 0.10.42
Parsoid: 0.4.1
Since there was no clear instructions for installing on CentOS (Redhat) that I could find, I went by this help doc:
https://www.centos.org/forums/viewtopic.php?f=47&t=53223&p=225372#p225372 Kingadjon (talk) 21:56, 7 June 2016 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

Problem with parsoid and VisualEditor

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


Hi, I would apreciate a lot is any body can take care about the ticket I've opened about the instalation of parsoid, nodejs, and VisualEditor, the question is that I can't run Visual Editor with the configuration I have of parsoid, localsetting.php .

the ticket is in : https://stackoverflow.com/questions/37783317/trouble-with-visualeditor-in-mediawiki

Thank you very much. 217.12.16.56 (talk) 08:00, 15 June 2016 (UTC)Reply

Please show up in #mediawiki-parsoid some time and one of us or VE folks might be able to help. SSastry (WMF) (talk) 16:35, 16 June 2016 (UTC)Reply
The "Invalid prefix: enwiki" error you are seeing is because enwiki is default for that internal path http://localhost:8000/_wikitext/
It'll probably work for you if you try http://localhost:8000/_wikitext/localhost/ Arlolra (talk) 02:34, 19 July 2016 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

npm ERR! weird error 11

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

I ran 'npm test' on our instance of Parsoid and got the following error messages:

npm ERR! weird error 11

npm ERR! not ok code 0

npm ERR! weird error 1

npm ERR! not ok code 0

The reason I ran the test is we have a bug in Visual Editor, an example of this is; the text you're typing is repeated on the line below, pressing backspace duplicates the text you've already typed and the cursor will inexplicably jump to the start or end of a line of text. There's no pattern to this behaviour and it doesn't happen all the time.

I've also posted this issue on the Visual Editor Talk board, but I think this issue is more Parsoid related.

Has anyone ever come across this before and know how to fix? Will running 'npm cache clear' help or would this be inadvisable?

Thanks

MediaWiki 1.24.1, PHP 5.3.3, MySQL 5.1.73 Sam.taylor.bs (talk) 09:40, 29 June 2016 (UTC)Reply

Also, we're running the wiki on CentOS 6
Here is the error message when I run: "node api\server.js":
[info][worker][6105] loading ...
[info][worker][6104] loading ...
[info][worker][6106] loading ...
[info][worker][6110] loading ...
[fatal][worker][6104] uncaught exception bind EADDRINUSE
Error: bind EADDRINUSE
at errnoException (net.js:905:11)
at net.js:1085:30
at Object.17:1 (cluster.js:594:5)
at handleResponse (cluster.js:171:41)
at respond (cluster.js:192:5)
at handleMessage (cluster.js:202:5)
at process.emit (events.js:117:20)
at handleMessage (child_process.js:322:10)
at child_process.js:396:7
at process.handleConversion.net.Native.got (child_process.js:91:7)
[fatal][worker][6105] uncaught exception bind EADDRINUSE
Error: bind EADDRINUSE
at errnoException (net.js:905:11)
at net.js:1085:30
at Object.18:1 (cluster.js:594:5)
at handleResponse (cluster.js:171:41)
at respond (cluster.js:192:5)
at handleMessage (cluster.js:202:5)
at process.emit (events.js:117:20)
at handleMessage (child_process.js:322:10)
at child_process.js:396:7
at process.handleConversion.net.Native.got (child_process.js:91:7)
[fatal][worker][6106] uncaught exception bind EADDRINUSE
And here is what I get when I run "node ./roundtrip-test.js --domain wiki.somewhere.com --apiURL http://wiki.somewhere.com/api.php Somepage --trace preexit"
[info][master][6127] initializing 1 workers
[info][worker][6129] loading ...
[info][worker][6129] ready on localhost:47304
Parser failure!
----------------------------------------------------------------------
Error: Got status code: 404
Stack trace: Error: Got status code: 404
at /var/www/parsoid/tests/roundtrip-test.js:480:11
at Request.errHandler [as _callback] (/var/www/parsoid/lib/mediawiki.Util.js:1501:3)
at Request.self.callback (/var/www/parsoid/node_modules/request/request.js:123:22)
at Request.emit (events.js:98:17)
at Request.<anonymous> (/var/www/parsoid/node_modules/request/request.js:1047:14)
at Request.emit (events.js:117:20)
at IncomingMessage.<anonymous> (/var/www/parsoid/node_modules/request/request.js:998:12)
at IncomingMessage.emit (events.js:117:20)
at _stream_readable.js:944:16
at process._tickCallback (node.js:448:13)
[info][master][6127] shutting down, killing workers
[warning][worker][6129] shutting down
[info][master][6127] exiting Sam.taylor.bs (talk) 14:43, 30 June 2016 (UTC)Reply
The original reason for posting (duplicating text when pressing backspace) does not seem Parsoid related.
The EADDRINUSE error is probably because another application is already bound to port 8000.
If possible, let's try to take things one step at a time here. Arlolra (talk) 02:30, 19 July 2016 (UTC)Reply
Hi Arlolra,
Thanks for replying to this.
I changed the port from 8000 to 8142 in both /var/www/parsoid/api/localsettings.js and /var/www/mediawiki/LocalSettings.php but still getting the problem with text duplicating.
Any other suggestions gratefully received.
Thanks Sam.taylor.bs (talk) 16:13, 1 August 2016 (UTC)Reply
Did you get any response on the VE talk board? The problem as you stated it sounds completely to do with the UI. Parsoid only comes into the equation at save (or preview) time. Arlolra (talk) 20:43, 4 August 2016 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

Error: Parsoid version 0.5.1 is inconsistent with required version ^0.4.1

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


  • os: opensuse 42.1
  • node.js: 4.4.5
  • npm 2.15.5

Parsoid installed via puppet:

nodejs::npm { 'parsoid':
  ensure  => '0.5.1',
  target  => '/opt',
}
> node bin/server.js

returns

Error: Parsoid version 0.5.1 is inconsistent with required version ^0.4.1
    at Object.module.exports.versionCheck (/opt/node_modules/parsoid/lib/config/extapi.js:16:10)
    at Object.<anonymous> (/opt/node_modules/parsoid/lib/ext/Cite/index.js:9:58)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Function.ParsoidConfig.loadExtension (/opt/node_modules/parsoid/lib/config/ParsoidConfig.js:625:12)
    at /opt/node_modules/parsoid/lib/config/ParsoidConfig.js:619:26

What could cause this error? Planetenxin (talk) 18:38, 4 July 2016 (UTC)Reply

Hmm, the parsoid package on npm is messed up. You'll have change the version in the package.json to 0.4.1+git or make a change like https://github.com/wikimedia/parsoid/commit/02e8ebb651d548db0ad56bbc2dbfcc60bfe12358
Also, we need to release a 0.5.2 that fixes that ... Arlolra (talk) 18:46, 4 July 2016 (UTC)Reply
I can confirm that your changes proposed on github fixes the issue. Thanks for the fast reply. Any chance to get a new release soon? Planetenxin (talk) 19:31, 4 July 2016 (UTC)Reply
v0.5.2 is now released. Thanks! Arlolra (talk) 18:23, 5 July 2016 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

invalid prefix

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


Can someone please take a look at these logs and tell me what might be happening? I get the "Welcome to the Parsoid Web Service" screen but the tests fail (as does visualeditor when I try to run it in my MW instance). The following are the logs from the parsoid:

{"name":"parsoid","hostname":"ps548851","pid":20800,"level":60,"err":{"message":"Invalid prefix: enwiki","name":"lib/index.js","stack":"lib/index.js: Invalid prefix: enwiki\n    at errOut (/home/leosta5/parsoid/lib/api/routes.js:28:13)\n    at routes.internal (/home/leosta5/parsoid/lib/api/routes.js:40:11)\n    at Layer.handle [as handle_request] (/home/leosta5/parsoid/node_modules/express/lib/router/layer.js:95:5)\n    at next (/home/leosta5/parsoid/node_modules/express/lib/router/route.js:131:13)\n    at Route.dispatch (/home/leosta5/parsoid/node_modules/express/lib/router/route.js:112:3)\n    at Layer.handle [as handle_request] (/home/leosta5/parsoid/node_modules/express/lib/router/layer.js:95:5)\n    at /home/leosta5/parsoid/node_modules/express/lib/router/index.js:277:22\n    at param (/home/leosta5/parsoid/node_modules/express/lib/router/index.js:349:14)\n    at param (/home/leosta5/parsoid/node_modules/express/lib/router/index.js:365:14)\n    at param (/home/leosta5/parsoid/node_modules/express/lib/router/index.js:365:14)\n    at Function.process_params (/home/leosta5/parsoid/node_modules/express/lib/router/index.js:410:3)\n    at next (/home/leosta5/parsoid/node_modules/express/lib/router/index.js:271:10)\n    at /home/leosta5/parsoid/lib/api/ParsoidService.js:153:3\n    at Layer.handle [as handle_request] (/home/leosta5/parsoid/node_modules/express/lib/router/layer.js:95:5)\n    at trim_prefix (/home/leosta5/parsoid/node_modules/express/lib/router/index.js:312:13)\n    at /home/leosta5/parsoid/node_modules/express/lib/router/index.js:280:7","httpStatus":404,"suppressLoggingStack":true,"levelPath":"fatal/request"},"msg":"Invalid prefix: enwiki","time":"2016-07-15T05:24:55.858Z","v":0}

{"name":"parsoid","hostname":"ps548851","pid":20800,"level":60,"err":{"message":"Invalid prefix: enwiki","name":"lib/index.js","stack":"lib/index.js: Invalid prefix: enwiki\n    at errOut (/home/leosta5/parsoid/lib/api/routes.js:28:13)\n    at routes.internal (/home/leosta5/parsoid/lib/api/routes.js:40:11)\n    at Layer.handle [as handle_request] (/home/leosta5/parsoid/node_modules/express/lib/router/layer.js:95:5)\n    at next (/home/leosta5/parsoid/node_modules/express/lib/router/route.js:131:13)\n    at Route.dispatch (/home/leosta5/parsoid/node_modules/express/lib/router/route.js:112:3)\n    at Layer.handle [as handle_request] (/home/leosta5/parsoid/node_modules/express/lib/router/layer.js:95:5)\n    at /home/leosta5/parsoid/node_modules/express/lib/router/index.js:277:22\n    at param (/home/leosta5/parsoid/node_modules/express/lib/router/index.js:349:14)\n    at param (/home/leosta5/parsoid/node_modules/express/lib/router/index.js:365:14)\n    at param (/home/leosta5/parsoid/node_modules/express/lib/router/index.js:365:14)\n    at Function.process_params (/home/leosta5/parsoid/node_modules/express/lib/router/index.js:410:3)\n    at next (/home/leosta5/parsoid/node_modules/express/lib/router/index.js:271:10)\n    at /home/leosta5/parsoid/lib/api/ParsoidService.js:153:3\n    at Layer.handle [as handle_request] (/home/leosta5/parsoid/node_modules/express/lib/router/layer.js:95:5)\n    at trim_prefix (/home/leosta5/parsoid/node_modules/express/lib/router/index.js:312:13)\n    at /home/leosta5/parsoid/node_modules/express/lib/router/index.js:280:7","httpStatus":404,"suppressLoggingStack":true,"levelPath":"fatal/request"},"msg":"Invalid prefix: enwiki","time":"2016-07-15T05:24:59.745Z","v":0}

Here's what I currently have in localsettings.js:

exports.setup = function( parsoidConfig ) {

// The URL here is supposed to be your MediaWiki API endpoint

parsoidConfig.setInterwiki( 'ps548851', 'http://bxdatap.org/tap/api.php' );

// Enable debug mode (prints extra debugging messages)

parsoidConfig.debug = true;

// Use the PHP preprocessor to expand templates via the MW API (default true)

//parsoidConfig.usePHPPreProcessor = false;

// Use selective serialization (default false)

//parsoidConfig.useSelser = true;

// allow cross-domain requests to the API (default disallowed)

//parsoidConfig.allowCORS = '*';

};

parsoidConfig.loadWMF = true;

The larger issue is that I'm trying to run VisualEditor on a private MediaWiki instance (on a Dreamhost VPS) but it keeps throwing 401 errors. It may also be the case that I have incorrectly configured it to account for the private wiki, but the fact that the Parsoid test pages aren't working is, to me, the more immediate hurdle to clear. 207.38.149.160 (talk) 05:29, 15 July 2016 (UTC)Reply

parsoidConfig.loadWMF = true; is only necessary for Wikimedia wikis, so you can remove that, since it's probably just confusing things.
parsoidConfig.setInterwiki( 'ps548851', 'http://bxdatap.org/tap/api.php' ); is an antiquated API, please see the updated docs https://www.mediawiki.org/wiki/Parsoid/Setup#Configuration
Also, you may want to get your Mediawiki API working here, http://bxdatap.org/tap/api.php, before trying to get Parsoid setup, since it is dependent on it. Arlolra (talk) 02:24, 19 July 2016 (UTC)Reply
. Arlolra (talk) 20:36, 4 August 2016 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

Packages for Ubuntu Xenial?

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


Current repository reports on Ubuntu Xenial:

Get:5 https://releases.wikimedia.org/debian trusty-mediawiki InRelease [2,840 B]

Err:5 https://releases.wikimedia.org/debian trusty-mediawiki InRelease

The following signatures were invalid: KEYEXPIRED 1469117939  KEYEXPIRED 1469117939  KEYEXPIRED 1469117939

Reading package lists... Done

W: https://releases.wikimedia.org/debian/dists/trusty-mediawiki/InRelease: Signature by key 664C383A3566A3481B942F007A322AC6E84AFDD2 uses weak digest algorithm (SHA1)

W: GPG error: https://releases.wikimedia.org/debian trusty-mediawiki InRelease: The following signatures were invalid: KEYEXPIRED 1469117939  KEYEXPIRED 1469117939  KEYEXPIRED 1469117939

E: The repository 'https://releases.wikimedia.org/debian trusty-mediawiki InRelease' is not signed.

N: Updating from such a repository can't be done securely, and is therefore disabled by default.

N: See apt-secure(8) manpage for repository creation and user configuration details. Pkoistin (talk) 20:33, 21 July 2016 (UTC)Reply

See https://www.mediawiki.org/w/index.php?title=Parsoid%2FSetup&type=revision&diff=2202673&oldid=2201527 Arlolra (talk) 15:58, 27 July 2016 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

Key expired

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


The given key in the setup expired yesterday:

pub   2048R/E84AFDD2 2014-07-22 [expired: 2016-07-21]

uid                  MediaWiki releases repository <wikitech-l@lists.wikimedia.org>

An apt-get update results in:

W: GPG error: https://releases.wikimedia.org trusty-mediawiki InRelease: The following signatures were invalid: KEYEXPIRED 1469117939 KEYEXPIRED 1469117939 KEYEXPIRED 1469117939 195.245.243.132 (talk) 13:46, 22 July 2016 (UTC)Reply

I see that too! Filed Phab:T141400. cscott (talk) 22:22, 26 July 2016 (UTC)Reply
See https://www.mediawiki.org/w/index.php?title=Parsoid%2FSetup&type=revision&diff=2202673&oldid=2201527 Arlolra (talk) 15:59, 27 July 2016 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

Unable to locate package parsoid

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


Hi,

Ubuntu 14.04. First attempt at installing parsoid.

Added the key

sudo apt-key advanced --keyserver pgp.mit.edu --recv-keys 90E9F83F22250DD7

then

sudo apt-get update && sudo apt-get install parsoid

chris@wiki:~$ sudo apt-get update && sudo apt-get install parsoid

Ign http://au.archive.ubuntu.com trusty InRelease

Hit http://security.ubuntu.com trusty-security InRelease

Hit http://au.archive.ubuntu.com trusty-updates InRelease

Hit http://security.ubuntu.com trusty-security/main Sources             

Hit http://au.archive.ubuntu.com trusty Release.gpg             

Hit http://security.ubuntu.com trusty-security/restricted Sources

Hit http://au.archive.ubuntu.com trusty-updates/main Sources      

Hit http://security.ubuntu.com trusty-security/universe Sources    

Hit https://releases.wikimedia.org trusty-mediawiki InRelease      

Hit http://au.archive.ubuntu.com trusty-updates/restricted Sources             

Hit https://releases.wikimedia.org trusty-mediawiki/main i386 Packages

Hit http://security.ubuntu.com trusty-security/multiverse Sources

Get:1 https://releases.wikimedia.org trusty-mediawiki/main Translation-en_AU

Hit http://au.archive.ubuntu.com trusty-updates/universe Sources

Hit http://security.ubuntu.com trusty-security/main i386 Packages

Hit http://au.archive.ubuntu.com trusty-updates/multiverse Sources  

Hit http://security.ubuntu.com trusty-security/restricted i386 Packages

Hit http://au.archive.ubuntu.com trusty-updates/main i386 Packages  

Hit http://security.ubuntu.com trusty-security/universe i386 Packages

Hit http://au.archive.ubuntu.com trusty-updates/restricted i386 Packages

Hit http://security.ubuntu.com trusty-security/multiverse i386 Packages

Hit http://au.archive.ubuntu.com trusty-updates/universe i386 Packages

Hit http://security.ubuntu.com trusty-security/main Translation-en  

Ign https://releases.wikimedia.org trusty-mediawiki/main Translation-en_AU

Hit http://au.archive.ubuntu.com trusty-updates/multiverse i386 Packages

Ign https://releases.wikimedia.org trusty-mediawiki/main Translation-en   

Hit http://security.ubuntu.com trusty-security/multiverse Translation-en  

Hit http://au.archive.ubuntu.com trusty-updates/main Translation-en       

Hit http://security.ubuntu.com trusty-security/restricted Translation-en  

Hit http://au.archive.ubuntu.com trusty-updates/multiverse Translation-en

Hit http://security.ubuntu.com trusty-security/universe Translation-en    

Hit http://au.archive.ubuntu.com trusty-updates/restricted Translation-en

Hit http://au.archive.ubuntu.com trusty-updates/universe Translation-en

Hit http://au.archive.ubuntu.com trusty Release    

....

Hit http://au.archive.ubuntu.com trusty/universe Translation-en                

Reading package lists... Done                                                  

Reading package lists... Done

Building dependency tree       

Reading state information... Done

E: Unable to locate package parsoid Aldie (talk) 05:15, 28 July 2016 (UTC)Reply

Having the same issue 83.241.247.135 (talk) 09:12, 28 July 2016 (UTC)Reply
Looking at the distro, the parsoid dosen't seem to have been uploaded too the trusty distro. At least there is no package information... 83.241.247.135 (talk) 09:19, 28 July 2016 (UTC)Reply
Sorry, you should try this, https://www.mediawiki.org/w/index.php?title=Parsoid%2FSetup&type=revision&diff=2204771&oldid=2202673 Arlolra (talk) 21:52, 29 July 2016 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

Question about Parsoid

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


Please see https://www.mediawiki.org/wiki/VisualEditor/Feedback/Archive/2016/07#h-Parsoid_VE_parse_error-2016-07-26T19%3A13%3A00.000Z . :) Elitre (WMF) (talk) 14:30, 4 August 2016 (UTC)Reply

And https://www.mediawiki.org/wiki/VisualEditor/Feedback/Archive/2013/07#h-Error_loading_data_from_server%3A_parsoidserver-http-bad-status%3A_404._Would_you_li-2013-07-10T14%3A35%3A00.000Z ! Elitre (WMF) (talk) 14:34, 4 August 2016 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

Using parsoid without mediwiki?

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


I have a dump of wikitext and want to convert it to HTML. This seems to be exactly what parsoid does. However, it looks like it's not possible to use parsoid without mediawiki, since mwapis is required in config.json.

Can I use parsoid without mediawiki?

- # This is the only required parameter,

# the URL of you MediaWiki API endpoint.

# uri: 'http://localhost/w/api.php' 2A02:8084:26E3:680:3562:779:8DC:3AB (talk) 20:11, 28 August 2016 (UTC)Reply

Note - I can indeed do this id I just run echo foo | node parse.js (and I updated this doc to point out parse.js is in bin/, not test/) but if I run the service with npm start and post some wikitext to http://localhost:8000/localhost/v3/transform/wikitext/to/html/ or the like I get ","stack":"lib/index.js: Config Request failure for \"http://localhost/w/api.php\": Error: connect ECONNREFUSED 127.0.0.1:80\n    at ApiRequest._requestCB (/parsoid/lib/mw/ApiRequest.js:409:15)\n  " (which makes sense, of course, because I don't have mw running, but I shouldn't need it since the parse.js script works) 2A02:8084:26E3:680:3562:779:8DC:3AB (talk) 22:45, 28 August 2016 (UTC)Reply
The reason parse.js script works is because it defaults to contacting the english wikipedia. So, the conversion of your wikitext is going to assume mediawiki settings on the english wikipedia. This affects things like link parsing, templates (fetched from mediawiki api), images (metadata fetched from the mediawiki api), and parsing of extensions. Without knowing more about your wikitext dump, it is hard to say whether that is the right thing to do or not. SSastry (WMF) (talk) 01:35, 29 August 2016 (UTC)Reply
Ah, I hadn't realized that I even needed to contact an external wiki. I take it this means I can't just push wikitext in and get html out with any external dependencies?
I'm actually using english wikivoyage, but incidentally the above failed with /enwikivoyage/v3 in place of /localhost/v3 as well. 89.101.135.100 (talk) 08:49, 29 August 2016 (UTC)Reply
Right ... because wikitext, in its current form, does depend on a wiki's config for its rendering. But, if you don't really use templates, extensions, media (in your wikitext that you want to expand) and are okay with english wikipedia interpretation of links, then the output you get with the parse.js script is accurate.
Try /en.wikivoyage.org/v3 and it should work. SSastry (WMF) (talk) 17:24, 29 August 2016 (UTC)Reply
Thanks! That works a charm! You've been really helpful! 2A02:8084:26E3:680:7D1B:C15F:FF6E:2CB2 (talk) 21:12, 29 August 2016 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

could not access PID file for parsoid

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


Just after installing parsoid (sudo apt-get install parsoid [parsoid_0.5.1all_all.deb]) and running service parsoid status I see

/etc/init.d/parsoid: invalid arguments

* could not access PID file for parsoid

Is this normal? I only found one other thread on this with the recommendation to install 0.5.1. T0lk (talk) 07:20, 31 August 2016 (UTC)Reply

Thanks for reporting.
I pushed a patch https://gerrit.wikimedia.org/r/#/c/307768/
You can try editing /etc/init.d/parsoid with the change there and it should work for you. Arlolra (talk) 15:08, 31 August 2016 (UTC)Reply
Thank you very much! It now reports "is running". T0lk (talk) 18:49, 31 August 2016 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

Performance tuning guide

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


Is there any information about performance tuning for parsoid/visualeditor? I was running into a lot of timeout errors until I increased var HTTP_CONNECT_TIMEOUT = 5 * 1000; in ApiRequest.js to something like 20 or 30 seconds, and even then it's not enough to handle the largest pages on my wiki. T0lk (talk) 04:51, 1 September 2016 (UTC)Reply

Unfortunately, I can't think of any specific documentation to point you to for performance tuning, but there's a lot of general information on the web about node.js applications.
But we can dig in to this issue. HTTP_CONNECT_TIMEOUT is the amount of time Parsoid is willing to wait for your MediaWiki API to accept the incoming connection. So, it doesn't seem like the size of the page should influence that variable (well, ignoring the amount of competing resources on the page, which probably increases proportionally with the size of the page).
How much concurrency does your MediaWiki API allow? HTTP_MAX_SOCKETS may be a more useful nob. You can try playing around with a tool like ApacheBench to verify. Arlolra (talk) 15:36, 1 September 2016 (UTC)Reply
I'll try that tool, thank you. Is the concurrency MediaWiki allow's different from HTTP_MAX_SOCKETS defined in parsoid's ApiRequest.js? It's set to 15 in ApiRequest.js. T0lk (talk) 02:13, 2 September 2016 (UTC)Reply
HTTP_MAX_SOCKETS is how many concurrent connections Parsoid will open with the MediaWiki API.
What you need to check is how many the server (Apache?) serving the MediaWiki API permits.
You can try setting HTTP_MAX_SOCKETS low, like 2, and see if that has any effect on timeouts. But more usefully, you want to see about increasing the amount that your server accepts. Arlolra (talk) 02:24, 2 September 2016 (UTC)Reply
I really appreciate your help Arlolra. What follows is mostly for other users who might benefit from what I've learned.
I'm running nginx on a fairly small Amazon EC2 Instance. The summary is that I saw significant performance gains by configuring worker_processes and worker_connections correctly for my server size. See this guide. Just doing that cut parsing times in half. However, they were still prohibitively high and I was getting timeouts most large pages. The second thing I did is create a new dedicated parsoid server, and began spinning up instances of various sizes to test how CPU and RAM changed parsing times. The "t2.micro" instance with 1GB of RAM handles parsoid requests just fine. Sending requests there cut parsing in half again, and now a normal size page loads almost instantly. There are now only 2 pages on my wiki that give timeout errors. This setup has the advantage of separating traffic page load demands from parsing demands which can be high. T0lk (talk) 07:30, 2 September 2016 (UTC)Reply
Great, glad it's working for you and thanks for the summary. I'm sure others will benefit. Can we consider the matter resolved?
For the pages that are still timing out, which timeout are they hitting? There are various timers in Parsoid. And, out of curiosity, how big are the pages? Arlolra (talk) 15:25, 2 September 2016 (UTC)Reply
Yes, I think I'm hitting hardware limitations. I listed the full log here: Extension talk:VisualEditor/2016#h-Intermitant_problems_with_pages_containing_large_number_of_images_from_shared_re-2016-08-31T20:18:00.000Z. First it's Failed API requests, {"error":{"code": "ETIMEDOUT"},"retries-remaining":1} followed by Template Expansion failure for "97bc6349e16b5680ae9006d5c0b88d0b": Error: ETIMEDOUT.
The more templates used, the more images used, or the more citations the higher the chance of a timeout, but LongPages reports they are in the neighborhood of 135,000 bytes to 167,000 bytes. It's probably safe to say a page over 150,000 bytes that has templates will fail.
EDIT: I'm wondering now if building in some form of caching like RESTBase? may be the solution to my problem with larger pages. T0lk (talk) 16:08, 2 September 2016 (UTC)Reply
I see. That error is more likely the result of the following timeout, not the above discussed,
https://github.com/wikimedia/parsoid/blob/b0d015fac7bc52d239b2e2b25abfef89e0d9f68c/lib/mw/ApiRequest.js#L652
https://github.com/wikimedia/parsoid/blob/b0d015fac7bc52d239b2e2b25abfef89e0d9f68c/lib/config/ParsoidConfig.js#L39
You can try bumping it in your config with, parsoidConfig.timeouts.mwApi.preprocessor = 45 * 1000;
(Also, maybe see if it's any particular expansion that's slow and digging into why that template is performing so poorly on wiki.)
Another thing you can try is batching your requests,
Extension:ParsoidBatchAPI
This should help since it sounds like you've been hitting MediaWiki cpu limitations with lots of templates/images. Did you try increasing the size of the instance that MediaWiki itself is running on?
Also, the TLS connection between MediaWiki and Parsoid is probably adding some additional unnecessary overhead, but try the above recommendations before worrying about that. Arlolra (talk) 16:41, 2 September 2016 (UTC)Reply
Awesome, thank you for telling me about the batchapi. The suggestion about looking into templates was a huge help too.
I had a custom template that was checking the page's title to see if it contained a certain word. mw.title.getCurrentTitle().nsText. That turned out to be very expensive. Removing that check reduced parse times from 80,000 ms to 20,000 ms on a page that was using that template 200 times. That allowed me to edit pages up to 800,000 bytes, the largest on my wiki.
I'm still having trouble on pages with more then 300 citations. Various changes to the citation templates didn't do anything, but this was a very expensive page even before parsoid got involved, after "Show preview", parser profiling data said it was consuming 18 seconds of cpu time. Obviously I'm maxing out my cpu here and it's creating bottlenecks down the line. If I could get rid of the cpu bottleneck that might resolve my last parsoid slowness issue.
If I have extra time later I might boot an expensive instance with plenty of resources and see what happens. T0lk (talk) 22:27, 2 September 2016 (UTC)Reply
Great, let me know how that goes.
Another thing to consider is using HHVM http://hhvm.com/blog/7205/wikipedia-on-hhvm
And node.js v4.x Arlolra (talk) 23:53, 2 September 2016 (UTC)Reply
I have spent the last hour reading about HHVM, I am very excited by it. It seems like MediaWiki-Vagrant is the easiest way to go about implementing HHVM. Would you recommend trying to setup Vagrant with HHVM, or just HHVM by itself? T0lk (talk) 00:13, 3 September 2016 (UTC)Reply
I migrated servers last night from my old 32-bit ubuntu paravirtual instance (PV) to a 64-bit hardware assisted virtual instance (HVM) in preparation for HHVM.
Here's a highlight from some of the pages I was keeping track of each time I made changes. One page is 151,838 bytes, before I began any modifications it was taking 35,000ms to process. Simply upgrading to a very large server with no other changes brought that down to 23,000. Back on the slow server, after tuning nginx it was down to 20,000. Removing expensive template calls and post migration we're at 2,600ms. Another page, 39,462 bytes but with enough images and citations to always cause timeouts (~40,000 ms) is parsing now in 9,000ms. The 167,101 byte page with 300 citations is parsing in just 12,000ms (down from something like 150,000). I haven't done extensive testing, but my guess is that I won't be getting anymore timeout errors! My new HMV server actually has .7GB less ram then the old PV one (same cost however). T0lk (talk) 17:20, 3 September 2016 (UTC)Reply
Congrats! Unfortunately, I don't have much experience with HHVM. The setup is probably complicated by the extensions you have enabled on your wiki. But I'd start with it by itself and just see how that goes. Arlolra (talk) 15:43, 6 September 2016 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

asking for bid to fix parsoid error

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


I would really like to print a book from wikipedia. Neither text nor pdf output works, both functions die with error.

I've been told to ask for experts here.

I am willing to pay to have it fixed if the price is right

https://www.freelancer.com/projects/php/Write-some-Software-11401740/#/

Please consider my offer.

thank you

Dennis DennisDaniels (talk) 06:37, 1 September 2016 (UTC)Reply

I need to look at the production logs to figure out what's going wrong there, but locally I was able to produce the book for you. I'll leave it up for a few days. It's 62 MB though. Arlolra (talk) 04:03, 2 September 2016 (UTC)Reply
@Arlolra Many thanks! Very much appreciate your help. --~ DennisDaniels (talk) 09:05, 2 September 2016 (UTC)Reply
Just a quick update. The reason my book above worked is because the chapters are omitted. With the chapters included, images are getting bunch up and not flushed properly, and it's exceeding the maximum (58 > 52), resulting in "! LaTeX Error: Too many unprocessed floats." Increasing the max allows the pdf to compile, but doesn't fix the underlying issue. Looking into that now. Arlolra (talk) 21:23, 6 September 2016 (UTC)Reply
Managed to fix it in https://gerrit.wikimedia.org/r/#/c/308906/ but that still needs review / deploy before you'll notice a change. Arlolra (talk) 23:59, 6 September 2016 (UTC)Reply
The implication in the commit message there is that, if you're impatient for the patch to deploy, you can,
  • remove Pipette from the book
  • or, move Pipette to the end of the chapter
  • break up the "typical equipment found in a medical laboratory" chapter a bit
and it should compile. In the future, it's probably better to file a task, and add the ocg project, for bug reports. Arlolra (talk) 02:56, 7 September 2016 (UTC)Reply
@Arlolra Many thanks for your updates and assistance!.
re: Task: I did.
here
https://phabricator.wikimedia.org/T144733
and here
https://phabricator.wikimedia.org/T144120
with regards and thanks
--~~ DennisDaniels (talk) 06:21, 7 September 2016 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

Two Parsoid on two different mediawikis?

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


Hi! I have two mediawikis on the same server. VisualEditor is working in both of them, but not at the same time. When one server.js is running I cannot run the server.js of the other mediawiki parsoid.

Does anybody know if it is possible to use two Parsoid services at the same time? Maybe I have to change the port of one of the parsoid...Any ideas?

Thanks! 193.33.2.101 (talk) 10:18, 5 September 2016 (UTC)Reply

I think you need to read Extension:VisualEditor#Servers with multiple virtual sites :) ·addshore· talk to me! 11:11, 5 September 2016 (UTC)Reply
Yes, if you change the port of one of the instances, you can run two at the same time.
Alternatively, you can add two parsoidConfig.setMwApi calls in your localsettings.js to configure one Parsoid instance for both wikis. Arlolra (talk) 15:29, 6 September 2016 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

Can we install Parsoid on CentOS 6

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


Hi I have installed new mediawiki-1.27 on Centos 6 Server. I need to install visual editor extension. I am unable to find a way to install parsoid?

Can you please help me out.

Thanks,

Dheeraj 173.68.151.26 (talk) 17:41, 12 September 2016 (UTC)Reply

Unfortunately, we aren't familiar with CentOS. You might have better luck on their forum. Can you describe the issue though?
Someone did point us to,
https://www.centos.org/forums/viewtopic.php?f=47&t=53223
maybe that'll help? Arlolra (talk) 18:09, 12 September 2016 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

config.yaml where is it located?

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


How did you install Parsoid?
If from git, it should be in the root of the repository. You just need to copy / edit the config.example.yaml there.
See https://github.com/wikimedia/parsoid/blob/master/config.example.yaml
However, if you've installed from the deb, config.yaml isn't relevant there yet. v0.5.1 is still using the old localsettings.js file, which all of the current documentation references. Arlolra (talk) 16:11, 16 September 2016 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

npm: ERR! fix? SOLVED

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


I am trying to install parsoid and gave me an error, and it's in the latest version. HOW? PLx fix! John Harry Lau (talk) 09:30, 1 October 2016 (UTC)Reply

Error form CMD:
C:\windows\system32>npm install parsoid
npm WARN addRemoteGit Error: not found: git
npm WARN addRemoteGit     at getNotFoundError (C:\Users\Lau\AppData\Roaming\npm\
node_modules\npm\node_modules\which\which.js:14:12)
npm WARN addRemoteGit     at F (C:\Users\Lau\AppData\Roaming\npm\node_modules\np
m\node_modules\which\which.js:69:19)
npm WARN addRemoteGit     at E (C:\Users\Lau\AppData\Roaming\npm\node_modules\np
m\node_modules\which\which.js:81:29)
npm WARN addRemoteGit     at C:\Users\Lau\AppData\Roaming\npm\node_modules\npm\n
ode_modules\which\which.js:90:16
npm WARN addRemoteGit     at C:\Users\Lau\AppData\Roaming\npm\node_modules\npm\n
ode_modules\which\node_modules\isexe\index.js:44:5
npm WARN addRemoteGit     at C:\Users\Lau\AppData\Roaming\npm\node_modules\npm\n
ode_modules\which\node_modules\isexe\windows.js:29:5
npm WARN addRemoteGit     at FSReqWrap.oncomplete (fs.js:123:15)
npm WARN addRemoteGit  git+https://github.com/tstarling/pegjs.git#9162b1e114e419
92dd0fdafa24d2574a0b8a836a resetting remote C:\Users\Lau\AppData\Roaming\npm-cac
he\_git-remotes\git-https-github-com-tstarling-pegjs-git-9162b1e114e41992dd0fdaf
a24d2574a0b8a836a-96a2073a because of error: { Error: not found: git
npm WARN addRemoteGit     at getNotFoundError (C:\Users\Lau\AppData\Roaming\npm\
node_modules\npm\node_modules\which\which.js:14:12)
npm WARN addRemoteGit     at F (C:\Users\Lau\AppData\Roaming\npm\node_modules\np
m\node_modules\which\which.js:69:19)
npm WARN addRemoteGit     at E (C:\Users\Lau\AppData\Roaming\npm\node_modules\np
m\node_modules\which\which.js:81:29)
npm WARN addRemoteGit     at C:\Users\Lau\AppData\Roaming\npm\node_modules\npm\n
ode_modules\which\which.js:90:16
npm WARN addRemoteGit     at C:\Users\Lau\AppData\Roaming\npm\node_modules\npm\n
ode_modules\which\node_modules\isexe\index.js:44:5
npm WARN addRemoteGit     at C:\Users\Lau\AppData\Roaming\npm\node_modules\npm\n
ode_modules\which\node_modules\isexe\windows.js:29:5
npm WARN addRemoteGit     at FSReqWrap.oncomplete (fs.js:123:15) code: 'ENOGIT'
}
npm ERR! git clone --template=C:\Users\Lau\AppData\Roaming\npm-cache\_git-remote
s\_templates --mirror https://github.com/tstarling/pegjs.git C:\Users\Lau\AppDat
a\Roaming\npm-cache\_git-remotes\git-https-github-com-tstarling-pegjs-git-9162b1
e114e41992dd0fdafa24d2574a0b8a836a-96a2073a: undefined
npm ERR! git clone --template=C:\Users\Lau\AppData\Roaming\npm-cache\_git-remote
s\_templates --mirror https://github.com/tstarling/pegjs.git C:\Users\Lau\AppDat
a\Roaming\npm-cache\_git-remotes\git-https-github-com-tstarling-pegjs-git-9162b1
e114e41992dd0fdafa24d2574a0b8a836a-96a2073a: undefined
[    ..............] / loadRequestedDeps: ERR! git clone --template=C:\Users\La John Harry Lau (talk) 09:43, 1 October 2016 (UTC)Reply
The error is ENOGIT.
Some of Parsoid's dependencies are git based,
https://github.com/wikimedia/parsoid/blob/master/package.json#L26
Try installing git first,
https://git-scm.com/downloads Arlolra (talk) 15:35, 1 October 2016 (UTC)Reply
OH I forgot install git. Thanks.
Remember helping Is caring John Harry Lau (talk) 06:00, 2 October 2016 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

npm: ERR! fix? 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.


Cmd error:

C:\windows\system32>npm install parsoid

> contextify@0.1.15 install C:\windows\system32\node_modules\contextify

> node-gyp rebuild

C:\windows\system32\node_modules\contextify>if not defined npm_config_node_gyp (

node "C:\Users\Lau\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin\\..\..\

node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )

gyp: binding.gyp not found (cwd: C:\windows\system32\node_modules\contextify) wh

ile trying to load binding.gyp

gyp ERR! configure error

gyp ERR! stack Error: `gyp` failed with exit code: 1

gyp ERR! stack     at ChildProcess.onCpExit (C:\Users\Lau\AppData\Roaming\npm\no

de_modules\npm\node_modules\node-gyp\lib\configure.js:305:16)

gyp ERR! stack     at emitTwo (events.js:106:13)

gyp ERR! stack     at ChildProcess.emit (events.js:191:7)

gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_proces

s.js:215:12)

gyp ERR! System Windows_NT 6.1.7601

gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Lau\\AppData\

\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "reb

uild"

gyp ERR! cwd C:\windows\system32\node_modules\contextify

gyp ERR! node -v v6.7.0

gyp ERR! node-gyp -v v3.4.0

gyp ERR! not ok

C:\windows\system32

`-- parsoid@0.5.2

`-- pegjs@0.8.0  (git+https://github.com/tstarling/pegjs.git#9162b1e114e41992d

d0fdafa24d2574a0b8a836a)

npm WARN enoent ENOENT: no such file or directory, open 'C:\windows\system32\pac

kage.json'

npm WARN system32 No description

npm WARN system32 No repository field.

npm WARN system32 No README data

npm WARN system32 No license field.

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: contextify@0.1.15 (node_modules\

contextify):

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: contextify@0.1.15 install: `node

-gyp rebuild`

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1 John Harry Lau (talk) 10:33, 3 October 2016 (UTC)Reply

Can you try doing this somewhere other than C:\windows\system32?
Like C:\Users\[USERNAME] Arlolra (talk) 16:37, 3 October 2016 (UTC)Reply
I still have error there John Harry Lau (talk) 10:23, 22 October 2016 (UTC)Reply
Can you try with npm install parsoid --no-optional? Arlolra (talk) 22:31, 22 October 2016 (UTC)Reply
We've removed the html5 library as a dependency, so contextify should no longer be an issue, even without --no-optional. Arlolra (talk) 19:58, 1 December 2016 (UTC)Reply
OMG. I think i seleted worng option installing git and i also didn't set up the username and email. LoL John Harry Lau (talk) 17:01, 27 January 2017 (UTC)Reply
And also reinstalling node.js John Harry Lau (talk) 07:12, 29 January 2017 (UTC)Reply
Also i switch to git cmd but i got this error:
npm WARN addRemoteGit Error: Command failed: git -c core.longpaths=true config --get remote.origin.url
npm WARN addRemoteGit
npm WARN addRemoteGit at ChildProcess.exithandler (child_process.js:211:12)
npm WARN addRemoteGit at emitTwo (events.js:106:13)
npm WARN addRemoteGit at ChildProcess.emit (events.js:191:7)
npm WARN addRemoteGit at maybeClose (internal/child_process.js:885:16)
npm WARN addRemoteGit at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
npm WARN addRemoteGit git+https://github.com/wikimedia/content-type.git#47b2632d0a2ee79a7d67268e2f6621becd95d05b resetting remote C:\Users\Lau\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-wikimedia-content-type-git-47b2632d0a2ee79a7d67268e2f6621becd95d05b-0dff22de because of error: { Error: Command failed: git -c core.longpaths=true config --get remote.origin.url
npm WARN addRemoteGit
npm WARN addRemoteGit at ChildProcess.exithandler (child_process.js:211:12)
npm WARN addRemoteGit at emitTwo (events.js:106:13)
npm WARN addRemoteGit at ChildProcess.emit (events.js:191:7)
npm WARN addRemoteGit at maybeClose (internal/child_process.js:885:16)
npm WARN addRemoteGit at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
npm WARN addRemoteGit killed: false,
npm WARN addRemoteGit code: 1,
npm WARN addRemoteGit signal: null,
npm WARN addRemoteGit cmd: 'git -c core.longpaths=true config --get remote.origin.url' }
npm WARN addRemoteGit Error: Command failed: git -c core.longpaths=true config --get remote.origin.url
npm WARN addRemoteGit
npm WARN addRemoteGit at ChildProcess.exithandler (child_process.js:211:12)
npm WARN addRemoteGit at emitTwo (events.js:106:13)
npm WARN addRemoteGit at ChildProcess.emit (events.js:191:7)
npm WARN addRemoteGit at maybeClose (internal/child_process.js:885:16)
npm WARN addRemoteGit at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
npm WARN addRemoteGit git+https://github.com/arlolra/negotiator.git#0418ab4e9a665772b7e233564a4525c9d9a8ec3a resetting remote C:\Users\Lau\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-arlolra-negotiator-git-0418ab4e9a665772b7e233564a4525c9d9a8ec3a-164c7910 because of error: { Error: Command failed: git -c core.longpaths=true config --get remote.origin.url
npm WARN addRemoteGit
npm WARN addRemoteGit at ChildProcess.exithandler (child_process.js:211:12)
npm WARN addRemoteGit at emitTwo (events.js:106:13)
npm WARN addRemoteGit at ChildProcess.emit (events.js:191:7)
npm WARN addRemoteGit at maybeClose (internal/child_process.js:885:16)
npm WARN addRemoteGit at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
npm WARN addRemoteGit killed: false,
npm WARN addRemoteGit code: 1,
npm WARN addRemoteGit signal: null,
npm WARN addRemoteGit cmd: 'git -c core.longpaths=true config --get remote.origin.url' }
npm WARN addRemoteGit Error: Command failed: git -c core.longpaths=true config --get remote.origin.url
npm WARN addRemoteGit
npm WARN addRemoteGit at ChildProcess.exithandler (child_process.js:211:12)
npm WARN addRemoteGit at emitTwo (events.js:106:13)
npm WARN addRemoteGit at ChildProcess.emit (events.js:191:7)
npm WARN addRemoteGit at maybeClose (internal/child_process.js:885:16)
npm WARN addRemoteGit at Socket.<anonymous> (internal/child_process.js:334:11)
npm WARN addRemoteGit at emitOne (events.js:96:13)
npm WARN addRemoteGit at Socket.emit (events.js:188:7)
npm WARN addRemoteGit at Pipe._handle.close [as _onclose] (net.js:501:12)
npm WARN addRemoteGit git+https://github.com/tstarling/pegjs.git#9162b1e114e41992dd0fdafa24d2574a0b8a836a resetting remote C:\Users\Lau\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-tstarling-pegjs-git-9162b1e114e41992dd0fdafa24d2574a0b8a836a-96a2073a because of error: { Error: Command failed: git -c core.longpaths=true config --get remote.origin.url
npm WARN addRemoteGit
npm WARN addRemoteGit at ChildProcess.exithandler (child_process.js:211:12)
npm WARN addRemoteGit at emitTwo (events.js:106:13)
npm WARN addRemoteGit at ChildProcess.emit (events.js:191:7)
npm WARN addRemoteGit at maybeClose (internal/child_process.js:885:16)
npm WARN addRemoteGit at Socket.<anonymous> (internal/child_process.js:334:11)
npm WARN addRemoteGit at emitOne (events.js:96:13)
npm WARN addRemoteGit at Socket.emit (events.js:188:7)
npm WARN addRemoteGit at Pipe._handle.close [as _onclose] (net.js:501:12)
npm WARN addRemoteGit killed: false,
npm WARN addRemoteGit code: 1,
npm WARN addRemoteGit signal: null,
npm WARN addRemoteGit cmd: 'git -c core.longpaths=true config --get remote.origin.url' }
npm WARN addRemoteGit Error: Command failed: git -c core.longpaths=true config --get remote.origin.url
npm WARN addRemoteGit
npm WARN addRemoteGit at ChildProcess.exithandler (child_process.js:211:12)
npm WARN addRemoteGit at emitTwo (events.js:106:13)
npm WARN addRemoteGit at ChildProcess.emit (events.js:191:7)
npm WARN addRemoteGit at maybeClose (internal/child_process.js:885:16)
npm WARN addRemoteGit at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
npm WARN addRemoteGit git+https://github.com/gwicke/kad.git#f35971036f43814043245da82b12d035b7bbfd16 resetting remote C:\Users\Lau\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-gwicke-kad-git-f35971036f43814043245da82b12d035b7bbfd16-48a8d777 because of error: { Error: Command failed: git -c core.longpaths=true config --get remote.origin.url
npm WARN addRemoteGit
npm WARN addRemoteGit at ChildProcess.exithandler (child_process.js:211:12)
npm WARN addRemoteGit at emitTwo (events.js:106:13)
npm WARN addRemoteGit at ChildProcess.emit (events.js:191:7)
npm WARN addRemoteGit at maybeClose (internal/child_process.js:885:16)
npm WARN addRemoteGit at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
npm WARN addRemoteGit killed: false,
npm WARN addRemoteGit code: 1,
npm WARN addRemoteGit signal: null,
npm WARN addRemoteGit cmd: 'git -c core.longpaths=true config --get remote.origin.url' } John Harry Lau (talk) 07:49, 29 January 2017 (UTC)Reply
Are you behind a corporate firewall blocking connections to https://github.com? Arlolra (talk) 22:45, 31 January 2017 (UTC)Reply
no. John Harry Lau (talk) 00:38, 1 February 2017 (UTC)Reply
Ok, well, that issue seems unrelated to installing Parsoid in particular.
You should first confirm that your system is setup to git clone repositories and that you can npm install git urls. Arlolra (talk) 02:08, 1 February 2017 (UTC)Reply
how can i do that? John Harry Lau (talk) 04:08, 2 February 2017 (UTC)Reply
Well, first try,
git clone https://github.com/tstarling/pegjs
then try,
npm install git+https://github.com/tstarling/pegjs Arlolra (talk) 02:39, 3 February 2017 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

how to run parsoid over https

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


it is working fine for http but when i am running the same its throws the below error:

curl error:35 parsoid 59.163.27.11 (talk) 10:16, 20 October 2016 (UTC)Reply

What are you using to terminate the TLS connection, and forward to Parsoid? Arlolra (talk) 17:03, 20 October 2016 (UTC)Reply
i have installed stunnel package , as mentioned in below url:
Extension:VisualEditor#Parsoid over HTTPS
but still i am facing the Curl error :35 .
Can you please guide... 59.163.27.11 (talk) 06:51, 21 October 2016 (UTC)Reply
That error code refers to an SSL_CONNECT_ERROR. Something is wrong w/ your stunnel setup. I suggest you consult the stunnel documentation and try to confirm that you can get it working in a minimal setup, without Parsoid. Once that's confirmed to be working, re-attempt to point it at Parsoid. Arlolra (talk) 17:26, 21 October 2016 (UTC)Reply
What is meant with "What are you using to terminate the TLS connection, and forward to Parsoid?"
What I did is follow the suggestion on Parsoid over HTTPS and I get the same curl error. If I access port 8142 like e.g. https://wiki.example.com:8142 I get "SSL_ERROR_RX_RECORD_TOO_LONG" so I guess it is no wonder it is not working.
My stunnel4 config is like this:
cert = /etc/letsencrypt/live/wiki.example.com/fullchain.pem
key = /etc/letsencrypt/live/wiki.example.com/privkey.pem
[wiki]
accept  = 8143
connect = 8142
"service stunnel4 status" is running:
● stunnel4.service - LSB: Start or stop stunnel 4.x (SSL tunnel for network daemons)
   Loaded: loaded (/etc/init.d/stunnel4)
   Active: active (running) since ...
So according to the current documentation it should work. Reality however tells me otherwise. [[kgh]] (talk) 15:53, 20 January 2018 (UTC)Reply
Can Parsoid and my website share the same set of SSL certificates?: Why would I need to set up stunnel in this case?
Moreover the current docu suggests that using parsoid over https is only possible for private wikis. Perhaps this is the issue though this appears strange to me? [[kgh]] (talk) 15:58, 20 January 2018 (UTC)Reply
I spent another two hours figuring out a way but failed. The solution presented on the linked thread did not help either. If I added 8000 for the same domain I would like to use VE I get a proxy error form the server (500). If I configure an alternative domain for parsoid I get a curl 51 since the certs do not match.
Any help on how to set up parsoid via https will be appreciated. [[kgh]] (talk) 19:19, 20 January 2018 (UTC)Reply
Hmm, perhaps the setup is working as expected. The wiki is https only and the VisualEditor is working. What is not happening is setting the url parameter of $wgVirtualRestConfig to https. But that's probably why we have stunnel to enforce this is the background. [[kgh]] (talk) 22:49, 20 January 2018 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

Can't install Parsoid via apt-get on Ubuntu trusty

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


Hi,

The packages doesn't seemse to be there:

I tried with jessie and trusty repository :/

Greetings

Venice

...

Ign http://de.archive.ubuntu.com trusty/multiverse Translation-de_DE

Ign http://de.archive.ubuntu.com trusty/restricted Translation-de_DE

Ign http://de.archive.ubuntu.com trusty/universe Translation-de_DE

OK   http://security.ubuntu.com trusty-security/restricted i386 Packages

Ign https://releases.wikimedia.org trusty-mediawiki/main Translation-de_DE

OK   http://security.ubuntu.com trusty-security/universe i386 Packages

Ign https://releases.wikimedia.org trusty-mediawiki/main Translation-de

Ign https://releases.wikimedia.org trusty-mediawiki/main Translation-en

Ign https://releases.wikimedia.org jessie-mediawiki/main Translation-de_DE

Ign https://releases.wikimedia.org jessie-mediawiki/main Translation-de

Ign https://releases.wikimedia.org jessie-mediawiki/main Translation-en

OK   http://security.ubuntu.com trusty-security/multiverse i386 Packages

OK   http://security.ubuntu.com trusty-security/main Translation-en

OK   http://security.ubuntu.com trusty-security/multiverse Translation-en

OK   http://security.ubuntu.com trusty-security/restricted Translation-en

OK   http://security.ubuntu.com trusty-security/universe Translation-en

Es wurden 3.193 B in 4 s geholt (701 B/s).

Paketlisten werden gelesen... Fertig

Paketlisten werden gelesen... Fertig

Abhängigkeitsbaum wird aufgebaut.

Statusinformationen werden eingelesen.... Fertig

E: Paket parsoid kann nicht gefunden werden. Venice-89 (talk) 12:24, 1 November 2016 (UTC)Reply

Sorry, yes. We are fixing some issues with our debian repository. Please check later today or tomorrow. SSastry (WMF) (talk) 14:07, 1 November 2016 (UTC)Reply
The trusty-mediawiki repo doesn't seem to have Parsoid, but it installed fine with jessie-mediawiki. Quantum7 (talk) 16:43, 19 January 2017 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

Error: Err_Empty_Response

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


Getting Empty response when trying Parsoid through command line or through the web.

On looking at the log I can see that it keeps spawning and dying. Tail of the log file:

[info][worker][23982] ready on :8142

[info][worker][23981] ready on :8142

[info][master][23660] exiting

[info][master][24624] initializing 4 workers

[info][worker][24626] loading ...

[info][worker][24628] loading ...

[info][worker][24630] loading ...

[info][worker][24627] loading ...

[warning][master][24624] worker 24628 died (SIGKILL), restarting.

[info][worker][24626] ready on :8142

[info][worker][24630] ready on :8142

[info][worker][24627] ready on :8142

[warning][master][24624] worker 24626 died (SIGKILL), restarting.

[info][worker][24636] loading ...

[warning][master][24624] worker 24627 died (SIGKILL), restarting.

[info][worker][24636] ready on :8142

[info][worker][24640] loading ...

[warning][master][24624] worker 24636 died (SIGKILL), restarting.

[info][worker][24640] ready on :8142

[info][worker][24642] loading ...

[warning][master][24624] worker 24640 died (SIGKILL), restarting.

[info][worker][24642] ready on :8142

Is this expected? Nischayn22 (talk) 18:53, 14 November 2016 (UTC)Reply

Definitely not expected. I wonder who's sending the SIGKILLs.
Can you provide some more information about your setup? How you installed Parsoid? What versions you're using? Thanks. Arlolra (talk) 18:56, 14 November 2016 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

Installing

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


Is there a way to install this without command line access? 24.39.1.140 (talk) 18:16, 21 November 2016 (UTC)Reply

Sorry, no. Not right now. SSastry (WMF) (talk) 18:26, 21 November 2016 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

Error when starting the server.js

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


I ran the command node bin/server.js and it gives me such error:

{"name":"parsoid","hostname":"cp-hk-1.webhostbox.net","pid":279063,"level":60,"err":{"message":"spawn ENOMEM","name":"Error","stack":"Error: spawn ENOMEM\n    at exports._errnoException (util.js:1022:11)\n    at ChildProcess.spawn (internal/child_process.js:313:11)\n    at exports.spawn (child_process.js:385:9)\n    at exports.fork (child_process.js:63:10)\n    at createWorkerProcess (cluster.js:321:12)\n    at EventEmitter.cluster.fork (cluster.js:356:27)\n    at Master._startWorkers (/home/ahysprkj/parsoid/node_modules/service-runner/lib/master.js:200:30)\n    at Worker.<anonymous> (/home/ahysprkj/parsoid/node_modules/service-runner/lib/master.js:267:38)\n    at emitTwo (events.js:111:20)\n    at Worker.emit (events.js:191:7)\n    at ChildProcess.Worker.process.on (cluster.js:54:12)\n    at emitTwo (events.js:106:13)\n    at ChildProcess.emit (events.js:191:7)\n    at process.nextTick (internal/child_process.js:752:12)\n    at _combinedTickCallback (internal/process/next_tick.js:67:7)\n    at process._tickCallback (internal/process/next_tick.js:98:9)","code":"ENOMEM","errno":"ENOMEM","syscall":"spawn","levelPath":"fatal/service-runner/unhandled"},"msg":"spawn ENOMEM","time":"2016-12-01T11:53:28.886Z","v":0}

Is there a way to solve this? Thanks in advance. MagaFun (talk) 11:57, 1 December 2016 (UTC)Reply

ENOMEM is the out of memory error. What does free -m say? Is swap enabled?
There's a way to restrict the heap in node.js, with the --max-old-space-size flag. You could try that. Arlolra (talk) 19:55, 1 December 2016 (UTC)Reply
total       used       free     shared    buffers     cached
Mem:         23929      22629       1299         65       2874       6427
-/+ buffers/cache:      13327      10602
Swap:         4095       2956       1139
The output is above. MagaFun (talk) 02:34, 2 December 2016 (UTC)Reply
I think node's default heap size ~2 GB and you've 1299 MB free. You might want to try to free up some RAM.
Alternatively, you can run with the above flag, --max-old-space-size
Or, reduce the number of workers Parsoid is launching. The default should be the same as the number of cpus on your machine. But try with 1 or 0, even, which will forgo the master (but that presents other challenges).
node --max-old-space-size=128 bin/server.js -n 1 Arlolra (talk) 02:57, 2 December 2016 (UTC)Reply
{"name":"parsoid","hostname":"cp-hk-1.webhostbox.net","pid":715569,"level":40,"levelPath":"warn/service-runner","msg":"Startup finished","time":"2016-12-02T03:29:34.794Z","v":0}
I tried the command you gave me but now it got stuck on this message and there is no more output. MagaFun (talk) 03:31, 2 December 2016 (UTC)Reply
EADDRINUSE means that you didn't stop a previously listening instance.
"Startup finished" means the service is up and running. Did you try querying it? Arlolra (talk) 03:39, 2 December 2016 (UTC)Reply
I tried localhost:8000 but my browser just stuck at "Connecting".
By the way my site has HSTS enabled. MagaFun (talk) 03:50, 2 December 2016 (UTC)Reply
Hmm, I'm not sure how HSTS would play in here.
You confirmed it's listening on 8000, right?
If you're using some sort of shared hosting / cloud infrastructure, maybe localhost isn't what you think it is. Do you have an assigned IP? Maybe try setting that as the host in Parsoid's config instead. Arlolra (talk) 17:14, 2 December 2016 (UTC)Reply
I could confirm it is listening on 8000.
I do am using shared hosting, and I changed the "domain" in the "mwApis" section to my IP address. I still cannot query it. The output hostname is still "cp-hk-1.webhostbox.net", which is not my domain.
The reason I mentioned HSTS is because I think the issue below mine by 59.163.27.11 could also play a role here. MagaFun (talk) 02:59, 3 December 2016 (UTC)Reply
Maybe verify that you browser is actually sending requests there? Run,
nc -l localhost 8000
and then try to visit it in the browser. You should see the http request.
Something else to try is eliminating the web frontend altogether. Parsoid comes with a command line tool.
node --max-old-space-size=128 bin/parse.js --config --domain localhost Main_Page < /dev/null Arlolra (talk) 03:20, 3 December 2016 (UTC)Reply
I ran nc -l localhost 8000 but it says command not found, I couldn't install that command either.
Any alternative to that? Thanks. MagaFun (talk) 05:02, 3 December 2016 (UTC)Reply
netcat Arlolra (talk) 05:16, 3 December 2016 (UTC)Reply
Netcat doesn't work either, I don't think my host installed that. MagaFun (talk) 06:01, 3 December 2016 (UTC)Reply
I've run into a similar issue: I installed parsoid via the Debian package on a virtual host, and it tries to start 24(!) workers with 756M each. --max-old-space-size does not seem to have any effect; -n works but it's not easy to use with the init.d script which does not insert -- at the right places in the start-stop-daemon commands, and then I get a bunch of EADDRINUSE errors on restarting because the old service was not shut down. In the end I just replaced the contents of do_stop{} with killall nodejs as a terrible hack and that seems to work. Tgr (talk) 22:23, 27 December 2016 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

SOLVED: Parsoid keeps complaining about invalid domain

[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! My Debian server is running an operational mediawiki instance 1.29 (from git) and VisualEditor loads just fine. The trouble starts when i try to save anything: Parsoid complains about invalid domain, no matter what i enter (or don't enter) in LocalSettings.php and config.yaml. Leaving the domain setting commented out only changes the content of the error message in /var/log/parsoid/parsoid.log; it then mentions www.mydomain.tld as invalid domain...

I tried... - random strings as domain name - IP addresses as domain name and in uri: 'http://127.0.0.1/wiki/api.php' - binary packages for debian - developer instructions for building parsoid and VisualEditor - about any configuration hint i stumbled across

The domain setting in config.yaml is flagged as optional, but commenting it out throws the invalid domain error. It can be seen in full splendor in http://pastebin.com/eyNe8WMk

My config files: config.yaml: http://pastebin.com/sxgQtHkx

LocalSettings.php: http://pastebin.com/jT3UJfrB

The system is Debian GNU/Linux (amd64) with Apache 2.10 (from testing) and php7.0 (dito). PHP seems to run fine, all other web sites on the server work perfectly. Any hints concerning my installation are welcome! Cheers,

   tim SuperPerforator (talk) 11:01, 30 December 2016 (UTC)Reply
Forget about it. My wiki is world-readable, but only writable to logged-in users. The configuration for a private wiki did the trick.
Cripes, what a waste of time...
Only for the records:
My mediawiki from git (v1.29) runs fine (so far) on Debian Jessie with php7.0 and apache from stretch. I followed the parsoid instructions for Debian from https://www.mediawiki.org/wiki/Parsoid/Setup and added the snippet from https://www.mediawiki.org/wiki/Extension:VisualEditor#Linking_with_Parsoid_in_private_wikis about cookie forwarding.
Cheers,
Tim SuperPerforator (talk) 16:27, 30 December 2016 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.