hashicorp / vagrant

Vagrant is a tool for building and distributing development environments.
https://www.vagrantup.com
Other
26.27k stars 4.43k forks source link

[1.9.2] vagrant plugin install fails on vagrant-serverspec plugin #8313

Closed lmayorga1980 closed 7 years ago

lmayorga1980 commented 7 years ago

vagrant version: 1.9.2 operating system: osx 10.11.6 (15G1217)

vagrant plugin install vagrant-serverspec --plugin-source http://myrepository:9292 --debug

Bundler, the underlying system Vagrant uses to install plugins,
reported an error. The error is shown below. These errors are usually
caused by misconfigured plugin installations or transient network
issues. The error from Bundler is:

conflicting dependencies nokogiri (~> 1.5.0) and nokogiri (= 1.6.7.1)
  Activated nokogiri-1.6.7.1
  which does not match conflicting dependency (~> 1.5.0)

  Conflicting dependency chains:
    vagrant-share (> 0), 1.1.7 activated, depends on
    vagrant (>= 1.9.2), 1.9.2 activated, depends on
    nokogiri (= 1.6.7.1), 1.6.7.1 activated

  versus:
    vagrant-serverspec (> 0), 1.1.1 activated, depends on
    winrm (>= 1.1.0, ~> 1.1), 1.1.0 activated, depends on
    nokogiri (~> 1.5.0)

Interesting since I keep both nokogiri versions on my local rubygems server.

chrisroberts commented 7 years ago

Hi! The internal dependencies of Vagrant are used as explicit constraints when resolving plugins. This prevents new and untested versions of dependencies required by Vagrant from being introduced and potentially breaking a previously working installation. The ideal fix here would be for vagrant-serverspec to relax (or bump up) the nokogiri constraint to allow the version Vagrant uses to satisfy the dependency.

On a side note, I'm also testing out removal of nokogiri as an explicit constraint of Vagrant proper to allow more flexibility for plugin dependencies.

Thanks for opening an issue and I hope that fully explains it.

Cheers!

pacificmint commented 7 years ago

Hi @chrisroberts , I'm hitting the same issue when trying to install the vagrant-windows plugin. This happens with both Vagrant 1.9.2 and 1.9.3. I can't figure out from the previous comment how to resolve this issue. Is manually modifying some dependency file the only way to get a windows guest to run?

$ vagrant plugin install vagrant-windows
Installing the 'vagrant-windows' plugin. This can take a few minutes...
Bundler, the underlying system Vagrant uses to install plugins,
reported an error. The error is shown below. These errors are usually
caused by misconfigured plugin installations or transient network
issues. The error from Bundler is:

conflicting dependencies nokogiri (~> 1.5.0) and nokogiri (= 1.6.7.1)
  Activated nokogiri-1.6.7.1
  which does not match conflicting dependency (~> 1.5.0)

  Conflicting dependency chains:
    vagrant-share (> 0), 1.1.7 activated, depends on
    vagrant (>= 1.9.2), 1.9.3 activated, depends on
    nokogiri (= 1.6.7.1), 1.6.7.1 activated

  versus:
    vagrant-windows (> 0), 1.6.0 activated, depends on
    winrm (~> 1.1.1), 1.1.1 activated, depends on
    nokogiri (~> 1.5.0)
lmayorga1980 commented 7 years ago

@pacificmint ,

Seems that you are facing the same issue as myself when working on getting vagrant-serverspec plugin to work with vagrant 1.9.2/1.9.3.

Your current vagrant-windows plugin depends on winrm 1.1.1 https://github.com/WinRb/vagrant-windows/blob/master/vagrant-windows.gemspec#L50 which also depends on nokogiri. https://rubygems.org/gems/winrm/versions/1.1.1.

Vagrant 1.9.2+ ships with the new winrm version 2.1.2/2.1.3 and that does not have a dependency to nokogiri. https://rubygems.org/gems/winrm/versions/2.2.1

Solution

Update the gemspec file to depend on the right dependency of new vagrant version. https://github.com/WinRb/vagrant-windows/blob/master/vagrant-windows.gemspec#L50

https://github.com/vvchik/vagrant-serverspec/commit/ef70ff9ac1fbbf02727fdb7a611e72dd244e92b3#diff-e757583f44a21bee17aa40cf420585fcR22

lmayorga1980 commented 7 years ago

duhh My bad

Vagrant 1.6 will natively support Windows guests, this plugin should not be used with Vagrant 1.6 or later.

pacificmint commented 7 years ago

Vagrant 1.6 will natively support Windows guests, this plugin should not be used with Vagrant 1.6 or later.

That's weird though, cause when I try to start the windows vm in Vagrant 1.9.3 I get this message:

$ vagrant up
vagrant-windows missing, please install the vagrant-windows plugin!
Run this command in your terminal:
vagrant plugin install vagrant-windows
lmayorga1980 commented 7 years ago

That is interesting. I dont have that plugin either on my osx and windows hosts.

On Fri, Apr 7, 2017 at 15:36 pacificmint notifications@github.com wrote:

Vagrant 1.6 will natively support Windows guests, this plugin should not be used with Vagrant 1.6 or later.

That's weird though, cause when I try to start the windows vm in Vagrant 1.9.3 I get this message:

$ vagrant up vagrant-windows missing, please install the vagrant-windows plugin! Run this command in your terminal: vagrant plugin install vagrant-windows

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mitchellh/vagrant/issues/8313#issuecomment-292631959, or mute the thread https://github.com/notifications/unsubscribe-auth/ADBoGo_luJ3Y5rM5ZGH7PMUXu3zUnH4rks5rtpA6gaJpZM4MOusN .

-- Luis Mayorga Software & Devops Engineer C. +1-703-407-4074 E. lmayorga@lm3 http://lm-3.com/corp.com T. @louismayorga

pacificmint commented 7 years ago

I wonder if the box I downloaded has a dependency on the plugin? I'll do some digging I guess.

Thanks for your help.

pacificmint commented 7 years ago

@lmayorga1980 Turns out that was the problem. The highest rated box that shows up on Atlas is over 2 years old. Presumably it was created before the windows plugin was integrated.

I tried a newer one and that doesn't require the plugin.

Thanks for your help.

jamiejackson commented 7 years ago

@pacificmint, which box did you end up with?

pacificmint commented 7 years ago

@jamiejackson I used ferhaty/win7ie10winrm

It's a little weird cause the opentable boxes had a lot of downloads, where all the newer images have very small numbers of downloads. I suppose people use mostly linux boxes?

ghost commented 4 years ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.