Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade winrm dependency gem? #24

Closed
tehmaspc opened this issue Jun 9, 2016 · 11 comments
Closed

Upgrade winrm dependency gem? #24

tehmaspc opened this issue Jun 9, 2016 · 11 comments

Comments

@tehmaspc
Copy link

tehmaspc commented Jun 9, 2016

Hey,

Can we upgrade the backing winrm gem?

I notice the following deprecation warnings w/ the current 1.1.1 version of vagrant-serverspec:

 WARN  WinRM::WinRMWebService : WinRM::WinRMWebService#run_powershell_script is deprecated. Use WinRM::CommandExecutor#run_powershell_script instead

Thanks!

@lmayorga1980
Copy link

I get this error when trying to install 1.1.1

vagrant plugin install vagrant-serverspec
Installing the 'vagrant-serverspec' plugin. This can take a few minutes...
/opt/vagrant/embedded/gems/gems/bundler-1.12.0/lib/bundler/resolver.rb:303:in `block in sort_dependencies': undefined method `payload' for nil:NilClass (NoMethodError)
    from /opt/vagrant/embedded/gems/gems/bundler-1.12.0/lib/bundler/resolver.rb:300:in `each'
    from /opt/vagrant/embedded/gems/gems/bundler-1.12.0/lib/bundler/resolver.rb:300:in `sort_by'
    from /opt/vagrant/embedded/gems/gems/bundler-1.12.0/lib/bundler/resolver.rb:300:in `sort_dependencies'
    from /opt/vagrant/embedded/gems/gems/bundler-1.12.0/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb:131:in `block (2 levels) in <class:Resolution>'
    from /opt/vagrant/embedded/gems/gems/bundler-1.12.0/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb:431:in `push_state_for_requirements'
    from /opt/vagrant/embedded/gems/gems/bundler-1.12.0/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb:423:in `require_nested_dependencies_for'
    from /opt/vagrant/embedded/gems/gems/bundler-1.12.0/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb:411:in `activate_spec'
    from /opt/vagrant/embedded/gems/gems/bundler-1.12.0/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb:353:in `attempt_to_swap_possibility'
    from /opt/vagrant/embedded/gems/gems/bundler-1.12.0/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb:333:in `attempt_to_activate_existing_spec'
    from /opt/vagrant/embedded/gems/gems/bundler-1.12.0/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb:318:in `attempt_to_activate'
    from /opt/vagrant/embedded/gems/gems/bundler-1.12.0/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb:147:in `process_topmost_state'
    from /opt/vagrant/embedded/gems/gems/bundler-1.12.0/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb:72:in `resolve'
    from /opt/vagrant/embedded/gems/gems/bundler-1.12.0/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb:42:in `resolve'
    from /opt/vagrant/embedded/gems/gems/bundler-1.12.0/lib/bundler/resolver.rb:201:in `start'
    from /opt/vagrant/embedded/gems/gems/bundler-1.12.0/lib/bundler/resolver.rb:184:in `resolve'
    from /opt/vagrant/embedded/gems/gems/bundler-1.12.0/lib/bundler/definition.rb:200:in `resolve'
    from /opt/vagrant/embedded/gems/gems/bundler-1.12.0/lib/bundler/definition.rb:140:in `specs'
    from /opt/vagrant/embedded/gems/gems/bundler-1.12.0/lib/bundler/definition.rb:129:in `resolve_remotely!'
    from /opt/vagrant/embedded/gems/gems/bundler-1.12.0/lib/bundler/installer.rb:195:in `resolve_if_need'
    from /opt/vagrant/embedded/gems/gems/bundler-1.12.0/lib/bundler/installer.rb:70:in `run'
    from /opt/vagrant/embedded/gems/gems/bundler-1.12.0/lib/bundler/installer.rb:22:in `install'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.3/lib/vagrant/bundler.rb:230:in `block in internal_install'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.3/lib/vagrant/bundler.rb:290:in `block in with_isolated_gem'
    from /opt/vagrant/embedded/lib/ruby/2.2.0/rubygems/user_interaction.rb:45:in `use_ui'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.3/lib/vagrant/bundler.rb:289:in `with_isolated_gem'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.3/lib/vagrant/bundler.rb:229:in `internal_install'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.3/lib/vagrant/bundler.rb:102:in `install'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.3/lib/vagrant/plugin/manager.rb:62:in `block in install_plugin'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.3/lib/vagrant/plugin/manager.rb:72:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.3/lib/vagrant/plugin/manager.rb:72:in `install_plugin'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.3/plugins/commands/plugin/action/install_gem.rb:37:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.3/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.3/lib/vagrant/action/builder.rb:116:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.3/lib/vagrant/action/runner.rb:66:in `block in run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.3/lib/vagrant/util/busy.rb:19:in `busy'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.3/lib/vagrant/action/runner.rb:66:in `run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.3/plugins/commands/plugin/command/base.rb:14:in `action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.3/plugins/commands/plugin/command/install.rb:32:in `block in execute'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.3/plugins/commands/plugin/command/install.rb:31:in `each'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.3/plugins/commands/plugin/command/install.rb:31:in `execute'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.3/plugins/commands/plugin/command/root.rb:56:in `execute'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.3/lib/vagrant/cli.rb:42:in `execute'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.3/lib/vagrant/environment.rb:302:in `cli'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.3/bin/vagrant:174:in `<main>'

@tehmaspc
Copy link
Author

I've seen that elsewhere. Vagrant 1.8.3 came out yesterday but there are some bugs. Looks like from the CHANGELOG there are fixes going in:

https://github.com/mitchellh/vagrant/blob/master/CHANGELOG.md

On Jun 10, 2016, at 20:40, Luis Mayorga [email protected] wrote:

I get this error when trying to install 1.1.1

vagrant plugin install vagrant-serverspec
Installing the 'vagrant-serverspec' plugin. This can take a few minutes...
/opt/vagrant/embedded/gems/gems/bundler-1.12.0/lib/bundler/resolver.rb:303:in block in sort_dependencies': undefined methodpayload' for nil:NilClass (NoMethodError)
from /opt/vagrant/embedded/gems/gems/bundler-1.12.0/lib/bundler/resolver.rb:300:in each' from /opt/vagrant/embedded/gems/gems/bundler-1.12.0/lib/bundler/resolver.rb:300:insort_by'
from /opt/vagrant/embedded/gems/gems/bundler-1.12.0/lib/bundler/resolver.rb:300:in sort_dependencies' from /opt/vagrant/embedded/gems/gems/bundler-1.12.0/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb:131:inblock (2 levels) in class:Resolution'
from /opt/vagrant/embedded/gems/gems/bundler-1.12.0/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb:431:in push_state_for_requirements' from /opt/vagrant/embedded/gems/gems/bundler-1.12.0/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb:423:inrequire_nested_dependencies_for'
from /opt/vagrant/embedded/gems/gems/bundler-1.12.0/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb:411:in activate_spec' from /opt/vagrant/embedded/gems/gems/bundler-1.12.0/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb:353:inattempt_to_swap_possibility'
from /opt/vagrant/embedded/gems/gems/bundler-1.12.0/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb:333:in attempt_to_activate_existing_spec' from /opt/vagrant/embedded/gems/gems/bundler-1.12.0/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb:318:inattempt_to_activate'
from /opt/vagrant/embedded/gems/gems/bundler-1.12.0/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb:147:in process_topmost_state' from /opt/vagrant/embedded/gems/gems/bundler-1.12.0/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb:72:inresolve'
from /opt/vagrant/embedded/gems/gems/bundler-1.12.0/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb:42:in resolve' from /opt/vagrant/embedded/gems/gems/bundler-1.12.0/lib/bundler/resolver.rb:201:instart'
from /opt/vagrant/embedded/gems/gems/bundler-1.12.0/lib/bundler/resolver.rb:184:in resolve' from /opt/vagrant/embedded/gems/gems/bundler-1.12.0/lib/bundler/definition.rb:200:inresolve'
from /opt/vagrant/embedded/gems/gems/bundler-1.12.0/lib/bundler/definition.rb:140:in specs' from /opt/vagrant/embedded/gems/gems/bundler-1.12.0/lib/bundler/definition.rb:129:inresolve_remotely!'
from /opt/vagrant/embedded/gems/gems/bundler-1.12.0/lib/bundler/installer.rb:195:in resolve_if_need' from /opt/vagrant/embedded/gems/gems/bundler-1.12.0/lib/bundler/installer.rb:70:inrun'
from /opt/vagrant/embedded/gems/gems/bundler-1.12.0/lib/bundler/installer.rb:22:in install' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.3/lib/vagrant/bundler.rb:230:inblock in internal_install'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.3/lib/vagrant/bundler.rb:290:in block in with_isolated_gem' from /opt/vagrant/embedded/lib/ruby/2.2.0/rubygems/user_interaction.rb:45:inuse_ui'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.3/lib/vagrant/bundler.rb:289:in with_isolated_gem' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.3/lib/vagrant/bundler.rb:229:ininternal_install'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.3/lib/vagrant/bundler.rb:102:in install' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.3/lib/vagrant/plugin/manager.rb:62:inblock in install_plugin'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.3/lib/vagrant/plugin/manager.rb:72:in call' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.3/lib/vagrant/plugin/manager.rb:72:ininstall_plugin'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.3/plugins/commands/plugin/action/install_gem.rb:37:in call' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.3/lib/vagrant/action/warden.rb:34:incall'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.3/lib/vagrant/action/builder.rb:116:in call' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.3/lib/vagrant/action/runner.rb:66:inblock in run'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.3/lib/vagrant/util/busy.rb:19:in busy' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.3/lib/vagrant/action/runner.rb:66:inrun'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.3/plugins/commands/plugin/command/base.rb:14:in action' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.3/plugins/commands/plugin/command/install.rb:32:inblock in execute'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.3/plugins/commands/plugin/command/install.rb:31:in each' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.3/plugins/commands/plugin/command/install.rb:31:inexecute'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.3/plugins/commands/plugin/command/root.rb:56:in execute' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.3/lib/vagrant/cli.rb:42:inexecute'
from /opt/vagrant/embedded/gems/gems/vagrant-1.8.3/lib/vagrant/environment.rb:302:in cli' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.3/bin/vagrant:174:in

'


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@StefanScherer
Copy link

@lmayorga1980 Yes, I've tried Vagrant 1.8.3 and got the same error installing plugins. I'm back to 1.8.1 until the dust has settled.
For reference: hashicorp/vagrant#7422

@vvchik
Copy link
Owner

vvchik commented Jun 14, 2016

Guys, Vagrant 1.8.4 released.
Is that resolves your issue?

@tehmaspc
Copy link
Author

Nope :). The original issue at the top was an ask to upgrade the winrm gem that serverspec uses due to the deprecated warning. Folks chimed in with another issue - that Vagrant 1.8.3 can't install plugins.

The original issue I posted above is still open and will be till vagrant-serverspec 's gems are upgraded.

On Jun 14, 2016, at 06:02, Volodymyr Babchynskyy [email protected] wrote:

Guys, Vagrant 1.8.4 released.
Is that resolves your issue?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@StefanScherer
Copy link

Just tried these first steps with Vagrant 1.8.4:

$ vagrant version
Installed Version: 1.8.4
Latest Version: 1.8.4

You're running an up-to-date version of Vagrant!
~
$ vagrant plugin list
vagrant-share (1.1.5, system)
~
$ vagrant plugin install vagrant-serverspec
Installing the 'vagrant-serverspec' plugin. This can take a few minutes...
Installed the plugin 'vagrant-serverspec (1.1.1)'!
~
$ ls .vagrant.d/gems/gems/
diff-lcs-1.2.5           rspec-3.4.0              rspec-its-1.2.0          serverspec-2.36.0        vagrant-serverspec-1.1.1
net-telnet-0.1.1         rspec-core-3.4.4         rspec-mocks-3.4.1        sfl-2.2
os-0.9.6                 rspec-expectations-3.4.0 rspec-support-3.4.1      specinfra-2.59.0

Where does this warning appear?

@vvchik
Copy link
Owner

vvchik commented Jun 14, 2016

I think when you try to provision Windows computer.

@StefanScherer
Copy link

Yes, the warning is still there, one warning per serverspec test.
Vagrant 1.8.4 has winrm-1.8.1 embedded.

$ vagrant provision
==> default: Running provisioner: serverspec...
 WARN  WinRM::WinRMWebService : WinRM::WinRMWebService#run_powershell_script is deprecated. Use WinRM::CommandExecutor#run_powershell_script instead
. WARN  WinRM::WinRMWebService : WinRM::WinRMWebService#run_powershell_script is deprecated. Use WinRM::CommandExecutor#run_powershell_script instead
. WARN  WinRM::WinRMWebService : WinRM::WinRMWebService#run_powershell_script is deprecated. Use WinRM::CommandExecutor#run_powershell_script instead
. WARN  WinRM::WinRMWebService : WinRM::WinRMWebService#run_powershell_script is deprecated. Use WinRM::CommandExecutor#run_powershell_script instead
. WARN  WinRM::WinRMWebService : WinRM::WinRMWebService#run_powershell_script is deprecated. Use WinRM::CommandExecutor#run_powershell_script instead
. WARN  WinRM::WinRMWebService : WinRM::WinRMWebService#run_powershell_script is deprecated. Use WinRM::CommandExecutor#run_powershell_script instead
.

Finished in 4.95 seconds (files took 0.05868 seconds to load)
6 examples, 0 failures

~/code/packer-windows/test on my*
$ cat Vagrantfile 
Vagrant.configure('2') do |config|
  config.vm.box = 'windows_2016_tp5_docker'

  config.vm.provision :serverspec do |spec|
    spec.pattern = 'mini_spec.rb'
  end
end
~/code/packer-windows/test on my*

$ cat mini_spec.rb 
describe 'box' do
  describe 'windows box' do
    it 'should have a vagrant user' do
      expect(user 'vagrant').to exist
    end
  end

  describe service('VirtualBox Guest Additions Service') do
    it { should be_installed  }
    it { should be_enabled  }
    it { should be_running  }
    it { should have_start_mode("Automatic")  }
  end

  # check WinRM
  describe port(5985) do
    it { should be_listening  }
  end
end

@vvchik
Copy link
Owner

vvchik commented Jun 14, 2016

Well, look it is only warning about future changes that will be implemented in 2.0
Please check this Issue in WinRM library. They still on the go. Their readme examples still use WinRMWebService
You may try use custom spec_helper.rb to avoid this warnings
try to add winrm.logger.level = :error in previous to last string (see readme, commented example of spec_helper.rb(need to uncomment add string, and put into tests folder for usage))

@tehmaspc
Copy link
Author

My bad - yes - the warnings are displayed when testing a windows box w/ vagrant-serverspec.

My other reason for the ask for upgrading winrm in this vagrant plugin was to sync up the versions w/ what Vagrant (as of 1.8.3) ships with because from their changelog information - vagrant folks made a bunch of changes to winrm use in vagrant. I'm concerned if vagrant-serverspec stays on such an old version of winrm that I might have other issues w/ Windows provisioning. Maybe not - but I just got involved w/ my team to fix some of our Puppet / Windows / Vagrant testing needs and I noticed that vagrant-serverspec still ships w/ a pretty old version of winrm.

Thoughts?

I can live w/ the winrm warning messages however. Thanks for the info above.

@vvchik
Copy link
Owner

vvchik commented Jun 14, 2016

Plugins should using same WinRM version as Vagrant.
We using deprecated call, but I think it doesn't affect anything else, it is just warning about 2.0.
Please try to use spec_helper.rb and post your feedback, because I unable to check it by myself because of limitation of resources.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants