Page MenuHomePhabricator

Users reporting Vagrantfile load errors following git pull
Closed, ResolvedPublic

Description

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/niharikakohli/Documents/GitHub/vagrant/Vagrantfile
Message: undefined method `load_settings' for #<MediaWikiVagrant::Environment:0x00000101c614f0>

My guess is that this is caused by changing Vagrantfile to use a changed mediawiki-vagrant plugin and keeps them from installing the new plugin that provides the needed functions.

Event Timeline

bd808 assigned this task to dduvall.
bd808 raised the priority of this task from to Needs Triage.
bd808 updated the task description. (Show Details)
bd808 added a project: MediaWiki-Vagrant.
bd808 subscribed.
bd808 triaged this task as Unbreak Now! priority.Feb 17 2015, 4:52 PM

We may need to revert the Vagrantfile changes or at least guard them in a version check of the plugin

@NiharikaKohli reported that this change made things work for her again:

mwv = MediaWikiVagrant::Environment.new($DIR)
# settings = mwv.load_settings('vagrant.d')
 
settings = MediaWikiVagrant::Settings.new
['vagrant.d', '.settings.yaml'].each do |path|
    path = File.join($DIR, path)
    settings.load(path) if File.exists?(path)
end

which points strongly to the changes made in I200b2e1482d3e1f9543810b940a83ac22ad41da5

git checkout 3ad01a4 may be a temporary workaround for effected users.

<     ayum>	bd808: I updated to vagrant version 1.7.2 and its working fine now.
<    bd808>	ayum: Oh? So it may be a ruby version issue then
<    bd808>	ayum: You did not checkout the older version of the repository?
<     ayum>	bd808: No. It worked fine without doing that. I just upgraded and that's all.

Looks like this is actually a ruby version issue. I think we were trying to support Vagrant back to 1.4.x which is in apt-get/yum for some well used distributions.

I don't think this is a Vagrant version issue but upgrading may avoid the issue by forcing a reinstallation of the plugin. I believe the root cause is that I didn't bump the minor version in (only the patch version) and we don't force plugin upgrades for the latter. As a result, the version guard passes and Environment#load_settings is called where it doesn't exist.

https://gerrit.wikimedia.org/r/#/c/190585/3/lib/mediawiki-vagrant/version.rb

gerritbot subscribed.

Change 191106 had a related patch set uploaded (by Dduvall):
plugin: Bump minor version to force upgrade

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

Patch-For-Review

Change 191106 merged by jenkins-bot:
plugin: Bump minor version to force upgrade

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

Patch was merged and double checked:

git checkout c975cab8^ # checkout commit previous to the bad one and install plugin
./setup.sh
git checkout c975cab8  # checkout the bad commit
vagrant config --list  # execute innocuous command that sources Vagrantfile and get NoMethodError
git review -d 191106   # get fix
vagrant config --list  # command now correctly prompts user to run `./setup.sh`