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

Undefined method `end_with?` for Pathname in WinRM #7459

Closed akoerner closed 8 years ago

akoerner commented 8 years ago

Vagrant version

Vagrant 1.8.4 Chef DK: chefdk-0.13.21-1-x86 Virtualbox: Version 5.0.20 r106931 vagrant plugin list: vagrant-berkshelf (4.1.0) vagrant-omnibus (1.4.1) vagrant-share (1.1.5, system)

Host operating system

Windows 7 Enterprise PS H:> [environment]::OSVersion.Version

Major Minor Build Revision


6 1 7601 65536

Guest operating system

Windows 7 IE11 provided by microsoft https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/windows/ https://az792536.vo.msecnd.net/vms/VMBuild_20150916/Vagrant/IE11/IE11.Win7.Vagrant.zip

The following powershell script must be run on the vanilla Microsoft vm as Administrator user for the rm adapter to work: http://pastie.org/10879005

Vagrantfile

http://pastie.org/10877872

Debug output

http://pastie.org/10877969

Expected behavior

When running vagrant up I would expect the machine to go up and remain up.

Actual behavior

On vagrant up the machine starts. Once provisioning happens "Forcing shutdown of VM" and the vm is deleted. In summary with vagrant up the machine starts and abruptly halts during provisioning and is destroyed.

Steps to reproduce

Run vagrant up with a chef provisioning section. If I downgrade to vagrant 1.8.1 the issue goes away.

References

516

sethvargo commented 8 years ago

Hi @akoerner

The error that you're seeing is:

C:/HashiCorp/Vagrant/embedded/gems/gems/winrm-fs-0.3.2/lib/winrm-fs/core/file_transporter.rb:306:in `block in make_files_hash': 
undefined method `end_with?' for #<Pathname:D:/.vagrant.d/tmp/1465997733-install.bat> (NoMethodError)

This looks like an upstream bug in the Ruby winrm bindings. Maybe @mwrock has seen this before?

akoerner commented 8 years ago

from 1465997733-install.bat:

http://pastie.org/10879371

austinlparker commented 8 years ago

I'm also seeing this, but before provisioning. It happened immediately after mapping folders. Same undefined method error, however.

sethvargo commented 8 years ago

Hi @akoerner

I spent some time tracking down this issue, and it is not a bug in Vagrant. One of the following plugins is passing the wrong type of object to the upload function, causing Vagrant to crash:

Please open an issue on one of those projects. Thanks!

mwrock commented 8 years ago

Still might not be a bad idea for winrm-fs to cast incoming paths to_s in the event plugins are using a Pathname. I'm currently working on winrmv2 and its corresponding winrm-fs pr and will reference this there so future vagrants can benefit.

lonniev commented 8 years ago

I see this one too.

It pops up when config.omnibus.chef_version = :latest is in the Vagrantfile. It goes away when this is commented out.

mwrock commented 8 years ago

This has been addressed in winrm-fs v2 https://github.com/WinRb/winrm-fs/pull/45 which I'll port into vagrant once its released. In the meantime I'm gonna submit a pr to the vagrant-omnibus gem tonight that should get folks around this sooner.

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.