Page MenuHomePhabricator

Vagrant 2.1.[3-5] - NameError: uninitialized constant MediaWikiVagrant::Environment
Closed, ResolvedPublic

Description

Reproducible with vagrant 2.1.3, 2.1.4 and 2.1.5.

$ git log --oneline -1
347e0849 (HEAD -> master, origin/master, origin/HEAD) Send Thumbor-Request-Id in haproxy response

$ vagrant -v
Vagrant 2.1.3

$ vagrant up
Vagrant failed to initialize at a very early stage:

There was an error loading a Vagrantfile. The file being loaded
and the error message are shown below. This is usually caused by
a syntax error.

Path: /Users/z/Documents/gerrit/mediawiki/vagrant/Vagrantfile
Line number: 48
Message: NameError: uninitialized constant MediaWikiVagrant::Environment

Workaround is to install Vagrant 2.1.2.

Event Timeline

zeljkofilipin moved this task from Backlog 🪒 to Waiting 🏹 on the User-zeljkofilipin board.
bd808 renamed this task from NameError: uninitialized constant MediaWikiVagrant::Environment to Vagrant 2.1.3 and 2.1.4 - NameError: uninitialized constant MediaWikiVagrant::Environment.Sep 3 2018, 9:05 PM

Adding the Upstream tag because the root cause here is a not-quite-right change upstream that is breaking repo-local plugin initialization.

Nope, still broken

Sams-MBP:vagrant reedy$ vagrant box update
Vagrant failed to initialize at a very early stage:

There was an error loading a Vagrantfile. The file being loaded
and the error message are shown below. This is usually caused by
a syntax error.

Path: /Users/reedy/vagrant/Vagrantfile
Line number: 48
Message: NameError: uninitialized constant MediaWikiVagrant::Environment
Sams-MBP:vagrant reedy$ vagrant --version
Vagrant 2.1.5
Reedy renamed this task from Vagrant 2.1.3 and 2.1.4 - NameError: uninitialized constant MediaWikiVagrant::Environment to Vagrant 2.1.[3-5] - NameError: uninitialized constant MediaWikiVagrant::Environment.Sep 13 2018, 11:11 PM
Reedy updated the task description. (Show Details)
Reedy changed Risk Rating from N/A to default.

Not sure why, but adding

require './lib/mediawiki-vagrant/environment.rb'

to the Vagrantfile fixed this for me in Vagrant 2.1.5/Virtualbox 5.2.18/Ruby 2.3.7 on High Sierra.

Not sure why, but adding

require './lib/mediawiki-vagrant/environment.rb'

to the Vagrantfile fixed this for me in Vagrant 2.1.5/Virtualbox 5.2.18/Ruby 2.3.7 on High Sierra.

Seems reasonable enough as they've changed something related to the plugin loading infrastructure

Make a patch? :)

Change 461232 had a related patch set uploaded (by SBassett; owner: SBassett):
[mediawiki/vagrant@master] Fix NameError: uninitialized constant MediaWikiVagrant::Environment

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

Change 461232 merged by jenkins-bot:
[mediawiki/vagrant@master] Fix NameError: uninitialized constant MediaWikiVagrant::Environment

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

bd808 assigned this task to sbassett.

@brion tested the patch from @sbassett on both mac and windows I believe. Lets call this closed until someone proves otherwise.