Last modified: 2013-07-12 06:28:39 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 T53151, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 51151 - Print helpful 'your API is not reachable' message instead of TypeError: Cannot set property '0' of null at Object.WikiConfig
Print helpful 'your API is not reachable' message instead of TypeError: Canno...
Status: RESOLVED WORKSFORME
Product: Parsoid
Classification: Unclassified
General (Other open bugs)
unspecified
PC Linux
: Normal normal
: ---
Assigned To: Gabriel Wicke
: easy
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-11 01:52 UTC by Steph
Modified: 2013-07-12 06:28 UTC (History)
1 user (show)

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


Attachments

Description Steph 2013-07-11 01:52:08 UTC
I have just installed Parsoid for my private MediaWiki. However when I try to use VisualEditor, I got parsoidserver-http-bad-status: 500. Then I had checked localhost:8000, and that page displays correctly, but http://localhost:8000/en/Main_Page does not work as expected, and some error messages are thrown out.

 TypeError: Cannot set property '0' of null
    at Object.WikiConfig (/var/www/localhost/htdocs/wiki/extensions/Parsoid/js/lib/mediawiki.WikiConfig.js:52:29)
    at Function.MWParserEnvironment.getParserEnv (/var/www/localhost/htdocs/wiki/extensions/Parsoid/js/lib/mediawiki.parser.environment.js:268:16)
    at getParserServiceEnv (/var/www/localhost/htdocs/wiki/extensions/Parsoid/js/api/ParserService.js:365:22)
    at app.post.oldid (/var/www/localhost/htdocs/wiki/extensions/Parsoid/js/api/ParserService.js:629:2)
    at callbacks (/var/www/localhost/htdocs/wiki/extensions/Parsoid/js/node_modules/express/lib/router/index.js:272:11)
    at param (/var/www/localhost/htdocs/wiki/extensions/Parsoid/js/node_modules/express/lib/router/index.js:246:11)
    at pass (/var/www/localhost/htdocs/wiki/extensions/Parsoid/js/node_modules/express/lib/router/index.js:253:5)
    at Router._dispatch (/var/www/localhost/htdocs/wiki/extensions/Parsoid/js/node_modules/express/lib/router/index.js:280:5)
    at Object.Router.middleware [as handle] (/var/www/localhost/htdocs/wiki/extensions/Parsoid/js/node_modules/express/lib/router/index.js:45:10)
    at next (/var/www/localhost/htdocs/wiki/extensions/Parsoid/js/node_modules/express/node_modules/connect/lib/http.js:204:15)

My OS is Gentoo Linux with everything up-to-date.

I fetched the Parsoid extension by using git.

I have once tried to install nodejs by compiling the source code, but failed due to "Syntax error" when running ./configure . Then I had checked my OS repo, and found out that there is only net-libs/nodejs with no npm. I installed that.

net-libs/nodejs Installed versions:  0.10.8^t(19:04:51 07/10/13)
(masked by default, I unmasked that.)

And the remaining installation process are with no error.

I copied the api/localsettings.js.example to api/localsettings.js and changed the localhost to the IP address. Debug options is uncommented. Others remain the same.

That is all I have done to the whole Parsoid.
Comment 1 Gabriel Wicke 2013-07-11 15:28:03 UTC
Your wiki API is not reachable from the Parsoid machine. Configure it correctly in localsettings.js and verify that it is indeed reachable using wget, curl, w3m or any other tool of your choice.

Example commandline:

curl <yourApiURL>

We should probably print this information when the config request fails. Repurposing this bug for that.
Comment 2 ssastry 2013-07-11 16:04:27 UTC
I also see that you are using Node 0.10.8.  Note that currently Parsoid only supports node 0.8 (http://www.mediawiki.org/wiki/Parsoid#Use_node.js_0.8.2C_not_0.10)
Comment 3 Steph 2013-07-12 06:28:39 UTC
(In reply to comment #2)
> I also see that you are using Node 0.10.8.  Note that currently Parsoid only
> supports node 0.8
> (http://www.mediawiki.org/wiki/Parsoid#Use_node.js_0.8.2C_not_0.10)

Thank you for pointing out that. After I downgrade node.js to 0.8.23 everything works correctly. My fault. That works for me.

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


Navigation
Links