Page MenuHomePhabricator

MediaWiki vagrant doesn't work with VMWare Fusion provider
Closed, ResolvedPublic

Description

So I purchased Vagrant's proprietary VMWare Fusion provider (figured I'd support them since their product is mostly open source), but apparently MediaWiki's Vagrant config simply does not work with the VMWare provider.

At first the issue was just that it could not find a compatible box, since the precise-cloud box from Ubuntu is only for virtualbox. So I went into the Vagrantfile and changed the box to precise64 instead (the default box). And then I got this error:

Bringing machine 'default' up with 'vmware_fusion' provider...
[default] Cloning VMware VM: 'precise64'. This can take some time...
[default] Verifying vmnet devices are healthy...
[default] Deleting the VM...
[default] Running cleanup tasks for 'puppet' provisioner...
/Users/parent5446/Documents/vagrant/lib/mediawiki-vagrant/middleware.rb:9:in call': undefined method version' for #<HashiCorp::VagrantVMwarefusion::Driver::Fusion:0x00000101c0cc20> (NoMethodError)
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.2/lib/vagrant/action/warden.rb:34:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.2/lib/vagrant/action/builtin/lock.rb:51:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.2/lib/vagrant/action/warden.rb:34:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.2/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.2/lib/vagrant/action/warden.rb:34:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.2/lib/vagrant/action/warden.rb:34:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.2/lib/vagrant/action/builder.rb:116:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.2/lib/vagrant/action/runner.rb:69:in `block in run'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.2/lib/vagrant/util/busy.rb:19:in `busy'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.2/lib/vagrant/action/runner.rb:69:in `run'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.2/lib/vagrant/action/builtin/call.rb:51:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.2/lib/vagrant/action/warden.rb:34:in `call'
from /Users/parent5446/.vagrant.d/gems/gems/vagrant-vmware-fusion-2.2.7/lib/vagrant-vmware-fusion/action_farm.rb:80:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.2/lib/vagrant/action/warden.rb:34:in `call'
from /Users/parent5446/.vagrant.d/gems/gems/vagrant-vmware-fusion-2.2.7/lib/vagrant-vmware-fusion/action_farm.rb:969:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.2/lib/vagrant/action/warden.rb:34:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.2/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.2/lib/vagrant/action/warden.rb:34:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.2/lib/vagrant/action/warden.rb:34:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.2/lib/vagrant/action/builder.rb:116:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.2/lib/vagrant/action/runner.rb:69:in `block in run'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.2/lib/vagrant/util/busy.rb:19:in `busy'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.2/lib/vagrant/action/runner.rb:69:in `run'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.2/lib/vagrant/action/builtin/call.rb:51:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.2/lib/vagrant/action/warden.rb:34:in `call'
from /Users/parent5446/.vagrant.d/gems/gems/vagrant-vmware-fusion-2.2.7/lib/vagrant-vmware-fusion/action_farm.rb:1183:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.2/lib/vagrant/action/warden.rb:34:in `call'
from /Users/parent5446/.vagrant.d/gems/gems/vagrant-vmware-fusion-2.2.7/lib/vagrant-vmware-fusion/action_farm.rb:246:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.2/lib/vagrant/action/warden.rb:34:in `call'
from /Users/parent5446/.vagrant.d/gems/gems/vagrant-vmware-fusion-2.2.7/lib/vagrant-vmware-fusion/action_farm.rb:1048:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.2/lib/vagrant/action/warden.rb:34:in `call'
from /Users/parent5446/.vagrant.d/gems/gems/vagrant-vmware-fusion-2.2.7/lib/vagrant-vmware-fusion/action_farm.rb:423:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.2/lib/vagrant/action/warden.rb:34:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.2/lib/vagrant/action/builtin/handle_box_url.rb:24:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.2/lib/vagrant/action/warden.rb:34:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.2/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.2/lib/vagrant/action/warden.rb:34:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.2/lib/vagrant/action/warden.rb:34:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.2/lib/vagrant/action/builder.rb:116:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.2/lib/vagrant/action/runner.rb:69:in `block in run'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.2/lib/vagrant/util/busy.rb:19:in `busy'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.2/lib/vagrant/action/runner.rb:69:in `run'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.2/lib/vagrant/action/builtin/call.rb:51:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.2/lib/vagrant/action/warden.rb:34:in `call'
from /Users/parent5446/.vagrant.d/gems/gems/vagrant-vmware-fusion-2.2.7/lib/vagrant-vmware-fusion/action_farm.rb:1183:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.2/lib/vagrant/action/warden.rb:34:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.2/lib/vagrant/action/builtin/lock.rb:42:in `block in call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.2/lib/vagrant/action/builtin/lock.rb:27:in `open'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.2/lib/vagrant/action/builtin/lock.rb:27:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.2/lib/vagrant/action/warden.rb:34:in `call'
from /Users/parent5446/.vagrant.d/gems/gems/vagrant-vmware-fusion-2.2.7/lib/vagrant-vmware-fusion/action_farm.rb:108:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.2/lib/vagrant/action/warden.rb:34:in `call'
from /Users/parent5446/.vagrant.d/gems/gems/vagrant-vmware-fusion-2.2.7/lib/vagrant-vmware-fusion/action_farm.rb:246:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.2/lib/vagrant/action/warden.rb:34:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.2/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.2/lib/vagrant/action/warden.rb:34:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.2/lib/vagrant/action/builder.rb:116:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.2/lib/vagrant/action/runner.rb:69:in `block in run'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.2/lib/vagrant/util/busy.rb:19:in `busy'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.2/lib/vagrant/action/runner.rb:69:in `run'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.2/lib/vagrant/machine.rb:147:in `action'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.2/lib/vagrant/batch_action.rb:63:in `block (2 levels) in run'


Version: unspecified
Severity: normal

Details

Reference
bz59904

Event Timeline

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

Removing the following line in middleware.rb appears to make this provider work:

$FACTER['provider_version'] = env[:machine].provider.driver.version

I can't find provider_version used anywhere.

That alone does not fix it. There are numerous other problems, primarily because our puppet configuration is so reliant on the box it is based on.

Sure, but that is what the bug is about. I'm going through the bugs so I can provide this for a client. If you see any that I miss, please pester me.

Change 116676 had a related patch set uploaded by MarkAHershberger:
Remove reference to provider.driver.version

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

(In reply to Mark A. Hershberger from comment #1)

Removing the following line in middleware.rb appears to make this provider
work:

$FACTER['provider_version'] = env[:machine].provider.driver.version

I can't find provider_version used anywhere.

It's used in <puppet/modules/virtualbox/manifests/init.pp>.

(In reply to Ori Livneh from comment #5)

It's used in <puppet/modules/virtualbox/manifests/init.pp>.

Since that is obviously a virtualbox-specific instance, and I don't know enough about how to fix it, would the following work?

  • content => $::provider_version,

+ content => env[:machine].provider.driver.version,

(Also, I did report the problem to Hashicorp, but they say it is a MW-Vagrant problem. So much for uniform interfaces.)

Change 120239 had a related patch set uploaded by BryanDavis:
Remove reference to provider.driver.version and virtualbox class

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

Change 120239 abandoned by BryanDavis:
Remove reference to provider.driver.version and virtualbox class

Reason:
This was supposed to be a revision of Ia6bc4f2e53eaa8110509a4053f4ac51a650dfada, not a new patch.

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

Change 116676 merged by jenkins-bot:
Remove reference to provider.driver.version and virtualbox class

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

Mark, can this be closed now?

Well the bug hasn't really been fixed yet...

(In reply to Ori Livneh from comment #11)

Mark, can this be closed now?

Not yet. I'll return to it in a bit.

Still working on it, but with the latest mediawiki-vmware it mostly works.

Since I can't commit from my current location -- I should learn how to commit using http and a proxy -- I'll attach a diff with my current modifications that I think could help other people.

Created attachment 15245
mods for VMWare

Attached:

This appears to be working now. Think it was fixed upstream, but it is working.

How? I tried this with the box in the attachment, and it gives a large error output, beginning with saying that add-apt-repository is not installed (which is true, because the box doesn't have it). And of course using the normal precise-cloud box doesn't work because it's only for virtualbox.

Note that the separate bug for add-apt-repository was not the initial cause of this bug. You're right that it it keeps some boxes from working.

Change 138610 had a related patch set uploaded by Parent5446:
Added parent directory creation for /var/lib/cloud/instance

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

Fixed as of Ibc0dd5e45d97bc7f72bfde6f090f2ad8ae41013d

...and it doesn't work again. It cannot find the HHVM packages.

Seriously, changes should be tested for compatibility.

(In reply to Tyler Romeo from comment #21)

...and it doesn't work again. It cannot find the HHVM packages.

Can you provide some additional details? Is /etc/apt/sources.list.d/wikimedia.list not populated in your guest VM? Which commit of mw-vagrant are you trying? There was a very recent fix for the initial apt-get update not running before packages were installed.

Seriously, changes should be tested for compatibility.

Reviews are welcome, but I think you and Mark may be the only vmware users.

:/ I figured it out. I was using a custom box since mediawiki-vagrant does not yet vary the box based on provider. I needed to switch to an Ubuntu Trusty box rather than Precise.

In case anybody runs into the same problem, I ended up using PuPHPet's trusty box: https://vagrantcloud.com/puphpet/ubuntu1404-x64

Change 147880 had a related patch set uploaded by Brion VIBBER:
Fetch a working trusty box on VMWare Fusion provider

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

Change 147880 merged by jenkins-bot:
Fetch a working trusty box on VMWare Fusion provider

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

Re-closing after gerrit reopened for a related commit. Feel free to reopen if we have additional outstanding issues I'm not aware of.