Topic on Talk:Parsoid

mediawiki into virtual machine problem with visualeditor

9
Summary by Arlolra

Make sure you can access the MediaWiki API from the Parsoid machine.

37.134.155.9 (talkcontribs)

I have installed mediawiki in a VM (ubuntu server 16.04) following setup given in mediawiki website. Files config.yaml and LocalSettings.php have the same 'domain' tag and the urls are reaching the correct site. As I connect from the host system I make some port forward on the VM network

host (browser) port guest (VM) port

127.0.0.1 2222 10.0.2.34 22

127.0.0.1 8081 10.0.2.34 80

127.0.0.1 8142 10.0.2.34 8142

I browe through the site ok, but when I try to edit a page with visualeditor, I get this error

Error loading data from server: apierror-visualeditor-docserver-http: HTTP 500

And in parsoid.log I get this:

{"name":"../src/lib/index.js","hostname":"pc","pid":3697,"level":40,"logType":"warn/api","wiki":"wiki$0","title":"Main_Page","oldId":null,"reqId":null,"userAgent":"VisualEditor-MediaWiki/1.30.0","msg":"Failed API request, {\"error\":{},\"retries-remaining\":1}","longMsg":"Failed API request,\n{\"error\":{},\"retries-remaining\":1}","levelPath":"warn/api","time":"2018-02-06T00:14:34.873Z","v":0}

{"name":"../src/lib/index.js","hostname":"pc","pid":3697,"level":40,"logType":"warn/api","wiki":"wiki$0","title":"Main_Page","oldId":null,"reqId":null,"userAgent":"VisualEditor-MediaWiki/1.30.0","msg":"Failed API request, {\"error\":{},\"retries-remaining\":0}","longMsg":"Failed API request,\n{\"error\":{},\"retries-remaining\":0}","levelPath":"warn/api","time":"2018-02-06T00:14:34.876Z","v":0}

{"name":"parsoid","hostname":"pc","pid":3697,"level":60,"err":{"message":"Config Request failure for \"uri\": Error: Invalid URI \"uri\"","name":"../src/lib/index.js","stack":"../src/lib/index.js: Config Request failure for \"uri\": Error: Invalid URI \"uri\"\n    at ConfigRequest.ApiRequest._requestCB (/usr/lib/parsoid/src/lib/mw/ApiRequest.js:415:15)\n    at self.callback (/usr/lib/parsoid/node_modules/request/request.js:186:22)\n    at emitOne (events.js:96:13)\n    at Request.emit (events.js:188:7)\n    at Request.init (/usr/lib/parsoid/node_modules/request/request.js:274:17)\n    at new Request (/usr/lib/parsoid/node_modules/request/request.js:128:8)\n    at request (/usr/lib/parsoid/node_modules/request/index.js:53:10)\n    at ConfigRequest.ApiRequest.request (/usr/lib/parsoid/src/lib/mw/ApiRequest.js:336:9)\n    at ConfigRequest.ApiRequest._requestCB (/usr/lib/parsoid/src/lib/mw/ApiRequest.js:412:9)\n    at self.callback (/usr/lib/parsoid/node_modules/request/request.js:186:22)\n    at emitOne (events.js:96:13)\n    at Request.emit (events.js:188:7)\n    at Request.init (/usr/lib/parsoid/node_modules/request/request.js:274:17)\n    at new Request (/usr/lib/parsoid/node_modules/request/request.js:128:8)\n    at request (/usr/lib/parsoid/node_modules/request/index.js:53:10)\n    at ConfigRequest.ApiRequest.request (/usr/lib/parsoid/src/lib/mw/ApiRequest.js:336:9)","levelPath":"fatal/request"},"msg":"Config Request failure for \"uri\": Error: Invalid URI \"uri\"","time":"2018-02-06T00:14:34.881Z","v":0}

Any help please!?

Thanks

Arlolra (talkcontribs)

Error: Invalid URI \"uri\"" suggests something might be wrong with you config.yaml

Can you post what you have for mwApis?

46.222.181.232 (talkcontribs)

In fact, if I change uri value to be something different , even with no sense, the error is the same.

In mwApis (config.yaml) I have this:

       mwApis:

       - # This is the only required parameter,

         # the URL of you MediaWiki API endpoint.

         uri: 'http://127.0.0.1:8081/mediawiki/api.php'

         # The "domain" ...

         domain: 'localhost'  # optional

And in wgVirtualRestConfig (LocalSettings,php):

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

       'url' => 'http://127.0.0.1:8142',

       'domain' => 'localhost',

       'prefix' => 'localhost'

);

Arlolra (talkcontribs)

Do you maybe have localsettings.js lying around as well? Parsoid might be picking that up. Or, maybe the config.yaml you're editing isn't the right one (since changing it should have some effect)?

37.134.155.9 (talkcontribs)

I'm sorry the message is the same in the web page, but not in parsoid.log. I find another config file but seeing its contents, I think I has nothing to do.

sudo find / -name config.yaml

/usr/lib/parsoid/node_modules/service-runner/config.yaml

/etc/mediawiki/parsoid/config.yaml

But

sudo find / -name localsettings.js

gives me nothing.

I've made another test:

sudo systemctl stop parsoid.service

sudo rm /var/log/parsoid/parsoid.log

sudo nano /etc/mediawiki/parsoid/config.yaml

(I set the urls as in my first post)

sudo systemctl start parsoid.service

I load main page in wiki site, and try to edit it, the same error appears y de web page. Now I get this error (which I had also seen before).

{"name":"../src/lib/index.js","hostname":"pc","pid":1753,"level":40,"logType":"warn/api/econnrefused","wiki":"wiki$0","title":"Main_Page","oldId":null,"reqId":null,"userAgent":"VisualEditor-MediaWiki/1.30.0","msg":"Failed API request, {\"error\":{\"code\":\"ECONNREFUSED\",\"errno\":\"ECONNREFUSED\",\"syscall\":\"connect\",\"address\":\"127.0.0.1\",\"port\":8081},\"retries-remaining\":1}","longMsg":"Failed API request,\n{\"error\":{\"code\":\"ECONNREFUSED\",\"errno\":\"ECONNREFUSED\",\"syscall\":\"connect\",\"address\":\"127.0.0.1\",\"port\":8081},\"retries-remaining\":1}","levelPath":"warn/api/econnrefused","time":"2018-02-06T17:54:20.001Z","v":0}

{"name":"../src/lib/index.js","hostname":"pc","pid":1753,"level":40,"logType":"warn/api/econnrefused","wiki":"wiki$0","title":"Main_Page","oldId":null,"reqId":null,"userAgent":"VisualEditor-MediaWiki/1.30.0","msg":"Failed API request, {\"error\":{\"code\":\"ECONNREFUSED\",\"errno\":\"ECONNREFUSED\",\"syscall\":\"connect\",\"address\":\"127.0.0.1\",\"port\":8081},\"retries-remaining\":0}","longMsg":"Failed API request,\n{\"error\":{\"code\":\"ECONNREFUSED\",\"errno\":\"ECONNREFUSED\",\"syscall\":\"connect\",\"address\":\"127.0.0.1\",\"port\":8081},\"retries-remaining\":0}","levelPath":"warn/api/econnrefused","time":"2018-02-06T17:54:20.016Z","v":0}

{"name":"parsoid","hostname":"pc","pid":1753,"level":60,"err":{"message":"Config Request failure for \"http://127.0.0.1:8081/mediawiki/api.php\": Error: connect ECONNREFUSED 127.0.0.1:8081","name":"../src/lib/index.js","stack":"../src/lib/index.js: Config Request failure for \"http://127.0.0.1:8081/mediawiki/api.php\": Error: connect ECONNREFUSED 127.0.0.1:8081\n    at ConfigRequest.ApiRequest._requestCB (/usr/lib/parsoid/src/lib/mw/ApiRequest.js:415:15)\n    at self.callback (/usr/lib/parsoid/node_modules/request/request.js:186:22)\n    at emitOne (events.js:96:13)\n    at Request.emit (events.js:188:7)\n    at Request.onRequestError (/usr/lib/parsoid/node_modules/request/request.js:878:8)\n    at emitOne (events.js:101:20)\n    at ClientRequest.emit (events.js:188:7)\n    at Socket.socketErrorListener (_http_client.js:310:9)\n    at emitOne (events.js:96:13)\n    at Socket.emit (events.js:188:7)\n    at emitErrorNT (net.js:1281:8)\n    at _combinedTickCallback (internal/process/next_tick.js:80:11)\n    at process._tickCallback (internal/process/next_tick.js:104:9)","levelPath":"fatal/request"},"msg":"Config Request failure for \"http://127.0.0.1:8081/mediawiki/api.php\": Error: connect ECONNREFUSED 127.0.0.1:8081","time":"2018-02-06T17:54:20.021Z","v":0}

Arlolra (talkcontribs)

Parsoid is having trouble connecting to your MediaWiki API at http://127.0.0.1:8081/mediawiki/api.php

Are you sure that url works? What happens when you curl it from the same machine Parsoid is running on?

37.134.155.9 (talkcontribs)

That was the point, I was only testing that url on the host machine.

I 've changed Apache to listen on 8081 and the port forward of that VM (guest) to be listening on that port and now it works!

Thanks a lot for your support!!

This post was hidden by 37.134.155.9 (history)
Djmaxx007 (talkcontribs)

"37.134.155.9", I'm done. I've had it. I'm not messing with trying to install visual editor any more. If you have a vm with visual editor working, I would be ultimately graced by your kindness if I could have a copy of it. I am willing to reimburse your for your time in making it as it is wasting my time/money. Please let me know. Thank you.