Packer: builder/amazon: Crashing getting auto-generated password for instance

Created on 14 Nov 2016  路  10Comments  路  Source: hashicorp/packer

bug buildeamazon crash waiting-reply

All 10 comments

2016/11/14 08:48:34 packer.exe: 2016/11/14 08:48:34 Allowing 300s to complete (change with AWS_TIMEOUT_SECONDS)
2016/11/14 08:48:56 ui: ==> amazon-ebs: Waiting for auto-generated password for instance...
2016/11/14 08:48:56 ui:     amazon-ebs: It is normal for this process to take up to 15 minutes,
    amazon-ebs: but it usually takes around 5. Please wait.
2016/11/14 08:48:56 packer.exe: panic: interface conversion: interface is nil, not string
2016/11/14 08:48:56 packer.exe: 
2016/11/14 08:48:56 packer.exe: goroutine 130 [running]:
2016/11/14 08:48:56 packer.exe: panic(0x102e600, 0xc04242a380)
2016/11/14 08:48:56 packer.exe:     /usr/local/Cellar/go/1.7.3/libexec/src/runtime/panic.go:500 +0x1af
2016/11/14 08:48:56 packer.exe: github.com/mitchellh/packer/builder/amazon/common.(*StepGetPassword).waitForPassword(0xc042480b00, 0x180a920, 0xc0423bb500, 0xc042373500, 0x0, 0x0, 0x0, 0x0)
2016/11/14 08:48:56 packer.exe:     /Users/mwhooker/go/src/github.com/mitchellh/packer/builder/amazon/common/step_get_password.go:103 +0x150
2016/11/14 08:48:56 packer.exe: github.com/mitchellh/packer/builder/amazon/common.(*StepGetPassword).Run.func1(0x180cfc0, 0xc04213d120, 0xc042444150, 0xc042444160, 0xc042480b00, 0x180a920, 0xc0423bb500, 0xc042373500, 0xc0421a2850)
2016/11/14 08:48:56 packer.exe:     /Users/mwhooker/go/src/github.com/mitchellh/packer/builder/amazon/common/step_get_password.go:52 +0xb2
2016/11/14 08:48:56 packer.exe: created by github.com/mitchellh/packer/builder/amazon/common.(*StepGetPassword).Run
2016/11/14 08:48:56 packer.exe:     /Users/mwhooker/go/src/github.com/mitchellh/packer/builder/amazon/common/step_get_password.go:54 +0x254
2016/11/14 08:48:56 ui error: Build 'amazon-ebs' errored: unexpected EOF

Please supply the information requested in the issue template:

  • The _simplest example template and scripts_ needed to reproduce the bug.
    Include these in your gist.

step_get_password.go - L103

privateKey := state.Get("privateKey").(string)

is this behavior repeatable? It says that the operation may take up to 15 minutes, but we've got a timeout of 5 minutes. I wonder if we should increase AWS_TIMEOUT_SECONDS during this call.

@pagemedias in the mean time you could probably get around this by setting AWS_TIMEOUT_SECONDS to something like 900

It's not a timeout. It crashes because there is no key.

When using Windows the admin password is set by cloudbase-init and encrypted with the public key from the keypair and the owner of the keypair can decrypt it with the private ssh key.

Most likely introduced in #3953 or a configuration error (that we should catch in prepare).

One problem with the setup is that it can only work with temporary keypairs since you can't both specify communicator winrm and a private key.

But something like:

{
  "communicator": "winrm",
  "ssh_private_key_file": "{{ user `home` }}/.ssh/id_rsa",
  "winrm_username": "Aministrator",
  "winrm_password": "",
  "ssh_keypair_name": "my_aws_keypair"
}

Should be possible.

@pagemedias Can you post a minimal json that will reproduce this issue?

I think this happens when you give an "ssh_keypair_name", but no "ssh_private_key_file", so somehow the prepare check for this condition disappeared. Does that sound correct, @rickard-von-essen?

I think this happens when you give an "ssh_keypair_name", but no "ssh_private_key_file"

Agree

Was this page helpful?
0 / 5 - 0 ratings