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.06k stars 3.32k forks source link

ssh session open error: 'ssh: unexpected packet in response to channel open: <nil>' #4373

Closed purkhusid closed 7 years ago

purkhusid commented 7 years ago

I'm getting an EOF error when trying to build this file:

Packer version: 0.12.1 on Windows 10

 {
  "variables": {
    "do_api_token": ""
  },
  "builders": [{
    "type": "digitalocean",
    "region": "lon1",
    "image": "ubuntu-16-04-x64",
    "size": "512mb",
    "private_networking": true,
    "snapshot_name": "ubuntu-docker-{{timestamp}}",
    "ssh_username": "root",
    "api_token": "{{user `do_api_token`}}"
  }],
  "provisioners": [{
    "type": "shell",
    "inline": [
      "sleep 30",
      "apt-get update",
      "apt-get install -y apt-transport-https ca-certificates nfs-common",
      "apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D",
      "echo 'deb https://apt.dockerproject.org/repo ubuntu-xenial main' | tee /etc/apt/sources.list.d/docker.list",
      "apt-get update",
      "apt-get install -y docker-engine"
    ]
  }]
}

Error log:

2017/01/06 16:01:17 [INFO] Packer version: 0.12.1
2017/01/06 16:01:17 Packer Target OS/Arch: windows amd64
2017/01/06 16:01:17 Built with Go Version: go1.7.3
2017/01/06 16:01:17 Using internal plugin for vmware-iso
2017/01/06 16:01:17 Using internal plugin for amazon-instance
2017/01/06 16:01:17 Using internal plugin for digitalocean
2017/01/06 16:01:17 Using internal plugin for docker
2017/01/06 16:01:17 Using internal plugin for googlecompute
2017/01/06 16:01:17 Using internal plugin for hyperv-iso
2017/01/06 16:01:17 Using internal plugin for profitbricks
2017/01/06 16:01:17 Using internal plugin for azure-arm
2017/01/06 16:01:17 Using internal plugin for file
2017/01/06 16:01:17 Using internal plugin for qemu
2017/01/06 16:01:17 Using internal plugin for vmware-vmx
2017/01/06 16:01:17 Using internal plugin for parallels-pvm
2017/01/06 16:01:17 Using internal plugin for virtualbox-ovf
2017/01/06 16:01:17 Using internal plugin for amazon-ebs
2017/01/06 16:01:17 Using internal plugin for amazon-ebsvolume
2017/01/06 16:01:17 Using internal plugin for cloudstack
2017/01/06 16:01:17 Using internal plugin for null
2017/01/06 16:01:17 Using internal plugin for oneandone
2017/01/06 16:01:17 Using internal plugin for parallels-iso
2017/01/06 16:01:17 Using internal plugin for amazon-chroot
2017/01/06 16:01:17 Using internal plugin for openstack
2017/01/06 16:01:17 Using internal plugin for virtualbox-iso
2017/01/06 16:01:17 Using internal plugin for salt-masterless
2017/01/06 16:01:17 Using internal plugin for shell
2017/01/06 16:01:17 Using internal plugin for windows-restart
2017/01/06 16:01:17 Using internal plugin for ansible-local
2017/01/06 16:01:17 Using internal plugin for puppet-masterless
2017/01/06 16:01:17 Using internal plugin for chef-solo
2017/01/06 16:01:17 Using internal plugin for file
2017/01/06 16:01:17 Using internal plugin for powershell
2017/01/06 16:01:17 Using internal plugin for puppet-server
2017/01/06 16:01:17 Using internal plugin for shell-local
2017/01/06 16:01:17 Using internal plugin for windows-shell
2017/01/06 16:01:17 Using internal plugin for ansible
2017/01/06 16:01:17 Using internal plugin for chef-client
2017/01/06 16:01:17 Using internal plugin for artifice
2017/01/06 16:01:17 Using internal plugin for compress
2017/01/06 16:01:17 Using internal plugin for docker-push
2017/01/06 16:01:17 Using internal plugin for docker-tag
2017/01/06 16:01:17 Using internal plugin for googlecompute-export
2017/01/06 16:01:17 Using internal plugin for vagrant-cloud
2017/01/06 16:01:17 Using internal plugin for amazon-import
2017/01/06 16:01:17 Using internal plugin for docker-import
2017/01/06 16:01:17 Using internal plugin for vagrant
2017/01/06 16:01:17 Using internal plugin for checksum
2017/01/06 16:01:17 Using internal plugin for manifest
2017/01/06 16:01:17 Using internal plugin for vsphere
2017/01/06 16:01:17 Using internal plugin for docker-save
2017/01/06 16:01:17 Using internal plugin for shell-local
2017/01/06 16:01:17 Using internal plugin for atlas
2017/01/06 16:01:17 Attempting to open config file: C:\Users\danielp\AppData\Roaming\packer.config
2017/01/06 16:01:17 [WARN] Config file doesn't exist: C:\Users\danielp\AppData\Roaming\packer.config
2017/01/06 16:01:17 Packer config: &{DisableCheckpoint:false DisableCheckpointSignature:false PluginMinPort:10000 PluginMaxPort:25000 Builders:map[parallels-iso:C:\Packer\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-builder-parallels-iso amazon-chroot:C:\Packer\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-builder-amazon-chroot digitalocean:C:\Packer\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-builder-digitalocean googlecompute:C:\Packer\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-builder-googlecompute vmware-vmx:C:\Packer\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-builder-vmware-vmx azure-arm:C:\Packer\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-builder-azure-arm qemu:C:\Packer\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-builder-qemu virtualbox-ovf:C:\Packer\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-builder-virtualbox-ovf amazon-ebs:C:\Packer\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-builder-amazon-ebs null:C:\Packer\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-builder-null amazon-instance:C:\Packer\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-builder-amazon-instance docker:C:\Packer\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-builder-docker profitbricks:C:\Packer\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-builder-profitbricks virtualbox-iso:C:\Packer\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-builder-virtualbox-iso cloudstack:C:\Packer\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-builder-cloudstack hyperv-iso:C:\Packer\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-builder-hyperv-iso file:C:\Packer\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-builder-file amazon-ebsvolume:C:\Packer\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-builder-amazon-ebsvolume openstack:C:\Packer\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-builder-openstack vmware-iso:C:\Packer\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-builder-vmware-iso parallels-pvm:C:\Packer\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-builder-parallels-pvm oneandone:C:\Packer\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-builder-oneandone] PostProcessors:map[docker-tag:C:\Packer\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-docker-tag checksum:C:\Packer\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-checksum vsphere:C:\Packer\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-vsphere vagrant-cloud:C:\Packer\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-vagrant-cloud docker-import:C:\Packer\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-docker-import docker-save:C:\Packer\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-docker-save atlas:C:\Packer\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-atlas artifice:C:\Packer\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-artifice compress:C:\Packer\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-compress vagrant:C:\Packer\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-vagrant shell-local:C:\Packer\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-shell-local docker-push:C:\Packer\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-docker-push googlecompute-export:C:\Packer\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-googlecompute-export amazon-import:C:\Packer\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-amazon-import manifest:C:\Packer\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-manifest] Provisioners:map[shell-local:C:\Packer\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-shell-local chef-solo:C:\Packer\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-chef-solo file:C:\Packer\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-file powershell:C:\Packer\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-powershell ansible-local:C:\Packer\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-ansible-local puppet-masterless:C:\Packer\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-puppet-masterless puppet-server:C:\Packer\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-puppet-server windows-shell:C:\Packer\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-windows-shell ansible:C:\Packer\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-ansible salt-masterless:C:\Packer\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-salt-masterless shell:C:\Packer\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-shell windows-restart:C:\Packer\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-windows-restart chef-client:C:\Packer\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-chef-client]}
2017/01/06 16:01:17 Setting cache directory: C:\dannidev\netcore-demo\infrastructure\packer_cache
2017/01/06 16:01:17 Loading builder: digitalocean
2017/01/06 16:01:17 Plugin could not be found. Checking same directory as executable.
2017/01/06 16:01:17 Current exe path: C:\Packer\packer.exe
2017/01/06 16:01:17 Creating plugin client for path: C:\Packer\packer.exe
2017/01/06 16:01:17 Starting plugin: C:\Packer\packer.exe []string{"C:\\Packer\\packer.exe", "plugin", "packer-builder-digitalocean"}
2017/01/06 16:01:17 Waiting for RPC address for: C:\Packer\packer.exe
2017/01/06 16:01:17 packer.exe: 2017/01/06 16:01:17 [INFO] Packer version: 0.12.1
2017/01/06 16:01:17 packer.exe: 2017/01/06 16:01:17 Packer Target OS/Arch: windows amd64
2017/01/06 16:01:17 packer.exe: 2017/01/06 16:01:17 Built with Go Version: go1.7.3
2017/01/06 16:01:17 packer.exe: 2017/01/06 16:01:17 Attempting to open config file: C:\Users\danielp\AppData\Roaming\packer.config
2017/01/06 16:01:17 packer.exe: 2017/01/06 16:01:17 [WARN] Config file doesn't exist: C:\Users\danielp\AppData\Roaming\packer.config
2017/01/06 16:01:17 packer.exe: 2017/01/06 16:01:17 Packer config: &{DisableCheckpoint:false DisableCheckpointSignature:false PluginMinPort:10000 PluginMaxPort:25000 Builders:map[] PostProcessors:map[] Provisioners:map[]}
2017/01/06 16:01:17 packer.exe: 2017/01/06 16:01:17 Setting cache directory: C:\dannidev\netcore-demo\infrastructure\packer_cache
2017/01/06 16:01:17 packer.exe: 2017/01/06 16:01:17 args: []string{"packer-builder-digitalocean"}
2017/01/06 16:01:17 packer.exe: 2017/01/06 16:01:17 Plugin minimum port: 10000
2017/01/06 16:01:17 packer.exe: 2017/01/06 16:01:17 Plugin maximum port: 25000
2017/01/06 16:01:17 packer.exe: 2017/01/06 16:01:17 Plugin address: tcp 127.0.0.1:10000
2017/01/06 16:01:17 packer.exe: 2017/01/06 16:01:17 Waiting for connection...
2017/01/06 16:01:17 packer.exe: 2017/01/06 16:01:17 Serving a plugin connection...
2017/01/06 16:01:17 Loading provisioner: shell
2017/01/06 16:01:17 Plugin could not be found. Checking same directory as executable.
2017/01/06 16:01:17 Current exe path: C:\Packer\packer.exe
2017/01/06 16:01:17 Creating plugin client for path: C:\Packer\packer.exe
2017/01/06 16:01:17 Starting plugin: C:\Packer\packer.exe []string{"C:\\Packer\\packer.exe", "plugin", "packer-provisioner-shell"}
2017/01/06 16:01:17 Waiting for RPC address for: C:\Packer\packer.exe
2017/01/06 16:01:17 packer.exe: 2017/01/06 16:01:17 [INFO] Packer version: 0.12.1
2017/01/06 16:01:17 packer.exe: 2017/01/06 16:01:17 Packer Target OS/Arch: windows amd64
2017/01/06 16:01:17 packer.exe: 2017/01/06 16:01:17 Built with Go Version: go1.7.3
2017/01/06 16:01:17 packer.exe: 2017/01/06 16:01:17 Attempting to open config file: C:\Users\danielp\AppData\Roaming\packer.config
2017/01/06 16:01:17 packer.exe: 2017/01/06 16:01:17 [WARN] Config file doesn't exist: C:\Users\danielp\AppData\Roaming\packer.config
2017/01/06 16:01:17 packer.exe: 2017/01/06 16:01:17 Packer config: &{DisableCheckpoint:false DisableCheckpointSignature:false PluginMinPort:10000 PluginMaxPort:25000 Builders:map[] PostProcessors:map[] Provisioners:map[]}
2017/01/06 16:01:17 packer.exe: 2017/01/06 16:01:17 Setting cache directory: C:\dannidev\netcore-demo\infrastructure\packer_cache
2017/01/06 16:01:17 packer.exe: 2017/01/06 16:01:17 args: []string{"packer-provisioner-shell"}
2017/01/06 16:01:17 packer.exe: 2017/01/06 16:01:17 Plugin minimum port: 10000
2017/01/06 16:01:17 packer.exe: 2017/01/06 16:01:17 Plugin maximum port: 25000
2017/01/06 16:01:17 packer.exe: 2017/01/06 16:01:17 Plugin address: tcp 127.0.0.1:10000
2017/01/06 16:01:17 packer.exe: 2017/01/06 16:01:17 Waiting for connection...
2017/01/06 16:01:17 packer.exe: 2017/01/06 16:01:17 Serving a plugin connection...
2017/01/06 16:01:17 ui: digitalocean output will be in this color.
2017/01/06 16:01:17 ui: 
2017/01/06 16:01:17 Build debug mode: false
2017/01/06 16:01:17 Force build: false
2017/01/06 16:01:17 On error: 
2017/01/06 16:01:17 Preparing build: digitalocean
2017/01/06 16:01:17 Waiting on builds to complete...
2017/01/06 16:01:17 Starting build run: digitalocean
2017/01/06 16:01:17 Running builder: digitalocean
2017/01/06 16:01:17 ui: ==> digitalocean: Creating temporary ssh key for droplet...
2017/01/06 16:01:18 packer.exe: 2017/01/06 16:01:18 temporary ssh key name: packer-586fbf4d-6a34-7f66-0c4e-7c4d292ccb0f
2017/01/06 16:01:18 ui: ==> digitalocean: Creating droplet...
2017/01/06 16:01:22 ui: ==> digitalocean: Waiting for droplet to become active...
2017/01/06 16:01:22 packer.exe: 2017/01/06 16:01:22 Waiting for up to 360 seconds for droplet to become active
2017/01/06 16:01:22 packer.exe: 2017/01/06 16:01:22 Checking droplet status... (attempt: 1)
2017/01/06 16:01:27 packer.exe: 2017/01/06 16:01:27 Checking droplet status... (attempt: 2)
2017/01/06 16:01:32 packer.exe: 2017/01/06 16:01:32 Checking droplet status... (attempt: 3)
2017/01/06 16:01:37 packer.exe: 2017/01/06 16:01:37 Checking droplet status... (attempt: 4)
2017/01/06 16:01:43 packer.exe: 2017/01/06 16:01:43 Checking droplet status... (attempt: 5)
2017/01/06 16:01:47 packer.exe: 2017/01/06 16:01:47 [INFO] Waiting for SSH, up to timeout: 5m0s
2017/01/06 16:01:47 ui: ==> digitalocean: Waiting for SSH to become available...
2017/01/06 16:01:50 packer.exe: 2017/01/06 16:01:50 [INFO] Attempting SSH connection...
2017/01/06 16:01:50 packer.exe: 2017/01/06 16:01:50 reconnecting to TCP connection for SSH
2017/01/06 16:01:50 packer.exe: 2017/01/06 16:01:50 handshaking with SSH
2017/01/06 16:01:51 packer.exe: 2017/01/06 16:01:51 handshake complete!
2017/01/06 16:01:51 packer.exe: 2017/01/06 16:01:51 [INFO] no local agent socket, will not connect agent
2017/01/06 16:01:51 ui: ==> digitalocean: Connected to SSH!
2017/01/06 16:01:51 packer.exe: 2017/01/06 16:01:51 Running the provision hook
2017/01/06 16:01:51 ui: ==> digitalocean: Provisioning with shell script: C:\Users\danielp\AppData\Local\Temp\packer-shell150846575
2017/01/06 16:01:51 packer.exe: 2017/01/06 16:01:51 Opening C:\Users\danielp\AppData\Local\Temp\packer-shell150846575 for reading
2017/01/06 16:01:51 packer.exe: 2017/01/06 16:01:51 [INFO] 371 bytes written for 'uploadData'
2017/01/06 16:01:51 packer.exe: 2017/01/06 16:01:51 opening new ssh session
2017/01/06 16:01:51 [INFO] 371 bytes written for 'uploadData'
2017/01/06 16:02:46 packer.exe: 2017/01/06 16:02:46 ssh session open error: 'ssh: unexpected packet in response to channel open: <nil>', attempting reconnect
2017/01/06 16:02:46 packer.exe: 2017/01/06 16:02:46 reconnecting to TCP connection for SSH
2017/01/06 16:02:46 packer.exe: 2017/01/06 16:02:46 handshaking with SSH
2017/01/06 16:02:46 packer.exe: 2017/01/06 16:02:46 handshake complete!
2017/01/06 16:02:46 packer.exe: 2017/01/06 16:02:46 [INFO] no local agent socket, will not connect agent
2017/01/06 16:03:42 packer.exe: panic: runtime error: invalid memory address or nil pointer dereference
2017/01/06 16:03:42 packer.exe:     panic: runtime error: invalid memory address or nil pointer dereference
2017/01/06 16:03:42 packer.exe: [signal 0xc0000005 code=0x0 addr=0x30 pc=0xa17539]
2017/01/06 16:03:42 packer.exe: 
2017/01/06 16:03:42 packer.exe: goroutine 29 [running]:
2017/01/06 16:03:42 packer.exe: panic(0x13e5f00, 0xc04200e0a0)
2017/01/06 16:03:42 packer.exe:     /usr/local/Cellar/go/1.7.3/libexec/src/runtime/panic.go:500 +0x1af
2017/01/06 16:03:42 packer.exe: github.com/mitchellh/packer/vendor/golang.org/x/crypto/ssh.(*Session).Close(0x0, 0x0, 0xc042040f30)
2017/01/06 16:03:42 packer.exe:     /Users/mwhooker/go/src/github.com/mitchellh/packer/vendor/golang.org/x/crypto/ssh/session.go:156 +0x29
2017/01/06 16:03:42 packer.exe: panic(0x13e5f00, 0xc04200e0a0)
2017/01/06 16:03:42 packer.exe:     /usr/local/Cellar/go/1.7.3/libexec/src/runtime/panic.go:458 +0x251
2017/01/06 16:03:42 packer.exe: github.com/mitchellh/packer/communicator/ssh.(*comm).scpSession(0xc0421ea5a0, 0xc042040f40, 0xc, 0xc042005bf0, 0x0, 0x0)
2017/01/06 16:03:42 packer.exe:     /Users/mwhooker/go/src/github.com/mitchellh/packer/communicator/ssh/communicator.go:644 +0xd6
2017/01/06 16:03:42 packer.exe: github.com/mitchellh/packer/communicator/ssh.(*comm).scpUploadSession(0xc0421ea5a0, 0xc0424c0260, 0x13, 0x1e2e0e0, 0xc0421461a0, 0x0, 0xc042313900, 0x1e2e0e0)
2017/01/06 16:03:42 packer.exe:     /Users/mwhooker/go/src/github.com/mitchellh/packer/communicator/ssh/communicator.go:544 +0x1a0
2017/01/06 16:03:42 packer.exe: github.com/mitchellh/packer/communicator/ssh.(*comm).Upload(0xc0421ea5a0, 0xc0424c0260, 0x13, 0x1e2e0e0, 0xc0421461a0, 0x0, 0x1, 0x32d0490)
2017/01/06 16:03:42 packer.exe:     /Users/mwhooker/go/src/github.com/mitchellh/packer/communicator/ssh/communicator.go:135 +0xd3
2017/01/06 16:03:42 packer.exe: github.com/mitchellh/packer/packer/rpc.(*CommunicatorServer).Upload(0xc0424be0c0, 0xc0424c01c0, 0xc04200e4d0, 0x0, 0x0)
2017/01/06 16:03:42 packer.exe:     /Users/mwhooker/go/src/github.com/mitchellh/packer/packer/rpc/communicator.go:280 +0x169
2017/01/06 16:03:42 packer.exe: reflect.Value.call(0xc042294780, 0xc04202a090, 0x13, 0x162570c, 0x4, 0xc042313ed0, 0x3, 0x3, 0x0, 0x0, ...)
2017/01/06 16:03:42 packer.exe:     /usr/local/Cellar/go/1.7.3/libexec/src/reflect/value.go:434 +0x5cf
2017/01/06 16:03:42 packer.exe: reflect.Value.Call(0xc042294780, 0xc04202a090, 0x13, 0xc042313ed0, 0x3, 0x3, 0xc042301f70, 0x791efb, 0xc042301ef0)
2017/01/06 16:03:42 packer.exe:     /usr/local/Cellar/go/1.7.3/libexec/src/reflect/value.go:302 +0xab
2017/01/06 16:03:42 packer.exe: net/rpc.(*service).call(0xc04200a740, 0xc04200a340, 0xc04200e198, 0xc042410480, 0xc0424c00c0, 0x12db680, 0xc0424c01c0, 0x16, 0x12f4480, 0xc04200e4d0, ...)
2017/01/06 16:03:42 packer.exe:     /usr/local/Cellar/go/1.7.3/libexec/src/net/rpc/server.go:383 +0x14f
2017/01/06 16:03:42 packer.exe: created by net/rpc.(*Server).ServeCodec
2017/01/06 16:03:42 packer.exe:     /usr/local/Cellar/go/1.7.3/libexec/src/net/rpc/server.go:477 +0x428
2017/01/06 16:03:42 ui error: Build 'digitalocean' errored: unexpected EOF
2017/01/06 16:03:42 Builds completed. Waiting on interrupt barrier...
2017/01/06 16:03:42 machine readable: error-count []string{"1"}
2017/01/06 16:03:42 ui error: 
==> Some builds didn't complete successfully and had errors:
2017/01/06 16:03:42 machine readable: digitalocean,error []string{"unexpected EOF"}
2017/01/06 16:03:42 ui error: --> digitalocean: unexpected EOF
2017/01/06 16:03:42 ui: 
==> Builds finished but no artifacts were created.
2017/01/06 16:03:42 waiting for all plugin processes to complete...
2017/01/06 16:03:42 packer.exe: 2017/01/06 16:03:42 Retryable error: Error uploading script: unexpected EOF
2017/01/06 16:03:42 C:\Packer\packer.exe: plugin process exited
2017/01/06 16:03:42 C:\Packer\packer.exe: plugin process exited
Xyon commented 7 years ago

Yep, I got a similar error under Packer 0.11.0; crash.log

EDIT: moved log to gist

rickard-von-essen commented 7 years ago

@Xyon I fail to see the similarities and it's not very useful to report issues with such old versions lik 0.11.0.

Xyon commented 7 years ago

Sure it's helpful; now you know it wasn't introduced with 0.12. I will admit, I don't appreciate Packer's release or development cycle, but 0.11 -> 0.12 didn't seem like a massive leap to me, hence the conjuction.

As for similarity, the OP's report is significant here:

2017/01/06 16:03:42 packer.exe: panic: runtime error: invalid memory address or nil pointer dereference
2017/01/06 16:03:42 packer.exe:     panic: runtime error: invalid memory address or nil pointer dereference
2017/01/06 16:03:42 packer.exe: [signal 0xc0000005 code=0x0 addr=0x30 pc=0xa17539]

Which signal, by the by, is STATUS_ACCESS_VIOLATION (or, SIGSEGV in the *NIX world).

Mine is significant here:

2017/01/09 13:51:20 packer: panic: runtime error: invalid memory address or nil pointer dereference
2017/01/09 13:51:20 packer: [signal SIGSEGV: segmentation violation code=0x1 addr=0x58 pc=0xe82b99]

The same problem (underlying problem with the builder) resulted in the same error message and the same signal being caught by Packer across two platforms, two different builders, and two versions. In both cases, it seems clear to me that because the underlying builder has failed - in the OP's case, digitalocean with an unexpected EOF, and in mine, virtualbox protesting about the VM session still being locked, has caused Packer to implode rather than handle the situation gracefully and point fingers at the root cause effectively. It shouldn't be causing a SIGSEGV when this kind of problem happens, which is why I reported it as well - though the root cause is a different problem, the behaviour from packer is the same, and is a bug.

rickard-von-essen commented 7 years ago

@Xyon That is a nil pointer dereference it's not the same issue, it's the same class of bug see Null pointer. Please open a new issue for problem with all info needed and logs from 0.12.1.

mwhooker commented 7 years ago

possibly related to #4363

which also complains of

2017/01/05 17:07:30 packer: 2017/01/05 17:07:30 ssh session open error: 'ssh: unexpected packet in response to channel open: <nil>', attempting reconnect

but without the panic

jonathansd1 commented 7 years ago

I believe I have a related crash as well. The panic dump appears the same; however, I'm building on a WinSrv2012R2 host and attempting to create the image in AWS from the same WinSrv2012R2. This error appears transitory as I was later able to successfully build.

crash.log

mwhooker commented 7 years ago

@jonathansd1 that doesn't appear to be related to this issue. Please open a new issue for problem with all info needed and logs from 0.12.1.

jonathansd1 commented 7 years ago

Apologies. I will open another issue.

mwhooker commented 7 years ago

Unfortunately I'm not able to reproduce this on windows 10 with the latest build of packer.

Does this happen consistently? Is it still happening with the latest version of packer?

khronos4 commented 7 years ago

@mwhooker I just had similar issue in my personal project. It was caused by opening of a new SSH session over existing connection after previous session was closed. Second session was failing with the same error. Hope it will help.

SwampDragons commented 7 years ago

Closing this issue since we still don't have a repro case; if you are still experiencing this with latest packer, please reopen with details for us. Thanks!

binarywaves commented 6 years ago

I just a built a new Windows 2012 Server and all the files stored locally, using Packer 1.1.1 version and the json file details below. I am getting SSH error "hyperv-iso: waiting for ssh to become available"

I have set the ssh_timeout as 15 m, still i am getting error. Any one please help!!!

SwampDragons commented 6 years ago

This is unlikely to be related to the original ticket.

Does your autounattend file configure SSH? SSH doesn't get turned on by default.

If you need help setting this up, please send your question and relevant files to our mailing list: https://groups.google.com/forum/#!forum/packer-tool