Talk:Parsoid

Jump to navigation Jump to search

About this board

Smurfy (talkcontribs)

Getting this error when trying to do sudo apt-add-repository on Ubuntu 18.04, I swear it was working the other day.

W: GPG error: http://webmin.mirror.somersettechsolutions.co.uk/repository sarge Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY D97A3AE911F63C51

E: The repository 'http://webmin.mirror.somersettechsolutions.co.uk/repository sarge Release' 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.

W: GPG error: http://download.webmin.com/download/repository sarge Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY D97A3AE911F63C51

E: The repository 'http://download.webmin.com/download/repository sarge Release' 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.

Reply to "Repo not signed error"
Summary by Arlolra

Run in the root of the deploy repo

Squeak24 (talkcontribs)

Hi Everyone.

Just further to this thread Topic:Uchpv0wwa3sc6e2o, since that thread I have moved the Wiki to a new server, hence the reason for the delay in coming back to this.

I have done what was suggested and downloaded the deployment version of Parsoid and have installed node.js onto the server. I have tried to run

node bin\server.js

From the parsoid directory, but I get the error:

D:\wamp64\www\node_modules\parsoid>node -v

v8.12.0

D:\wamp64\www\node_modules\parsoid>node bin\server.js

module.js:550

    throw err;

    ^

Error: Cannot find module 'service-runner'

    at Function.Module._resolveFilename (module.js:548:15)

    at Function.Module._load (module.js:475:25)

    at Module.require (module.js:597:17)

    at require (internal/module.js:11:18)

    at Object.<anonymous> (D:\wamp64\www\node_modules\parsoid\bin\server.js:5:21

)

    at Module._compile (module.js:653:30)

    at Object.Module._extensions..js (module.js:664:10)

    at Module.load (module.js:566:32)

    at tryModuleLoad (module.js:506:12)

    at Function.Module._load (module.js:498:3)

My LocalSettings.php looks like this:

wfLoadExtension( 'VisualEditor' );

//Enable by default for everybody

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

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

    // URL to the Parsoid instance

    // Use port 8142 if you use the Debian package

    'url' => 'http://domain.com:8000',

);

And my config.yamb looks like this:

mwApis:

        - # This is the only required parameter,

          # the URL of you MediaWiki API endpoint.

          uri: 'http://domain.com/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

I have localsettings.js commented out at the moment, but either way it still doesn't seem to want to work.

I'm not sure what I'm doing wrong.

Any help is appreciated.

Arlolra (talkcontribs)

What's the path the deploy repo you downloaded? You should be running the command from the root of that directory.

Squeak24 (talkcontribs)

I have tried to have the deploy repo in the www directory, I changed the directory command prompt to that directory. I also put it in the Users AppData but still nothing. I have tried nodejs as well but that comes back with nothing.

I am using a server that is not connected to the Internet, it is connected to the internal network without Internet access.

Any help is appreciated.

210.50.246.156 (talkcontribs)

OK, I found out what the issue was, I downloaded the wrong version. I have it working now. Just need to get restBase installed now.

Kwmedaw1 (talkcontribs)

Hello. i was following this step : Parsoid/Setup#Windows

and I'm struggling with installation.

  • Here's my log files :

I already tried :

  • npm install -g abbrev@1.0.9
  • npm install -g abbrev
  • npm cache clean
  • npm cache verify
  • npm install parsoid --no-optional
  • npm install --no-optional

and also..

  • delete package-lock.jspn and reinstall

and...

  • i couldn't find folder '.staging'
  • my OS is Windows 10

Thank you!

Reply to "problem with abbrev"

Parsoid installation problem Ubuntu 14.04

2
Summary by Arlolra

User disappeared

Bekircem (talkcontribs)

Hi, when i use install command it gives me that output.


The following extra packages will be installed:

 parsoid

0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Arlolra (talkcontribs)

To clarify, you ran apt-get install parsoid and it's listing it as an extra package to install?

Resolving Parsoid URI to local file rather than going through the public domainname

6
Summary by Arlolra

User disappeared

62.181.223.54 (talkcontribs)

Hi, I was just wondering.

Is it possible to configure the URI setting in config.yaml to point to the API locally, rather than using the public address. Parsoid and MediaWiki are both installed on the same machine.

I've been having issues with VisualEditor getting stuck loading, only to time out.

When checking the cmd I get an error saying API Request Failed. Sometimes I also get the error Unacceptable profile string: text/html

I'm running it all on a Windows Server 2012 R2

Arlolra (talkcontribs)

Yes, it's fine to configure a local host.

62.181.223.54 (talkcontribs)

I am unable to correctly parse the string so that it manages to find the API file locally.

http://localhost resolves to nothing so I can't point to the api file that way and I cannot use the file:// path to point to it either, since I receive and error that it is an unsupported format.

Do I need to set up a new IIS Site that points to the same location as the wiki so that I may use http://localhost/api.php?

Arlolra (talkcontribs)

Yes

62.181.223.54 (talkcontribs)

It worked, but unfortunately it did not resolve the issue. Thank you Arlolra regardless.

Arlolra (talkcontribs)

The cycle of a request generally looks like,

VE (browser) -> MediaWiki API > Parsoid > MediaWiki API (at this point, Parsoid makes some calls back to the MediaWiki API for various bits of information, like config, image info, etc.)

There's a potential for deadlocks if your server doesn't support some level of concurrency, but I'm not sure that's happening in this case.

Can you get Parsoid to render a page, independent of VE? Try something like,

curl http://localhost:8000/localhost/v3/page/html/Main_Page

(or, a variation on that based on your setup.)

Summary by Arlolra

Try with --offline

Julio974gaming (talkcontribs)

I'm searching for a program that just takes plain Wikicode (I know how to code with it) and converts it to simple html, without the complicated things of hosting a wiki on my computer or things like that.

All of that offline, on a simple computer, installing as fewer things as possible (If I can, just make everything to install hold in a simple folder or USB key), with quite low programming skills.

I wonder if Parsoid fulfils these criteria (I couldn't get a lot of informations from the page).

Thank you for any answer!

Arlolra (talkcontribs)

That somewhat depends on your definition of "offline".

Parsoid's bin/parse.js has a flag --offline that will render your html without making any http requests, but you wouldn't be able to, for example, expand templates and fetch image info, since it requires access to a MediaWiki API for that kind of state.

If your MediaWiki API is local to your host, you can --configure Parsoid to use that and it won't make any external requests.

Julio974gaming (talkcontribs)

I don't need to "host a wiki", but just to be able to simply convert wikicode text to html text. I forgot to clarify that. Is that still possible? Or is there another program that allows me to simply convert wikicode to html?

Arlolra (talkcontribs)

Then the --offline option from above should be fine

Julio974gaming (talkcontribs)

And how should I use it? I remind that I'm a novice in cmd and github-related things

Arlolra (talkcontribs)
Julio974gaming (talkcontribs)

Is there a way to : 1) Give the link to a file with the wikicode, so it converts the entire things and output another file with the html? 2) Install this without Git and Nodejs (or, at least, to install both of these things in a single folder with nothing out of that)?

Arlolra (talkcontribs)

--inputfile for the way in, output goes to stdout which you can pipe to a file

See --help

Node.js is required

Julio974gaming (talkcontribs)

Ok, I'll try it this weekend!

HTTP Error 500/API Request

3
Summary by Arlolra

SQLite isn't well tested, try MariaDB

BadDevilGrind (talkcontribs)

Like several others I've been having issues with HTTP Error 500/API Request ESOCKETTIMEOUT with Parsoid.

It doesn't happen every time i click Edit on VisualEditor, but once every so often.

I've read through the various threads here but none of the solutions seem to work.

I can access localhost:8000 and confirm that Parsoid is running, and I can parse the pages of the wiki.

I am running Windows Server 2012 R2 with IIS 8 as the HTTP Server.

I am running Parsoid 0.9.0

Regarding PHP I have verified that Curl 7.59.0 is up and running (according to my php.php info file)

The wiki is private to edit but not to read. I have gone through the VisualEditor on private wiki section and both tried forwarding the cookies and the current method of authorizing the Parsoid user from localhost.

Here is my Special:Version information

Product Version
MediaWiki 1.31.0
PHP 7.2.7 (cgi-fcgi)
SQLite 3.20.1
Lua 5.1.4
Special pages
Extension Version
Renameuser
Replace Text 1.4.1
Editors
Extension Version
VisualEditor 0.1.0 (13a585a)01:14, 31 May 2018
WikiEditor 0.5.1
Parser hooks
Extension Version
CategoryTree
Cite
ImageMap
InputBox 0.3.0
ParserFunctions 1.6.0
Scribunto (106fbf4)18:24, 15 May 2018
TemplateData 0.1.2 (61adb16)21:58, 13 July 2018
Media handlers
Extension Version
PDF Handler
Spam prevention
Extension Version
ConfirmEdit 1.5.1
SpamBlacklist
TitleBlacklist 1.5.0
API
Extension Version
ParsoidBatchAPI 1.0.0 (c09fdaa)08:05, 14 April 2018
Other
Extension Version
NetworkAuth 2.1.2 (58ddb5e)23:12, 9 March 2018

Here are my settings:

LocalSettings.php

(I've tried using both CACHE_DB and CACHE_ACCEL)

$wgMainCacheType = CACHE_DB;
$wgMessageCacheType = CACHE_NONE;
$wgParserCacheType = CACHE_NONE;
$wgSessionCacheType = CACHE_DB;
$wgLanguageConverterCacheType = CACHE_NONE;

$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'
);

require_once "$IP/extensions/NetworkAuth/NetworkAuth.php";
$wgNetworkAuthUsers[] = [
	'iprange' => [ '127.0.0.1' ],
	'user'    => 'Parsoid'
];

//Extensions

$wgSessionsInObjectCache = true;
wfLoadExtension( 'CategoryTree' );
wfLoadExtension( 'Cite' );
wfLoadExtension( 'ConfirmEdit' );
wfLoadExtension( 'ImageMap' );
wfLoadExtension( 'PdfHandler' );
wfLoadExtension( 'Renameuser' );
wfLoadExtension( 'ReplaceText' );
wfLoadExtension( 'SpamBlacklist' );
wfLoadExtension( 'TitleBlacklist' );
wfLoadExtension( 'WikiEditor' );
wfLoadExtension( 'TemplateData' );
wfLoadExtension( 'ParserFunctions' );
wfLoadExtension( 'Scribunto' );
wfLoadExtension( 'InputBox' );
wfLoadExtension( 'ParsoidBatchAPI' );

$wgGroupPermissions['*']['createaccount'] = false;
$wgGroupPermissions['*']['edit'] = false;
$wgGroupPermissions['*']['read'] = true;

config.yaml

worker_heartbeat_timeout: 300000

mwApis:
        
          uri: 'http://localhost/api.php'
          domain: 'localhost'  # optional

In the parsoid cmd window I receive the following errormessage:

{"name":"parsoid","hostname":"$HOSTNAME","pid":808,"level":40,"levelPath":"warn/service-runner","msg":"startup finished","time":"2018-08-22T16:15:43.750Z","v":0}

{"name":"parsoid","hostname":"$HOSTNAME","pid":600,"level":60,"err":{"message":"API response Error for ConfigRequest: request=; error={\"code\":\"internal_api_error_DBQueryError\",\"info\":\"[c6eb657c71f3558d1e84d16b] Database query error.\"}",

"name":"lib/index.js","stack":"lib/index.js: API response Error for ConfigRequest: request=; error={\"code\":\"internal_api_error_DBQueryError\",\"info\":\"[c6eb657c71f3558d1e84d16b]

Database query error.\"}\n at ConfigRequest.ApiRequest._errorObj (C:\\Users\\Administrator\\node_modules\\parsoid\\lib\\mw\\ApiRequest.js:347:9)\n   

at ConfigRequest._handleJSON (C:\\Users\\Administrator\\node_modules\\parsoid\\lib\\mw\\ApiRequest.js:919:18)\n

    at ConfigRequest.ApiRequest._logWarningsAndHandleJSON (C:\\Users\\Administrator\\node_modules\\parsoid\\lib\\mw\\ApiRequest.js:438:7)\n

    at ConfigRequest.ApiRequest._handleBody (C:\\Users\\Administrator\\node_modules\\parsoid\\lib\\mw\\ApiRequest.js:474:7)\n

    at ConfigRequest.ApiRequest._requestCB (C:\\Users\\Administrator\\node_modules\\parsoid\\lib\\mw\\ApiRequest.js:417:8)\n

    at Request.self.callback (C:\\Users\\Administrator\\node_modules\\parsoid\\node_modules\\request\\request.js:186:22)\n

at emitTwo (events.js:126:13)\n

at Request.emit (events.js:214:7)\n

at Request.<anonymous> (C:\\Users\\Administrator\\node_modules\\parsoid\\node_modules\\request\\request.js:1163:10)\n

    at emitOne (events.js:116:13)\n

    at Request.emit (events.js:211:7)\n

    at IncomingMessage.<anonymous> (C:\\Users\\Administrator\\node_modules\\parsoid\\node_modules\\request\\request.js:1085:12)\n

    at Object.onceWrapper (events.js:313:30)\n

    at emitNone (events.js:111:20)\n

at IncomingMessage.emit (events.js:208:7)\n

at endReadableNT (_stream_readable.js:1064:12)","levelPath":"fatal/request"},"msg":"API response Error for ConfigRequest: request=; error={\"code\":\"internal_api_error_DBQueryError\",\"info\":\"[c6eb657c71f3558d1e84d16b] Database query error.\"}","time":"2018-08-22T16:15

:58.500Z","v":0}

$HOSTNAME is the computers hostname.

Arlolra (talkcontribs)
BadDevilGrind (talkcontribs)

I'll try using that.

Any tips for the migration process from SQLLite to MySQL?

EDIT: I think I managed to successfully migrate the Wiki.

I simply copied the wiki folder before dumping the pages into a .xml and removed the LocalSettings to run trough the config script again and set up the Wiki with MariaDB. Afterwards I imported the dump.xml and imported the images.

Regardless, the VisualEditor and Parsoid seems to be working now. Thank you very much Arlolra.

John Harry Lau (talkcontribs)

Finally! After 1 year with pc reset, I got parsoid with no npm erroors (warnings doesn't effect it too much)! Now, because I need to get parsoid live with visual editor without keeping the device on, I found 2 hosting providers (plans for free), well yeah, I will use them for visual editor live, but how?

Reply to "Tutorial for heroku/glitch.io?"

Failed API request with warn/api/esockettimedout with VisualEditor on Windows

3
Summary by Arlolra

Set CACHE_NONE?

Czech.Fox (talkcontribs)

This is my solution for others having this issue.

Windows machine - Windows Server 2008 R2, PHP 7.1.14 (php-cgi.exe), NodeJS 8.9.1 LTS, Parsoid 0.8.0, MediaWiki 1.30, SQLite database, Firewall open local port 8000 on nodejs.exe This solution is for all having a working VisualEditor but randomly and often gets "Error loading data from server: Could not connect to the server" when opening VisualEditor.

The cause is in enabled caching in LocalSettings.php. Parsoid is calling MediaWiki API but the request may take for bigger and heavily edited pages even 60s+. So, the request fails with "esockettimedout" exception which is subsequently passed to the VisualEditor giving this error popup.

My original failing setting used to be:

$wgMainCacheType = CACHE_DB;
$wgMessageCacheType = CACHE_DB;
$wgParserCacheType = CACHE_DB;
$wgSessionCacheType = CACHE_DB;
$wgLanguageConverterCacheType = CACHE_DB;

My new working setting is:

$wgMainCacheType = CACHE_DB;
$wgMessageCacheType = CACHE_NONE;
$wgParserCacheType = CACHE_NONE;
$wgSessionCacheType = CACHE_DB;
$wgLanguageConverterCacheType = CACHE_NONE;

I got this inspiration from topic https://www.mediawiki.org/wiki/Topic:Slfskc3j2n1c22p3 where @Arlolra was wondering if it is by caching.

Whatamidoing (WMF) (talkcontribs)

Thank you for this!

Would you like to add it to VisualEditor/Recipes, where someone was trying to collect some tips and tricks?

This post was hidden by Arlolra (history)

Write Permission Denied

3
Summary by Arlolra

User disappeared

73.32.251.160 (talkcontribs)

Hi, complete novice here. Way over my head. Installed Parsoid and Visual Editor on Mediawiki (Bitnami on AWS). Website says "internal api error" when trying to use VIsual Editor. Using PuTTY to access localsettings and Parsoid config.yaml, but I get back "no write permission". Try looking up settings.js (or localsettings.js) for Parsoid, but those are not found.

Arlolra (talkcontribs)

Did you confirm your wiki was working without the VE/Parsoid combo? Probably a good place to start.

Whatamidoing (WMF) (talkcontribs)