Last modified: 2014-05-21 20:29:26 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T65365, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 63365 - Parsoid crashes on request (TypeError: undefined is not a function)
Parsoid crashes on request (TypeError: undefined is not a function)
Status: RESOLVED WORKSFORME
Product: Parsoid
Classification: Unclassified
General (Other open bugs)
unspecified
PC Linux
: Unprioritized critical
: ---
Assigned To: Gabriel Wicke
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-04-01 12:08 UTC by Karsten Priegnitz
Modified: 2014-05-21 20:29 UTC (History)
3 users (show)

See Also:
Web browser: Firefox
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Karsten Priegnitz 2014-04-01 12:08:09 UTC
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
Comment 1 Karsten Priegnitz 2014-04-02 19:12:21 UTC
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;
Comment 2 Karsten Priegnitz 2014-04-03 09:24:14 UTC
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
Comment 3 Gabriel Wicke 2014-05-21 20:29:26 UTC
The recommended way to deal with private wikis is documented at

https://www.mediawiki.org/wiki/Extension:VisualEditor#Linking_with_Parsoid_in_private_wikis

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links