Page MenuHomePhabricator

Parsoid crashes on request (TypeError: undefined is not a function)
Closed, DeclinedPublic

Description

Author: koem

Description:
Setup:

  • Ubuntu 12.04
  • apache2
  • mediawiki 1.22.4
  • parsoid master 2014-04-01 12:58 UTC
  • nodejs 0.10.26-1chl1~precise1
  • VisualEditor snapshot REL1_22

This is the error I get when I do curl http://localhost:8000/localhost/Wiki_Test_Page or when I try to edit the page http://wiki.testwiki.com/wiki/Wiki_Test_Page as a logged in user (Popup says "Error loading data from server: parsoidserver-http-request-error: MWHttpRequest error. Would you like to retry?").

/usr/local/parsoid/api/ParsoidService.js:355
                                      callback();
                                      ^
TypeError: undefined is not a function
  at errCB (/usr/local/parsoid/api/ParsoidService.js:355:6)
  at /usr/local/parsoid/api/ParsoidService.js:361:12
  at /usr/local/parsoid/lib/mediawiki.parser.environment.js:241:3
  at setupWikiConfig (/usr/local/parsoid/lib/mediawiki.parser.environment.js:295:3)
  at Object.processSome [as _onImmediate] (/usr/local/parsoid/lib/mediawiki.ApiRequest.js:119:17)
  at processImmediate [as _immediateCallback] (timers.js:330:15)
worker 2394 died (8), restarting.
 - worker(2425) loading...
 - worker(2425) ready

The worker crashes and is restarted immediately. Always.

The Wiki is private. It worked until I imported some templates and deleted them again. But I can't imagine that this is the reason.

LocalPreferences.php:

require_once("$IP/extensions/VisualEditor/VisualEditor.php");
$wgVisualEditorParsoidURL = 'http://localhost:8000';
$wgDefaultUserOptions['visualeditor-enable'] = 1;
$wgHiddenPrefs[] = 'visualeditor-enable';
$wgVisualEditorParsoidForwardCookies = true;

api/localpreferences.js:

exports.setup = function( parsoidConfig ) {
      parsoidConfig.setInterwiki( 'localhost', 'http://wiki.testwiki.com/mediawiki/api.php' );
      parsoidConfig.useSelser = true;
};

Best,
Karsten


Version: unspecified
Severity: critical
OS: Linux
Platform: PC

Details

Reference
bz63365

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:04 AM
bzimport set Reference to bz63365.

koem wrote:

When I comment out these lines in LocalSettings.php - then it works. But then my wiki isn't private anymore ...

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

koem wrote:

ok, solved it by:

if ( $_SERVER['REMOTE_ADDR'] == '127.0.0.1' ) {
 $wgGroupPermissions['*']['read'] = true;
 $wgGroupPermissions['*']['edit'] = true;
} else {
 $wgGroupPermissions['*']['edit'] = false;
 $wgGroupPermissions['*']['read'] = false;
}

and in localsettings.js

parsoidConfig.setInterwiki( 'localhost', 'http://localhost/mediawiki/api.php' );

please add this to the documentation