Page MenuHomePhabricator

puppet config of Parsoid localsettings breaks in labs-vagrant
Closed, ResolvedPublic

Description

Parsoid doesn't work when you add the visualeditor role in Labs-Vagrant setup,
clients get 404 errors. After tweaking parsoid to log the actual error (bug 57694), /var/log/upstart/parsoid.log contains

Stack trace: DoesNotExistError: Page Fetch failure for null : Error: Invalid URI
"undef/w/api.php?format=json&action=query&meta=siteinfo&siprop=namespaces%7Cnamespacealiases%7Cmagicwords%7Cfunctionhooks%7Cextensiontags%7Cgeneral%7Cinterwikimap%7Clanguages%7Cprotocols"

Obviously undef/w/api.php is going to give 404.

The bad URL path arises because puppet/manifests/roles.pp sets $server_url to 'undef' if forwarded_port isn't set, and it somehow isn't set in labs-vagrant. puppet/modules/mediawiki/templates/parsoid.localsettings.js.erb propagates this to /srv/parsoid/js/api/localsettings.js which contains

parsoidConfig.setInterwiki( 'localhost', 'undef/w/api.php' )

(Erik Bernhardson figured all this out!)

One fix is to not set $server_url to undef. Patch coming.


Version: unspecified
Severity: normal

Details

Reference
bz57701

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 2:27 AM
bzimport set Reference to bz57701.

Change 98060 had a related patch set uploaded by Spage:
Set $server_url to something other than undef

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

Change 98060 merged by Ori.livneh:
Set $server_url to something other than undef

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

Thanks for the detailed report and the patch.