Jump to content

Talk:Parsoid/2020

Add topic
From mediawiki.org

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.

Couldn't resolve host name (curl error: 6) but able to curl MediaWiki fine

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


Not sure if I should be posting here or on the visualeditor page, but I can't for the life of me get Parsaoid/VisualEditor working.

Here is some info about my setup:

- Host: Centos 8

- Docker Installed and MediaWiki is running on that with 80->80

- MediaWiki is a private wiki

- Parsaoid is installed on the host and mapped to 8001 (Default had a conflict with container already in use)

- VisualEditor is installed and throws no error other then the one in the title.


Now I have gone through the following pages to try to troubleshoot my issue:

Parsoid/Troubleshooting

Extension:VisualEditor#Linking with Parsoid in private wikis


Currently I can curl the api through Parsoid and get values through a private wiki but within mediawiki, I can not edit with visual editor.


LocalSetting.php


<?php

# This file was automatically generated by the MediaWiki 1.34.0

# installer. If you make manual changes, please keep track in case you

# need to recreate them later.

#

# See includes/DefaultSettings.php for all configurable settings

# and their default values, but don't forget to make changes in _this_

# file, not there.

#

# Further documentation for configuration settings may be found at:

# https://www.mediawiki.org/wiki/Manual:Configuration_settings

# Protect against web entry

if ( !defined( 'MEDIAWIKI' ) ) {

   exit;

}

## Uncomment this to disable output compression

# $wgDisableOutputCompression = true;

$wgSitename = "FireAmpersand Documentation";

$wgMetaNamespace = "FireAmpersand_Documentation";

## The URL base path to the directory containing the wiki;

## defaults for all runtime URL paths are based off of this.

## For more information on customizing the URLs

## (like /w/index.php/Page_title to /wiki/Page_title) please see:

## https://www.mediawiki.org/wiki/Manual:Short_URL

$wgScriptPath = "";

## The protocol and server name to use in fully-qualified URLs

$wgServer = "http://bumblebee.fireampersand.ca";

## The URL path to static resources (images, scripts, etc.)

$wgResourceBasePath = $wgScriptPath;

## The URL path to the logo.  Make sure you change this from the default,

## or else you'll overwrite your logo when you upgrade!

$wgLogo = "$wgResourceBasePath/resources/assets/wiki.png";

## UPO means: this is also a user preference option

$wgEnableEmail = false;

$wgEnableUserEmail = true; # UPO

$wgEmergencyContact = "apache@đŸŒ».invalid";

$wgPasswordSender = "apache@đŸŒ».invalid";

$wgEnotifUserTalk = false; # UPO

$wgEnotifWatchlist = false; # UPO

$wgEmailAuthentication = true;

## Database settings

$wgDBtype = "sqlite";

$wgDBserver = "";

$wgDBname = "my_wiki";

$wgDBuser = "";

$wgDBpassword = "";

# SQLite-specific settings

$wgSQLiteDataDir = "/var/www/data";

$wgObjectCaches[CACHE_DB] = [

   'class' => SqlBagOStuff::class,

   'loggroup' => 'SQLBagOStuff',

   'server' => [

       'type' => 'sqlite',

       'dbname' => 'wikicache',

       'tablePrefix' => '',

       'variables' => [ 'synchronous' => 'NORMAL' ],

       'dbDirectory' => $wgSQLiteDataDir,

       'trxMode' => 'IMMEDIATE',

       'flags' => 0

   ]

];

$wgLocalisationCacheConf['storeServer'] = [

   'type' => 'sqlite',

   'dbname' => "{$wgDBname}_l10n_cache",

   'tablePrefix' => '',

   'variables' => [ 'synchronous' => 'NORMAL' ],

   'dbDirectory' => $wgSQLiteDataDir,

   'trxMode' => 'IMMEDIATE',

   'flags' => 0

];

$wgJobTypeConf['default'] = [

   'class' => 'JobQueueDB',

   'claimTTL' => 3600,

   'server' => [

       'type' => 'sqlite',

       'dbname' => "{$wgDBname}_jobqueue",

       'tablePrefix' => '',

       'variables' => [ 'synchronous' => 'NORMAL' ],

       'dbDirectory' => $wgSQLiteDataDir,

       'trxMode' => 'IMMEDIATE',

       'flags' => 0

   ]

];

## Shared memory settings

$wgMainCacheType = CACHE_ACCEL;

$wgMemCachedServers = [];

## To enable image uploads, make sure the 'images' directory

## is writable, then set this to true:

$wgEnableUploads = true;

$wgUseImageMagick = true;

$wgImageMagickConvertCommand = "/usr/bin/convert";

# InstantCommons allows wiki to use images from https://commons.wikimedia.org

$wgUseInstantCommons = false;

# Periodically send a pingback to https://www.mediawiki.org/ with basic data

# about this MediaWiki instance. The Wikimedia Foundation shares this data

# with MediaWiki developers to help guide future development efforts.

$wgPingback = false;

## If you use ImageMagick (or any other shell command) on a

## Linux server, this will need to be set to the name of an

## available UTF-8 locale

$wgShellLocale = "C.UTF-8";

## Set $wgCacheDirectory to a writable directory on the web server

## to make your wiki go slightly faster. The directory should not

## be publicly accessible from the web.

#$wgCacheDirectory = "$IP/cache";

# Site language code, should be one of the list in ./languages/data/Names.php

$wgLanguageCode = "en-ca";

$wgSecretKey = "d8f1a050a167350916861d1c65c428ec2e15ef1ddde8c3d305533350dd83f480";

# Changing this will log out all existing sessions.

$wgAuthenticationTokenVersion = "1";

# Site upgrade key. Must be set to a string (default provided) to turn on the

# web installer while LocalSettings.php is in place

$wgUpgradeKey = "364ffa43b8516e75";

## For attaching licensing metadata to pages, and displaying an

## appropriate copyright notice / icon. GNU Free Documentation

## License and Creative Commons licenses are supported so far.

$wgRightsPage = ""; # Set to the title of a wiki page that describes your license/copyright

$wgRightsUrl = "";

$wgRightsText = "";

$wgRightsIcon = "";

# Path to the GNU diff3 utility. Used for conflict resolution.

$wgDiff3 = "/usr/bin/diff3";

# The following permissions were set based on your choice in the installer

$wgGroupPermissions['*']['createaccount'] = false;

$wgGroupPermissions['*']['edit'] = false;

$wgGroupPermissions['*']['read'] = false;

## Default skin: you can change the default skin. Use the internal symbolic

## names, ie 'vector', 'monobook':

$wgDefaultSkin = "vector";

# Enabled skins.

# The following skins were automatically enabled:

wfLoadSkin( 'MonoBook' );

wfLoadSkin( 'Timeless' );

wfLoadSkin( 'Vector' );

# End of automatically generated settings.

# Add more configuration options below.

#Extensions

# VisualEditor

wfLoadExtension( 'VisualEditor' );

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

$wgHiddenPrefs[] = 'visualeditor-enable';

#Parsoid Connection

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

   #URL to the Parsoid instance

   'url' => 'http://bumblebee.fireampersand.ca:8001',

   'domain' => 'localhost',

   'prefix' => 'localhost'

   );

//$wgSessionsInObjectCache = true;

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

if ( $_SERVER['REMOTE_ADDR'] == '172.17.0.1'){

   $wgGroupPermissions['*']['read'] = true;

   $wgGroupPermissions['*']['edit'] = true;

};

ini_set('error_log','/tmp/php-error.log');

error_log($_SERVER['REMOTE_ADDR']);



Any help would be apreciated, been working on this since last night. FireAmpersand (talk) 19:44, 3 March 2020 (UTC)Reply

The host name in the url doesn't resolve http://bumblebee.fireampersand.ca/ Arlolra (talk) 16:04, 13 April 2020 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

Parsoid throws error: Template Fetch failure for \"Main_Page\": 500 in the log

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


My visual editor setup was working fine this afternoon, but then I started getting this error whenever I tried to use the editor: Error loading data from server: apierror-visualeditor-docserver-http: HTTP 500. I tried installing php7.2-curl (didn't work), so I decided to dive into the logs. There I found the following error: Template Fetch failure for \"Main_Page\": 500. I couldn't find anything on Google so I came here. The only thing I can think that might have caused it was me setting up Wikibase in preparation for importing some infoboxes from Wikipedia.

My setup: NodeJS 12.16, Mediawiki 1.34 (Bitnami edition), Ubuntu 16.04 LTS. AWS EC2 instance. 86.129.179.116 (talk) 17:50, 5 March 2020 (UTC)Reply

Did you try disabling Wikibase to see if it resolves the issue?
The 500 errors looks like something might be configured correctly in MediaWiki. Arlolra (talk) 18:38, 5 March 2020 (UTC)Reply
It was Wikibase in the end, thank you. 86.129.179.116 (talk) 07:57, 6 March 2020 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

"yum install git npm" doesn't work

[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 all, I have been trying to set up VisualEditor for two days now because of how much a nightmare this is and I have finally gotten to this point where I need to download parsoid. So I am on a shared server which means that I can't use sudo or apt-get so I need to use the development section of this article. However when I try to put in the command "yum install git npm" it responds with the folling error message:

CRITICAL:yum.cli:Config Error: Error accessing file for config file:///etc/yum.conf

The thing is I have absolutely no clue how to solve this and I am getting pretty sick and tired of dealing with this stuff so please any advice would help. I am using an SSH through my terminal, Bluehost as my hosting service, and cPanel as the management system. TheSplatGuy (talk) 02:12, 9 March 2020 (UTC)Reply

Tip: join us on MediaWiki_on_Discord for help.
I don't know your hosting provider, so this might not be helpful, but anyway: yum is also a package manager just like apt-get, so that might be the reason why you can't use it.
As you're running that command I assume git and npm are not installed... you can skip git by uploading through ssh/scp. npm: I assume you can install it by hand in your user folder, or you might not even need it if you are running the latest parsoid: it's been ported to php recently. However, I haven't used that yet, so I suggest you asking this on discord. Hope that helps. —Aron Man.🍂 editsđŸŒŸ 06:00, 10 March 2020 (UTC)Reply
I am sorry I did not mention this earlier but the hosting service I use is Bluehost. the hosting plan that I got is Shared hosting and I use cPanel for file management. from what I have done so far git works, but npm and yum do not (because they are not installed). TheSplatGuy (talk) 05:01, 12 March 2020 (UTC)Reply
As Aron said, yum is another package manager and if not installed may not be appropriate for your system.
You can download nodejs binaries directly from https://nodejs.org/en/download/ that comes with npm
But, support for Parsoid/JS on shared hosting has been lacking
You might have better luck setting up Parsoid/PHP,
https://www.mediawiki.org/wiki/Parsoid/PHP Arlolra (talk) 15:10, 13 April 2020 (UTC)Reply
Using Parsoid/PHP is a good idea. It's part of MediaWiki since 1.35 (October 2019), but it's not enabled by default (that's expected to change around or after June 2020). You find it in `vendor/wikimedia/parsoid` folder installed as a package by composer.
The mediawiki page describes the configuration, but there are some confusing bits. I've just recently set it up for myself so if you need help, I can be to your service (preferably on discord, but here too) @TheSplatGuy. —Aron Man.🍂 editsđŸŒŸ 20:40, 13 April 2020 (UTC)Reply
Feel free to update the page to clarify the confusing bits :) Arlolra (talk) 21:03, 13 April 2020 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

Using Parsoid independently

[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 folks. I recently got Parsoid running and ran into a bit of trouble. I wanted to generate (only) HTML from wikitext while using two extensions, Cite and Spoiler, with a few adjustments for Cite. However, I'm unable to find a way to reliably get the output I want. Pandoc and alternative parsers listed on MediaWiki have incomplete support at best and incorrect output at worst and other markup tools/languages like Markdown or AsciiDoc aren't versatile enough. It seems that, to modify Cite's settings, I need to use system messages for which I'd need MediaWiki set up, something I'd like to avoid as all I want is a parser. Is my current goal of using only Parsoid to generate HTML impossible? If not, how am I supposed to go about it? Am I misunderstanding things? I've jumped through a lot of hoops and tested a bunch of different parsers. I've exhausted all my options before asking here; I really wish to avoid writing HTML as much as I can and wikitext is the best lightweight markup language I've found, so I'd appreciate any help. AB1908 (talk) 09:19, 13 April 2020 (UTC)Reply

As long as you don't have templates and images, you can make this work. However, Parsoid does not know about the Spoiler extension and so you would need a Parsoid-native implementation of it. But, once that is in place, you can use the bin/parse.php script with the --mock option to parse your wikitext and generate HTML. It operates without MediaWiki.
If you do have templates and images, then, you will need to update the mocks to provide expected output for those templates / media requests (which is workable if you have a small number of them). SSastry (WMF) (talk) 14:29, 13 April 2020 (UTC)Reply
This is excellent. Thank you very much for the help and for the work on the parser in general (I honestly didn't expect a reply from the team lead). I have a few more questions if you could bear with me:
1. Where would I find a parsoid-native implementation of an extension? How do I "enable" it, so to speak, for Parsoid? Is it the source code of the extension?
2. What are "mocks"? I couldn't find much information on them. The --help for parse.js doesn't list them and I couldn't find documentation on them either. I am using an up-to-date copy of the source.
3. I would like to customise the output of the Cite extension which can be done via system messages. How do I do that without using MediaWiki? Do I have to change configurations elsewhere? (non essential, can be ignored) AB1908 (talk) 14:23, 14 April 2020 (UTC)Reply
For now, native extensions are in the Parsoid repo, in src/Ext/ and lib/ext/. They will eventually move to the respective extension repos.
Mocks weren't a concept in Parsoid/JS. You'd want to use the --offline flag for the same purpose. But keep in mind that Parsoid/JS is only getting security fixes and is rapidly approaching EOL. You should consider working with Parsoid/PHP Arlolra (talk) 19:40, 14 April 2020 (UTC)Reply
> For now, native extensions are in the Parsoid repo, in src/Ext/ and lib/ext/. They will eventually move to the respective extension repos.
I assume this means using the Spoiler extension is off the table. Regardless, thanks again for taking the time to help. AB1908 (talk) 12:03, 15 April 2020 (UTC)Reply
No, if you wrote a native implementation of it, there's an extension registration mechanism. The code can live wherever you want. Arlolra (talk) 13:54, 15 April 2020 (UTC)Reply
If https://github.com/Telshin/Spoilers/blob/master/SpoilersHooks.php is the spoiler extension, that should be fairly simple to implement. Take a look @ Parsoid/Extension API#Examples (but will require the master branch of Parsoid). If you are working with the JS version, it will still be simple, but you will have to take a look at Cite's ref.js file and the toDOM method there.
But anyway, yes, you will need to write that code before you can use the spoiler extension with Parsoid. SSastry (WMF) (talk) 22:12, 15 April 2020 (UTC)Reply
For example, see below:
[subbu@earth:~/work/wmf/parsoid] echo -e "a <ref>boo</ref>\n\n*a\n*b" | php bin/parse.php --mock --body_only --pageName 'Testing' --normalize=parsoid
<p>a <sup class="mw-ref" id="cite_ref-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{},"body":{"id":"mw-reference-text-cite_note-1"}}'><a href="./Testing#cite_note-1"><span class="mw-reflink-text">[1]</span></a></sup></p>
<ul>
<li>a</li>
<li>b</li>
</ul>
<div class="mw-references-wrap" typeof="mw:Extension/references" data-mw='{"name":"references","attrs":{},"autoGenerated":true}'>
<ol class="mw-references references">
<li id="cite_note-1"><a href="./Testing#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a> <span id="mw-reference-text-cite_note-1" class="mw-reference-text">boo</span></li>
</ol>
</div>
SSastry (WMF) (talk) 14:32, 13 April 2020 (UTC)Reply
The php script fails for me stating that ../vendor/autoload.php was not found. This is a total non-issue for me though as I have the JS version working. AB1908 (talk) 14:27, 14 April 2020 (UTC)Reply
You need to composer install before running the php script. Arlolra (talk) 19:33, 14 April 2020 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

Error from 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.


I have a MediaWiki installation with VisualEditor and Parsoid server.


This was working well until fairly recently. Something changed, but unfortunately, I can't identify what it was. Now when clicking the edit link on any page this error pops up:


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


MediaWiki: 1.30.0


Parsoid: 0.8.0


I get the same curl error if I try to use curl to test the parsoid server from the command line:
$ curl -L http: //localhost:8000/version

curl: (52) Empty reply from server


If I telnet to the port and type the GET command, I get a response:
$ telnet localhost 8000
Trying ::1...
Connected to localhost.
Escape character is '^]'.
GET /version

HTTP/1.1 200 OK
X-Powered-By: Express
Access-Control-Allow-Origin: *
Content-Type: application/json; charset=utf-8
Content-Length: 36
ETag: W/"24-4cl/tnkz8/d5N8Iw6BlbZIYKEhs"
Vary: Accept-Encoding
Date: Tue, 14 Apr 2020 16:55:33 GMT
Connection: close

{"name":"parsoid","version":"0.8.1"}Connection closed by foreign host.

Host is Centos release 7.7.1908


Eamercer (talk) 17:04, 14 April 2020 (UTC)Reply

Seems like there's something wrong with curl, since both php and the bin are stumbling.
Maybe try seeing what it's sending?
nc -l 8002
# in another terminal
curl localhost:8002
Arlolra (talk) 19:49, 14 April 2020 (UTC)Reply
$ nc -l 8002
GET / HTTP/1.1
User-Agent: curl/7.29.0
Host: localhost:8002
Accept: */*
Eamercer (talk) 20:02, 14 April 2020 (UTC)Reply
What does curl -v http://localhost:8000/version give you? Arlolra (talk) 20:25, 14 April 2020 (UTC)Reply
$ curl -v http://localhost:8000/version
* About to connect() to localhost port 8000 (#0)
*   Trying ::1...
* Connected to localhost (::1) port 8000 (#0)
> GET /version HTTP/1.1
> User-Agent: curl/7.29.0
> Host: localhost:8000
> Accept: */*
> 
* Empty reply from server
* Connection #0 to host localhost left intact
curl: (52) Empty reply from server
Eamercer (talk) 21:04, 14 April 2020 (UTC)Reply
Can you check the logs for anything of interest? Arlolra (talk) 21:59, 14 April 2020 (UTC)Reply
I'm not seeing anything in the system logs.
I also haven't been able to determine where the parsoid logs are or how to configure them.
I haven't increased the mediawiki logging, but since the problem can be demonstrated apart from the wiki, it didn't seem necessary at this point. Eamercer (talk) 11:58, 16 April 2020 (UTC)Reply
How did you install Parsoid? Arlolra (talk) 13:35, 16 April 2020 (UTC)Reply

git clone https://gerrit.wikimedia.org/r/p/mediawiki/services/parsoid
ln -s /usr/local/parsoid/ /opt/parsoid
npm install
cd ..
chown -Rv root:root parsoid
chmod -Rv u+rw,g+r,o+r parsoid
firewall-cmd --permanent --zone=public --add-port=8000/tcp
firewall-cmd --reload
cd parsoid/
cp config.example.yaml config.yaml
vim config.yaml
semanage port -m -t http_port_t -p tcp 8000
setsebool httpd_can_network_connect 0
setsebool -P httpd_can_network_connect 0
vi /etc/systemd/system/parsoid.service
systemctl start parsoid.service
config.yaml =
# This is a sample configuration file
#
# Copy this file to config.yaml and edit that file to fit your needs.
#
# Also see:
# - `npm start -- -h` for more information about passing config files via
#   the commandline.
# - lib/config/ParsoidConfig.js for all the properties that you can configure
#   here. Not all properties are documented here.
# The number of http workers (as opposed to `cpu_workers` below)
#num_workers: 1
worker_heartbeat_timeout: 300000
logging:
    level: info
#metrics:
#    type: log
services:
  - module: lib/index.js
    entrypoint: apiServiceWorker
    conf:
        # For backwards compatibility, and to continue to support non-static
        # configs for the time being, optionally provide a path to a
        # localsettings.js file.  See localsettings.example.js
        #localsettings: ./localsettings.js
        # Set your own user-agent string
        # Otherwise, defaults to:
        #   'Parsoid/<current-version-defined-in-package.json>'
        #userAgent: 'My-User-Agent-String'
        # Configure Parsoid to point to your MediaWiki instances.
        mwApis:
        - # This is the only required parameter,
          # the URL of you MediaWiki API endpoint.
          uri: 'http://localhost/migwiki/api.php'
          # The "domain" is used for communication with Visual Editor
          # and RESTBase.  It defaults to the hostname portion of
          # the `uri` property above, but you can manually set it
          # to an arbitrary string. It must match the "domain" set
          # in $wgVirtualRestConfig.
          domain: 'localhost'  # optional
          # To specify a proxy (or proxy headers) specific to this prefix
          # (which overrides defaultAPIProxyURI). Alternatively, set `proxy`
          # to `null` to override and force no proxying when a default proxy
          # has been set.
          #proxy:
          #    uri: 'http://my.proxy:1234/'
          #    headers:  # optional
          #        'X-Forwarded-Proto': 'https'
          # See below, defaults to true.
          #strictSSL: false
        # Enable using compute workers to parse requests.
        #useWorker: true
        # The number of workers in the pool spawned by each http worker to
        # call out for parsing.  Defaults to:
        #   ceil(number of cpus / `num_workers`) + 1
        #cpu_workers: 1
        # We pre-define wikipedias as 'enwiki', 'dewiki' etc. Similarly
        # for other projects: 'enwiktionary', 'enwikiquote', 'enwikibooks',
        # 'enwikivoyage' etc.
        # The default for this is false. Uncomment the line below if you want
        # to load WMF's config for wikipedias, etc.
        #loadWMF: true
        # A default proxy to connect to the API endpoints.
        # Default: undefined (no proxying).
        # Overridden by per-wiki proxy config in setMwApi.
        #defaultAPIProxyURI: 'http://proxy.example.org:8080'
        # Enable debug mode (prints extra debugging messages)
        #debug: true
        # Use the PHP preprocessor to expand templates via the MW API (default true)
        #usePHPPreProcessor: false
        # Use selective serialization (default false)
        #useSelser: true
        # Allow cross-domain requests to the API (default '*')
        # Sets Access-Control-Allow-Origin header
        # disable:
        #allowCORS: false
        # restrict:
        #allowCORS: 'some.domain.org'
        # Allow override of port/interface:
        #serverPort: 8000
        #serverInterface: '127.0.0.1'
        # Enable linting of some wikitext errors to the log
        #linting: true
        #linter:
        #  sendAPI: false # Send lint errors to MW API instead of to the log
        #  apiSampling: 10 # Sampling rate (1 / 10)
        # Require SSL certificates to be valid (default true)
        # Set to false when using self-signed SSL certificates
        # Note that this can also be applied per wiki in the mwApis above
        #strictSSL: false
        # Use a different server for CSS style modules.
        # Leaving it undefined (the default) will use the same URI as the MW API,
        # changing api.php for load.php.
        #modulesLoadURI: 'http://example.org/load.php'
Eamercer (talk) 14:51, 16 April 2020 (UTC)Reply
What's in /etc/systemd/system/parsoid.service Arlolra (talk) 17:26, 16 April 2020 (UTC)Reply
Unit]
Description=Mediawiki Parsoid web service on node.js
Documentation=http://www.mediawiki.org/wiki/Parsoid
Wants=local-fs.target network.target
After=local-fs.target network.target
[Install]
WantedBy=multi-user.target
[Service]
Type=simple
User=root
Group=root
WorkingDirectory=/usr/local/parsoid
# EnvironmentFile=-/etc/parsoid/parsoid.env
ExecStart=/usr/bin/node /usr/local/parsoid/bin/server.js
KillMode=process
Restart=on-success
PrivateTmp=true
StandardOutput=syslog
Eamercer (talk) 18:29, 16 April 2020 (UTC)Reply
Your config.yaml doesn't define any logging streams so it'll go to stdout
logging:
    level: info
which seems like systemd would send it to syslog
StandardOutput=syslog
Since you didn't see anything there, the curl request probably isn't even reaching the parsoid server.
Above, you demonstrated that telnet worked. Can you try with another tool like wget just to confirm it's only curl that's having the issue? Arlolra (talk) 18:42, 16 April 2020 (UTC)Reply
Also, you should confirm that there isn't any conflicting thing listening on 8000 Arlolra (talk) 18:45, 16 April 2020 (UTC)Reply
wget also connects but receives nothing:
$ wget http://localhost:8000/version
--2020-04-16 16:31:21--  http://localhost:8000/version
Resolving localhost (localhost)... ::1, 127.0.0.1
Connecting to localhost (localhost)|::1|:8000... connected.
HTTP request sent, awaiting response... No data received.
Retrying.
--2020-04-16 16:31:22--  (try: 2)  http://localhost:8000/version
Connecting to localhost (localhost)|::1|:8000... connected.
HTTP request sent, awaiting response... No data received.
Retrying.
etc.
If I stop the parsoid service, all connections to 8000 just fail immediately.
Could I change the config.yaml to force logging to a specific file? Eamercer (talk) 20:53, 16 April 2020 (UTC)Reply
Something like the following should work,
logging:
  level: info
  name: parsoid
  streams:
    - level: info
      path: /tmp/parsoid.log
      type: file
Arlolra (talk) 21:24, 16 April 2020 (UTC)Reply
I just ran

systemctl stop parsoid
strace -f -s80 npm start
Then I tried to get the version once via curl and once via telnet. Among the tons of system calls listed, the read of the GET from curl and from telnet are both seen.
$ grep 'GET \/version' /home/UPHS.PENNHEALTH.PRV/mercerea1/parsoid.script 
[pid 16579] read(14, "GET /version HTTP/1.1\r\nUser-Agent: curl/7.29.0\r\nHost: localhost:8000\r\nAccept: */"..., 65536) = 85
[pid 16590] read(14, "GET /version\r\n", 65536) = 14
Eamercer (talk) 21:15, 16 April 2020 (UTC)Reply
Try running on a different port `PARSOID_PORT=4444 npm start`, maybe something is up with your firewall?
Try passing the exact same string in telnet Arlolra (talk) 22:13, 16 April 2020 (UTC)Reply
I can send:
GET /version HTTP/1.1
and it will respond. It does not close the connection immediately after responding as it does if I just send:
GET /version
If I send exactly what curl sends:
GET /version HTTP/1.1
User-Agent: curl/7.29.0
Host: localhost:8000
Accept: */*
the server immediately closes the connection. I also tried sending the GET with the User-Agent, Host, and Accept separately, and the behavior is the same if any of those lines are sent with the GET. Eamercer (talk) 11:56, 17 April 2020 (UTC)Reply
Did you try running on a different port, as above?
What version of nodejs are you running? And since you installed from git, which parsoid commit are you on?
In older versions of nodejs, it closes without a 400 error when encountering an http parse error,
https://github.com/nodejs/node/commit/f2f391e575fc8072d10e1ad1601ef3f67f13a4db
You can try to catch that around here,
https://github.com/wikimedia/parsoid/blob/master/lib/api/ParsoidService.js#L235
Add something like,
server.on('clientError', (err, conn) => {
  console.error(err);
});
Arlolra (talk) 13:36, 17 April 2020 (UTC)Reply
Sorry. Yes, same behavior running on port 4444.
I've got nodejs version 6.12.3
I'm not sure how to get the parsoid commit. It's version 0.8.1 according to the package.json
Oddly, when I made the change to ParsoidService.js, it started responding to curl.
Now if I do
curl -L http://localhost:8000/version
It responds with:

{"name":"parsoid","version":"0.8.1"}
The console where parsoid is running outputs the following:
{ Error: Parse Error
    at Error (native) bytesParsed: 84, code: 'HPE_INVALID_TRANSFER_ENCODING' }
Of course, I immediately tried to edit a page in our wiki, which didn't work, but seemed to get further along before failing with "Error loading data from server: Could not connect to the server." During this, the console output the following:
{ Error: Parse Error
    at Error (native) bytesParsed: 911, code: 'HPE_UNEXPECTED_CONTENT_LENGTH' }
Eamercer (talk) 17:53, 17 April 2020 (UTC)Reply
That's an obscure error that points here,
https://github.com/nodejs/http-parser/blob/master/http_parser.c#L1902
I imagine what happened was the http-parser package in Centos was recently updated for,
https://www.tenable.com/plugins/nessus/134238
https://bugzilla.redhat.com/show_bug.cgi?id=1800364
https://github.com/nodejs/http-parser/commit/7d5c99d09f6743b055d53fc3f642746d9801479b
Maybe it got backported incorrectly or something.
Try a newer version of nodejs or download one directly from https://nodejs.org/en/download/ or contact the packager at Centos. Arlolra (talk) 18:31, 17 April 2020 (UTC)Reply
There was an update to http-parser installed on March 25th.
I installed node v0.10.46. Now when I enter npm start, it fails:
$ sudo npm start
> parsoid@0.8.1 start /usr/local/parsoid-0.8.1
> service-runner
/usr/local/parsoid-0.8.1/node_modules/service-runner/service-runner.js:12
const cluster = require('cluster');
^^^^^
SyntaxError: Use of const in strict mode.
    at Module._compile (module.js:439:25)
    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 Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:945:3
npm ERR! Linux 3.10.0-1062.18.1.el7.x86_64
npm ERR! argv "/usr/bin/node" "/bin/npm" "start"
npm ERR! node v0.10.46
npm ERR! npm  v2.15.1
npm ERR! code ELIFECYCLE
npm ERR! parsoid@0.8.1 start: `service-runner`
npm ERR! Exit status 8
npm ERR! 
npm ERR! Failed at the parsoid@0.8.1 start script 'service-runner'.
npm ERR! This is most likely a problem with the parsoid package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     service-runner
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs parsoid
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! 
npm ERR!     npm owner ls parsoid
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR!     /usr/local/parsoid-0.8.1/npm-debug.log
/usr/local/parsoid-0.8.1/npm-debug.log:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/bin/npm', 'start' ]
2 info using npm@2.15.1
3 info using node@v0.10.46
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info prestart parsoid@0.8.1
6 info start parsoid@0.8.1
7 verbose unsafe-perm in lifecycle true
8 info parsoid@0.8.1 Failed to exec start script
9 verbose stack Error: parsoid@0.8.1 start: `service-runner`
9 verbose stack Exit status 8
9 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/lib/utils/lifecycle.js:217:16)
9 verbose stack     at EventEmitter.emit (events.js:98:17)
9 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/lib/utils/spawn.js:24:14)
9 verbose stack     at ChildProcess.emit (events.js:98:17)
9 verbose stack     at maybeClose (child_process.js:766:16)
9 verbose stack     at Process.ChildProcess._handle.onexit (child_process.js:833:5)
10 verbose pkgid parsoid@0.8.1
11 verbose cwd /usr/local/parsoid-0.8.1
12 error Linux 3.10.0-1062.18.1.el7.x86_64
13 error argv "/usr/bin/node" "/bin/npm" "start"
14 error node v0.10.46
15 error npm  v2.15.1
16 error code ELIFECYCLE
17 error parsoid@0.8.1 start: `service-runner`
17 error Exit status 8
18 error Failed at the parsoid@0.8.1 start script 'service-runner'.
18 error This is most likely a problem with the parsoid package,
18 error not with npm itself.
18 error Tell the author that this fails on your system:
18 error     service-runner
18 error You can get information on how to open an issue for this project with:
18 error     npm bugs parsoid
18 error Or if that isn't available, you can get their info via:
18 error
18 error     npm owner ls parsoid
18 error There is likely additional logging output above.
19 verbose exit [ 1, true ]
Eamercer (talk) 18:32, 22 April 2020 (UTC)Reply
nodejs v0.10 is quite old. You're coming from v6.x, I think you meant to download v10 Arlolra (talk) 20:54, 22 April 2020 (UTC)Reply
You are correct, of course!
I just installed nodejs v 10.20.1 and everything is working again.
Thank you so much for your assistance and patience!

Eamercer (talk) 12:58, 23 April 2020 (UTC)Reply
No problem, I was curious Arlolra (talk) 14:09, 23 April 2020 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

expand templates locally

[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 mediawiki and parsoid setup locally

I am trying to expand templates locally, while coverting from wikitetx to HTML. But templates remain as it is.

can anyone suggest where i am going wrong 111.125.208.58 (talk) 13:58, 23 April 2020 (UTC)Reply

Are the templates defined in your local mediawiki instance? Arlolra (talk) 14:10, 23 April 2020 (UTC)Reply
How to do it,
I have enabled few extensions like ParserFunctions, Scribunto, to expand templates.
I am trying to convert "{{Convert|907|hp|kW PS|0|abbr=on}}" --> "907 hp (676 kW; 920 PS)" but i get output as "Template:Convert"

111.125.208.58 (talk) 14:40, 23 April 2020 (UTC)Reply
You need to create a page on your local wiki, //localhost/wiki/Template:Convert, or whathaveyou.
You can copy the source from enwiki,
https://en.wikipedia.org/w/index.php?title=Template:Convert&action=edit
Although, that seems to invoke a Scribunto module, so you'll also need a //localhost/wiki/Module:Convert as well.
Again, the source can be copied from,
https://en.wikipedia.org/w/index.php?title=Module:Convert&action=edit
Alternatively, depending on how you're planning on using the tool, you can set --domain en.wikipedia.org to use the templates defined there, but then you won't have access to the pages on your local wiki. Arlolra (talk) 14:49, 23 April 2020 (UTC)Reply
As @Arlolra said, if you don't have these templates, you will need to import them onto your wiki first. https://en.wikipedia.org/wiki/Special:Export is your friend. You would then import that to your local wiki via http://localhost/wiki/Special:Import SSastry (WMF) (talk) 23:11, 23 April 2020 (UTC)Reply
@Arlolra and @SSastry (WMF) Thanks for guidinig me through the solution,
Another question has arised to me, likewise i have multiple templates which i need to expand while converting from wikitext to HTML. So manual importing of each template could be cumbersome. Is there a way to download all the template dumps at once and then import to local mediwaiki. 111.125.208.58 (talk) 03:02, 24 April 2020 (UTC)Reply
Again, you might want to consider parsing with --domain en.wikipedia.org or wherever you're getting this content from, rather than your local wiki
There are larger project dumps you can import at https://meta.wikimedia.org/wiki/Data_dumps Arlolra (talk) 16:27, 1 July 2020 (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

[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 everyone!

I installed parsoid successfully. I was able to use the visual editor to edit a page at first but the second time I try to edit it I get the following error -

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


Any help would be greatly appreciated!!

Thanks JJ245-AA (talk) 13:11, 23 June 2020 (UTC)Reply

Can you provide some more information about the wiki and how it's configured? Arlolra (talk) 16:20, 1 July 2020 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

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


Hi everyone

I got a probleme with parsoid, when i did my request (html to wikitexte) i got a wikicode.txt but for every letter like é or à or ö parsoid translate this to Á©f and that for only one letter like é.

So my question is why parsoid translate like that,and i have to edit some config file to bypass this ? 77.204.146.31 (talk) 17:04, 25 June 2020 (UTC)Reply

I found the solution i just need to open my file html to coding="utf-8" 2A01:E0A:1EF:A2C0:E5DA:7BF2:9F73:CDDC (talk) 10:25, 26 June 2020 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

parsoid doesn't like tls 1.3

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


mediawiki 1.34.2 / parsoid 0.11.0all from the mw-repo on ubuntu 20.04, served by apache. apache redirects all non-https-requests to https, with

sslprotocol             all -SSLv3 -TLSv1 -TLSv1.1 -TLSv1.2

in the apache configuration i'm getting an

"Error loading data from server: apierror-visualeditor-docserver-http-error: http-bad-status. Would you like to retry?" error msg when trying to use visualeditor. in the logs:

{"name":"parsoid","hostname":"whatever","pid":483060,"level":60,"logType":"fatal/request","wiki":"wiki$0","title":"whatever", "oldId":null,"reqId":"d960f833d976986e93c7afeb","userAgent":"VisualEditor-MediaWiki/1.34.2","msg":"Template Fetch failure for \"whatever\": Error: write EPROTO 140430689695552:error:1409442E:SSL routines:ssl3_read_bytes:tlsv1 alert protocol version:../ssl/record/rec_layer_s3.c:1543:SSL alert number 70\n","stack":"Error: Template Fetch failure for \"whatever\": Error: write EPROTO 140430689695552:error:1409442E:SSL routines:ssl3_read_bytes:tlsv1 alert protocol version:../ssl/record/rec_layer_s3.c:1543:SSL alert number 70\n\n    at TemplateRequest.ApiRequest._requestCB (/usr/lib/parsoid/src/lib/mw/ApiRequest.js:414:15)\n    at Request.request [as _callback] (/usr/lib/parsoid/src/lib/mw/ApiRequest.js:332:35)\n    at self.callback (/usr/lib/parsoid/node_modules/request/request.js:185:22)\n    at Request.emit (events.js:198:13)\n    at Request.onRequestError (/usr/lib/parsoid/node_modules/request/request.js:877:8)\n    at ClientRequest.emit (events.js:203:15)\n    at TLSSocket.socketErrorListener (_http_client.js:401:9)\n    at TLSSocket.emit (events.js:198:13)\n    at errorOrDestroy (internal/streams/destroy.js:107:12)\n    at onwriteError (_stream_writable.js:436:5)\n    at onwrite (_stream_writable.js:461:5)\n    at _destroy (internal/streams/destroy.js:49:7)\n    at TLSSocket.Socket._destroy (net.js:614:3)\n    at TLSSocket.destroy (internal/streams/destroy.js:37:8)\n    at WriteWrap.afterWrite [as oncomplete] (net.js:791:10)","longMsg":"Template Fetch failure for \"whatever\": Error: write EPROTO 140430689695552:error:1409442E:SSL routines:ssl3_read_bytes:tlsv1 alert protocol version:../ssl/record/rec_layer_s3.c:1543:SSL alert number 70\n","levelPath":"fatal/request","time":"2020-07-01T15:11:18.900Z","v":0}


 removing -TLSv1.2 from the sslprotocol-config causes it to work as expected. 188.102.29.119 (talk) 15:29, 1 July 2020 (UTC)Reply


 not really parsoids fault, the nodejs 10.19 deb in ubuntu 20.04 doesn't know about tls v1.3 yet: 188.102.29.119 (talk) 15:58, 1 July 2020 (UTC)Reply
root@mediawiki:~# grep -i tlsv1. nodejs-10.19.0~dfsg/lib/_tls_common.js
  if (v === 'TLSv1') return TLS1_VERSION;
  if (v === 'TLSv1.1') return TLS1_1_VERSION;
  if (v === 'TLSv1.2') return TLS1_2_VERSION;
root@mediawiki:~# 188.102.29.119 (talk) 16:01, 1 July 2020 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

Parsoid doesn't run: "cannot find module index.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.


Hello Everyone,

Setup:

Mediawiki Version: 1.31

Node.js Version: 10.22.0

Parsoid Version: 0.9.0 from https://releases.wikimedia.org/parsoid/

OS: Ubuntu 18.04

I've been trying to get Parsoid and Visual Editor running for a while now.

Error

Visual Editor gives me this Error when I try to edit a page:

"Fehler beim Laden der Daten vom Server: apierror-visualeditor-docserver-http-error: (curl error: 7) Couldn't connect to server"

Also the Version page of my Wiki doesn't list Parsoid at all. I therefore concluded that Parsoid isn't running properly.

When I try to run Parsoid manually with the command: node bin/server.js

I get this error: https://pastebin.com/q7g2p3DY

When I try to start Parsoid with "sudo service parsoid restart" I get the error: "Failed to restart parsoid.service: Unit parsoid.service not found".

Parsoid Installation workflow:

wget https://releases.wikimedia.org/parsoid/parsoid_0.9.0all_all.deb

sudo dpkg -i parsoid_0.9.0all_all.deb

sudo apt-get install -f

Then I edited the config.yaml in /etc/mediawiki/parsoid adding my Api adress.

I did the same with the config.yaml in /usr/lib/parsoid/src.

I can curl my Api with "curl http://192.168.178.XX/XXXX/api.php"

Does anyone have an idea what I can do to makes this configuration work? Unfortunately I need some extensions for my project that are not supported beyond MW 1.31, so I can't just update to the latest version.

Cheers

AID-PMBD AID-PMBD (talk) 07:41, 7 August 2020 (UTC)Reply

See https://www.mediawiki.org/wiki/Talk%3AParsoid/2019#h-Cannot_find_module_%27%E2%80%A6/parsoid/node_modules/lib/index.js%27-2019-06-15T18%3A54%3A00.000Z for starters ... Arlolra (talk) 13:54, 7 August 2020 (UTC)Reply
Thank you for the reply.
I reinstalled parsoid following the instructions given in the post you linked me to, but now I get a different error when trying to run it:
Installation Workflow:
1.       cd /opt
2.       Sudo git clone --depth 1 --branch v0.9.0 https://gerrit.wikimedia.org/r/p/mediawiki/services/parsoid parsoid
3.       Config.yaml in cd /opt/parsoid edited
Error:
When using "node bin/server.js"
internal/modules/cjs/loader.js:638
   throw err;
   ^
Error: Cannot find module 'service-runner'
   at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
   at Function.Module._load (internal/modules/cjs/loader.js:562:25)
   at Module.require (internal/modules/cjs/loader.js:692:17)
   at require (internal/modules/cjs/helpers.js:25:18)
   at Object.<anonymous> (/opt/parsoid/bin/server.js:5:21)
   at Module._compile (internal/modules/cjs/loader.js:778:30)
   at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
   at Module.load (internal/modules/cjs/loader.js:653:32)
   at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
   at Function.Module._load (internal/modules/cjs/loader.js:585:3)
When using "sudo service parsoid start"
Failed to start parsoid.service: Unit parsoid.service not found.
Any idea as to where I went wrong this time?
Cheers
AID-PMBD AID-PMBD (talk) 08:06, 11 August 2020 (UTC)Reply
If someone has any idea as to what I could do to fix the issue it would be appreciated.
Cheers
AID-PMBD AID-PMBD (talk) 13:32, 24 August 2020 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

service doesn't terminate

[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 using service runner to use parsoid.js but it doesn't terminate even after I use runner.stop() argument, these are the options I passed to service runner what changes should be made here. {

       name: 'parsoid',
       module: 'node_modules/parsoid/lib/index.js',
       entrypoint: 'apiServiceWorker',
       conf: {
         timeouts: {
           // request: 4 * 60 * 1000, // Default
           request: 8 * 60 * 1000,
         },
         limits: {
           wt2html: {
             // maxWikitextSize: 1000000, // Default
             maxWikitextSize: 1000000 * 4,
             // maxListItems: 30000, // Default
             maxListItems: 30000 * 4,
             // maxTableCells: 30000, // Default
             maxTableCells: 30000 * 4,
             // maxTransclusions: 10000, // Default
             maxTransclusions: 10000 * 4,
             // maxImages: 1000, // Default
             maxImages: 1000 * 4,
             // maxTokens: 1000000, // Default
             maxTokens: 1000000 * 4,
           },
         },
         mwApis: [{
           uri: this.mw.apiUrl.href,
         }],
       },
     },

there was another service named MCS linked with it 2405:201:300B:8199:A13A:4053:59CD:BE98 (talk) 19:23, 17 October 2020 (UTC)Reply

We have *NOT* tested Parsoid/JS with node v0.12 and it is likely that is where this is failing. We will not be supporting Parsoid/JS on newer node versions since Parsoid has been ported over to PHP and is being integrated into MediaWiki core directly.
But, if we have a solution to this problem, we'll share here.
EDIT: I meant to say: we have *NOT* tested ... and missed the NOT, SSastry (WMF) (talk) 21:11, 17 October 2020 (UTC)Reply
hey thanks for replying but the parsoid doesn't terminate even on v0.12 I tried it at that point as well.... Manan jethwani (talk) 05:28, 18 October 2020 (UTC)Reply
services: [{
name: 'mcs',
module: 'node_modules/service-mobileapp-node/app.js',
conf: {
port: 6927,
mwapi_req: { Manan jethwani (talk) 05:39, 18 October 2020 (UTC)Reply
method: 'post',
uri: `https://Template:Domain${this.mw.apiUrl.pathname}`,
headers: {
'user-agent': 'Template:User-agent',
},
body: '{{ default(request.query, {}) }}',
},
restbase_req: {
method: 'Template:Request.method',
uri: 'http://localhost:8000/Template:Domain/v3/{+path}',
query: '{{ default(request.query, {}) }}',
headers: 'Template:Request.headers',
body: 'Template:Request.body',
}, Manan jethwani (talk) 05:40, 18 October 2020 (UTC)Reply
},
}, {
name: 'parsoid',
module: 'node_modules/parsoid/lib/index.js',
entrypoint: 'apiServiceWorker',
conf: {
limits: {
wt2html: {
// maxWikitextSize: 1000000, // Default
maxWikitextSize: 1000000 * 4,
// maxListItems: 30000, // Default
maxListItems: 30000 * 4,
// maxTableCells: 30000, // Default
maxTableCells: 30000 * 4,
// maxTransclusions: 10000, // Default
maxTransclusions: 10000 * 4,
// maxImages: 1000, // Default
maxImages: 1000 * 4,
// maxTokens: 1000000, // Default
maxTokens: 1000000 * 4,
},
},
mwApis: [{
uri: this.mw.apiUrl.href,
}],
}, Manan jethwani (talk) 05:40, 18 October 2020 (UTC)Reply
these are the all options I am using for services in service runner Manan jethwani (talk) 05:41, 18 October 2020 (UTC)Reply
Sorry, I edited my comment above, but we have *NOT* tested this with v0.12. SSastry (WMF) (talk) 15:00, 18 October 2020 (UTC)Reply
ok but can you just mention where are all the arguments for configuration mentioned so that I can try to apply it myself if possible Manan jethwani (talk) 19:59, 19 October 2020 (UTC)Reply
or at least just give me how you applied on older version of node.js so I can try it myself I really need this for js Manan jethwani (talk) 15:52, 20 October 2020 (UTC)Reply
I don't understand what you are asking. In any case, on Wikimedia wikis, we don't use Parsoid/JS anymore. We have switched over to Parsoid/PHP.
Maybe try with node v11 and see if it fixes your problem. SSastry (WMF) (talk) 18:39, 20 October 2020 (UTC)Reply
ok will try that but I just wanted proper docs where this might have been applied.....just an example on how I can apply Manan jethwani (talk) 19:02, 20 October 2020 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

MediaWiki 1.35 Error contacting the Parsoid/RESTBase server: (curl error: 28) Timeout was reached

[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 just installed MediaWiki 1.35 on an Amazon Linux EC2 server, with php 7.3 and MariaDB

Everything seems to work fine, except when I try to edit a page using VisualEditor.

I cannot load a page for editing, I get the error:

Error contacting the Parsoid/RESTBase server: (curl error: 28) Timeout was reached

I can edit a new page with VisualEditor, but I when I try to save it, I get the same error.

Error contacting the Parsoid/RESTBase server: (curl error: 28) Timeout was reached

I have no trouble reaching the page via the REST endpoint:

http://MyWayCoolIPAddress/rest.php/v1/page/Main_Page

Which returns:

// 20201019142902

// http://MyWayCoolIPAddress/rest.php/v1/page/Main_Page

{

 "id": 1,
 "key": "Main_Page",
 "title": "Main Page",
 "latest": {
   "id": 1,
   "timestamp": "2020-10-14T17:17:27Z"
 },
 "content_model": "wikitext",
 "license": {
   "url": "",
   "title": ""
 },
 "source": "MediaWiki has been installed.\n\nConsult the User's Guide for information on using the wiki software.\n\n== Getting started ==\n* Configuration settings list\n* MediaWiki FAQ\n* MediaWiki release mailing list\n* Localise MediaWiki for your language\n* Learn how to combat spam on your wiki"

}


If I try to call the API endpoint directly:

http://MyWayCoolIPAddress/api.php?action=visualeditor&paction=parse&page=Main_Page

I get a similar error:

{

   "error": {
       "code": "apierror-visualeditor-docserver-http-error",
       "info": "Error contacting the Parsoid/RESTBase server: (curl error: 28) Timeout was reached",
       "*": "See http://MyWayCoolIPAddress/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes."
   }

}

This is MediaWiki 1.35, and as far as I know it includes Parsoid-PHP, so I don't need to do any additional configuration.

I assume VisualEditor is not the problem because I can edit a new page, I just can't save it. CharlesCivi (talk) 22:16, 19 October 2020 (UTC)Reply

I get the same curl error 28, but when opening. It tries to load the editor but fails. On a fresh installation of 1.35... I'm using nginx. Berot3 (talk) 07:03, 23 October 2020 (UTC)Reply
Did you resolve this? I'm having the same issue, also running on AWS.
Squeak24 (talk) 17:03, 3 November 2020 (UTC)Reply
Didn't come to it yet... What Webserver are you using? Apache? Berot3 (talk) 13:58, 6 November 2020 (UTC)Reply
there is a fix for this ? 192.114.168.26 (talk) 07:49, 11 January 2021 (UTC)Reply
For me I did not get the error again. But I am now on Windows using the Bitnami-stack.
But using the docker from bitnmai I get a similar if not the same error, so it really depends on your setup I assume... No idea what the problem really causes... Berot3 (talk) 16:24, 11 January 2021 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

Multiple wikis same parsoid 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.


Hi,

I've a MediaWiki 1.35 (WikiA) running on ServerA with PHP 7.4 and a MediaWiki 1.33 (WikiB) running on ServerB with PHP 7.0. Is it possible to configure WikiB to use the Parsoid integrated with the WikiA? Or I've to deploy a Parsoid on ServerB?

WikiA was upgrated recently from an older MW version. Until then I had the WikiB working with a shared Parsoid on ServerA like this:

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

  'url' => 'http://ServerA:8142',
  'domain' => 'ServerB',
  'prefix' => 'ServerB',
  'forwardCookies' => true

); Dimassc (talk) 12:10, 18 November 2020 (UTC)Reply

Are you talking about the JS version of Parsoid or the PHP version of Parsoid?
If the PHP version, each wiki comes with its own Parsoid libraries. And, since, Parsoid/PHP needs PHP 7.2 at the minimum so you cannot run wikiB with the PHP version of Parsoid. SSastry (WMF) (talk) 15:06, 18 November 2020 (UTC)Reply
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

VisualEditor : Error Parsoid/RESTBase server (HTTP 500) when edit page with accents in title

[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 guys,

I'm having some issues when i try to edit pages with title containing accents (like Ă© Ăš ...) using the VisualEditor.

I have not issue when using the "wikicode" editor.

The exact error is "Error contacting the Parsoid/RESTBase server (HTTP 500)" but i'm not using the RESTBased VisualEditor.

The Wiki is private and running on an IIS Server. I am using MediaWiki 1.35, with the default version of VisualEditor.

The wiki's content is writen in Frensh so we use plenty of accents in our words and this bug quite annoying.

I have activated the following Extensions :

wfLoadExtension( 'ParserFunctions' );

wfLoadExtension( 'Scribunto' );

wfLoadExtension( 'TemplateData' );

wfLoadExtension( 'TemplateStyles' );

wfLoadExtension( 'VisualEditor' );

wfLoadExtension( 'WikiEditor' );

$wgScribuntoDefaultEngine = 'luastandalone';

Trying to fixe the problem i have tried the following user permissions

$wgGroupPermissions['user']['writeapi'] = true;

$wgGroupPermissions['*']['writeapi'] = true;

if ( !isset( $_SERVER['REMOTE_ADDR'] ) OR $_SERVER['REMOTE_ADDR'] == '127.0.0.1' ) {

   $wgGroupPermissions['*']['read'] = true;

   $wgGroupPermissions['*']['edit'] = true;

   $wgGroupPermissions['*']['writeapi'] = true;

}

and tried the options :

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

$wgDefaultUserOptions['visualeditor-editor'] = "visualeditor";

$wgHiddenPrefs[] = 'visualeditor-enable';

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

Did anybody cross similar error and have a fix to this? Is anyone running a wiki in Frensh or Spanish (for example) with no error like this?

Thank you

Geoffrey GeoffreyHfr (talk) 16:39, 15 December 2020 (UTC)Reply

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