Topic on Talk:Parsoid

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.