hashicorp / packer

Packer is a tool for creating identical machine images for multiple platforms from a single source configuration.
http://www.packer.io
Other
15.09k stars 3.33k forks source link

All commands over SSH are failing on Windows guest with "Stream 4 already open for dial. State: %!d(MISSING)" #738

Closed sneal closed 10 years ago

sneal commented 10 years ago

I fetched latest this morning from master, now the first command run over SSH is killing Packer with a "stream 4 already open for dial" error.

Packer connects to SSH just fine, but then dies when it tries to run a command. I've seen it happen uploading a file and creating a directory, so it doesn't seem specific to the command.

==> vmware: Provisioning with chef-solo
2013/12/20 16:19:32 ui: ==> vmware: Provisioning with chef-solo
    vmware: Creating directory: c:/windows/temp/chef
2013/12/20 16:19:32 ui:     vmware: Creating directory: c:/windows/temp/chef
2013/12/20 16:19:32 /Users/sneal/src/packer/bin/packer-builder-vmware: 2013/12/20 16:19:32 Executing: /Applications/VMware Fusion.app/Contents/Library/vmrun [-T fusion list]
2013/12/20 16:19:32 /Users/sneal/src/packer/bin/packer-builder-vmware: 2013/12/20 16:19:32 stdout: Total running VMs: 1
2013/12/20 16:19:32 /Users/sneal/src/packer/bin/packer-builder-vmware: /Users/sneal/src/daptiv-windows-boxes/daptiv_site_sso/win2k8r2sp1_standard/output-vmware/packer-vmware.vmx
2013/12/20 16:19:32 /Users/sneal/src/packer/bin/packer-builder-vmware: 2013/12/20 16:19:32 stderr:
==> vmware: Stopping virtual machine...
2013/12/20 16:19:32 ui: ==> vmware: Stopping virtual machine...
2013/12/20 16:19:32 /Users/sneal/src/packer/bin/packer-builder-vmware: 2013/12/20 16:19:32 Executing: /Applications/VMware Fusion.app/Contents/Library/vmrun [-T fusion stop output-vmware/packer-vmware.vmx hard]
2013/12/20 16:19:35 /Users/sneal/src/packer/bin/packer-builder-vmware: 2013/12/20 16:19:35 stdout:
2013/12/20 16:19:35 /Users/sneal/src/packer/bin/packer-builder-vmware: 2013/12/20 16:19:35 stderr:
2013/12/20 16:19:35 /Users/sneal/src/packer/bin/packer-builder-vmware: 2013/12/20 16:19:35 Deleting floppy disk: /var/folders/z0/83wgqhhj04d3wmk5wrggk5900000gn/T/packer659885601
==> vmware: Deleting output directory...
2013/12/20 16:19:35 ui: ==> vmware: Deleting output directory...
Build 'vmware' errored: Error creating staging directory: Stream 4 already open for dial. State: %!d(MISSING)
2013/12/20 16:19:35 ui error: Build 'vmware' errored: Error creating staging directory: Stream 4 already open for dial. State: %!d(MISSING)
sneal commented 10 years ago

Actually the error is Error creating staging directory: Stream 0 already open for dial. State: 4, the format statement is missing an argument.

sneal commented 10 years ago

Fails in a similar manner with Ubuntu 12.04

Build 'vmware' errored: Retryable error: Stream 0 already open for dial. State: 4 Build 'virtualbox' errored: Retryable error: Stream 0 already open for dial. State: 4

I notice this in the log quite a bit packer-provisioner-shell: 2013/12/20 18:39:24 Retryable error: Stream 0 already open for dial. State: 4

Full debug log here

mitchellh commented 10 years ago

Well this is pretty bad. I'll try to debug it. I'll let you know if you can do anything else to help.

mitchellh commented 10 years ago

Oh, I totally know what this is.

mitchellh commented 10 years ago

Should be fixed!

sneal commented 10 years ago

Thanks for taking a look. I pulled latest but the problem is still occurring. Here's another debug log. Its still attempting to dial on id 0. IIRC there are a couple places hardcoded to use connection id 0, like in client.go line 20.

I'm not sure what the problem is, my Go and Packer foo is much weaker.

mitchellh commented 10 years ago

Yeah the main RPC connection goes over stream 0, which is fine. I'm looking into this again... very odd.

mitchellh commented 10 years ago

Ah, should be fixed now, I didn't quite finish my last commit.

sneal commented 10 years ago

Nailed it! That fixed it, thanks.