Page MenuHomePhabricator

RESTBase fails to start up on MW-Vagrant
Closed, InvalidPublic

Description

I just did a fresh install of MediaWiki-Vagrant on OS X 10.11.3. After adding visualeditor to the enabled roles and provisioning the VM (multiple times), the Edit tab is still not available and VE seems nowhere to be found.

Note that I haven't enabled the parsoid role, since according to https://www.mediawiki.org/wiki/Parsoid it isn't necessary. Also since moving to RESTBase I've heard this role has been deprecated.

Another weird thing is that I can actually invoke the VE loading bar through injecting veaction=edit in the query string, but it hangs midway through the loading and throws a 503 error.

Event Timeline

ferdbold raised the priority of this task from to Needs Triage.
ferdbold updated the task description. (Show Details)
ferdbold added a subscriber: ferdbold.
Restricted Application added subscribers: StudiesWorld, Aklapper. · View Herald TranscriptFeb 10 2016, 6:01 AM

The visualeditor role actually installs both Parsoid and RESTBase behind the scenes but you won't see them listed with vagrant roles list --enabled.

The way that VE is configured by default you won't get 2 edit buttons. The first time you hit edit it should pop up a chooser that lets you pick VE or use the traditional wikitext editor. This confused the heck out of me for a while but @Jdforrester-WMF assured me that it is by design.

If veaction=edit is hanging you may have some bit (RESTBase, Parsoid) that isn't working quite right. Often a vagrant git-update will magically fix that. Fair warning that command can be very slow due to it completely reloading all of the nodejs dependency libraries.

If that doesn't fix things for you, look in you vagrant/logs directory for errors and check your javascript console in the browser as well.

I am not getting a prompt to choose either VE or wikitext... I only have an "Edit Source" button which takes me to the wikitext editor.

I've ran git-update and provision multiple times, but that didn't do the trick either.

I noticed in VE's documentation a chunk of code that is supposed to be put in LocalSettings.php, but I'm not seeing it in my installation. Could this be the culprit?

(Can't check logs since I'm on a phone at the moment but I'll take a peek tomorrow)

bd808 added a comment.Feb 10 2016, 6:55 AM

The settings needed should end up in:

  • vagrant/settings.d/puppet-managed/00-RESTBase-VRS.php
  • vagrant/settings.d/puppet-managed/04-parsoid-vrs.php
  • vagrant/settings.d/puppet-managed/05-VisualEditor.php

My enabled roles for a VM that has a working VisualEditor (and al ot of other stuff) are:

$ vagrant roles list -e
Enabled roles:

apex                       inputbox                   restbase
apisandbox                 interwiki                  scribunto
buggy                      jsonconfig                 sitematrix
centralauth                l10nupdate                 templatedata
cite                       math                       thumb_on_404
cologneblue                mobilefrontend             titleblacklist
eventlogging               oauth                      visualeditor
fss                        parserfunctions            wikidiff2
gadgets2                   poem                       wikimediamessages
gather                     poolcounter
geshi                      psr3

Apparently I have restbase enabled explicitly here, but that shouldn't matter as role::visualeditor contains include ::role::restbase and role::restbase in turn contains include ::role::parsoid.

Hmm still no go for me. I can't make out anything out of my logs, maybe you could take a look:

JavaScript console on trying to load VE:
http://pastebin.com/hnY2G56a

/vagrant/logs/restbase.log:
http://pastebin.com/UwytMbxE

Running git-update && provision gives me this output:
http://pastebin.com/dwM4Fphg

bd808 added a subscriber: mobrovac.

"http://127.0.0.1:8080/api/rest_v1/page/html/NewPage Failed to load resource: the server responded with a status of 503 (Service Unavailable)" -- this means that RESTBase isn't running. Your restbase.log also seems to show RESTBase as thoroughly broken.

Maybe @mobrovac or someone else familiar with RESTBase can help you debug further?

Change 269813 had a related patch set uploaded (by Mobrovac):
RESTBase: change the start-up module to hyperswitch

https://gerrit.wikimedia.org/r/269813

"http://127.0.0.1:8080/api/rest_v1/page/html/NewPage Failed to load resource: the server responded with a status of 503 (Service Unavailable)" -- this means that RESTBase isn't running. Your restbase.log also seems to show RESTBase as thoroughly broken.

Ups. We merged a breaking change in RESTBase a day or two ago and I forgot to update the config. Gerrit 269813 should make the problem go away. I tested it locally and it works. @ferdbold, could you apply the patch and confirm it solves the problem?

mobrovac renamed this task from VisualEditor vagrant role doesn't seem to install VisualEditor to RESTBase fails to start up on MW-Vagrant.Feb 10 2016, 8:21 PM
mobrovac claimed this task.
mobrovac triaged this task as High priority.
mobrovac set Security to None.

Change 269813 merged by jenkins-bot:
RESTBase: change the start-up module to hyperswitch

https://gerrit.wikimedia.org/r/269813

bd808 closed this task as Resolved.Feb 11 2016, 12:22 AM

Patch is merged and working for me locally.

@ferbold you will need to run git pull (or the equivalent) in you mediawiki-vagrant clone and then vagrant provision to update the config in the VM and restart RESTBase.

Patch is merged and working for me locally.
... and restart RESTBase.

For posterity, this step is not needed because a config change triggers a service restart.

Patch is merged and working for me locally.
... and restart RESTBase.

For posterity, this step is not needed because a config change triggers a service restart.

"to update the config in the VM and restart RESTBase."

LOL, indeed. I seemed to have imagined a comma there somewhere :) That's nit-picking karma.

I can confirm it works. Thanks a lot!

ferdbold added a comment.EditedFeb 18 2016, 6:43 PM

Looks like this issue is back :/ I'm getting 503's again in console as well as this warning in Chrome when trying to open up VisualEditor:

load.php?debug=false&lang=en&modules=ext.uls.pt|ext.visualEditor.targetLoader|jquery.async%2Ccheckb…:6 RESTBase load failed: Service Unavailable

You need to git pull && vagrant provision && vagrant git-update again. This usually cures it.

That's what I did, but it didn't fix it.

(Doesn't help that it takes 20 minutes each time...)

Could you check if RESTBase is running inside the container? Do:

$ vagrant ssh
$ curl -v localhost:7231/127.0.0.1:8080/v1/?spec

If it's not, could you paste a tail of /vagrant/logs/restbase.log ?

mobrovac reopened this task as Open.Feb 18 2016, 10:55 PM
ferdbold added a comment.EditedFeb 21 2016, 6:46 PM

It's not running, I'm getting curl: (7) Failed to connect to localhost port 7231: Connection refused

Here is the restbase log:
http://pastebin.com/UYqKysZs

@ferdbold The error message suggests that your config.vagrant.yaml is out of date.

Could you please verify that you have a latest version of the config. At /puppet/modules/restbase/templates/config.yaml.erb you should have this: https://github.com/wikimedia/mediawiki-vagrant/blob/master/puppet/modules/restbase/templates/config.yaml.erb#L6-L7 (please make sure there's no /: line between lines 6 and 7.

Also, the config in srv/restbase/config.vagrant.yaml should be in the same format.

In case you spot any differences - try to update again.

Nope, still no go. I effectively had a /: on line 7, but still after removing it and running vagrant reload and vagrant provision the same 503 error happens upon VE load.

@ferdbold I must have not been completely clear. I've mentioned /: on line 7 just as an example which would indicate that you have a stale version of the config. Removing it manually will not have any effect since it's not the only required change in the config.

Please make sure that you've done git pull ... in vagrant repo so that you have the latest puppet code. If it actually pulls some new code - try to reload and reprovision again. But if it doesn't, I would destroy and up the machine as a 'last chance' option.

dammit, found the problem. Dumb dumb me wasn't pulling the right repo (I was pulling /mediawiki instead of the mw-vagrant root).

Still, thanks for your help! You can close this now and hand over the cone of shame. :P

Pchelolo closed this task as Invalid.Feb 24 2016, 5:01 PM

@ferdbold No worries, good that the problem is resolved.