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

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

Closed
pagemedias opened this issue Nov 14, 2016 · 10 comments · Fixed by #4665
Closed

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

pagemedias opened this issue Nov 14, 2016 · 10 comments · Fixed by #4665

Comments

@pagemedias
Copy link

pagemedias commented Nov 14, 2016

@rickard-von-essen
Copy link
Collaborator

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

@rickard-von-essen
Copy link
Collaborator

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.

@rickard-von-essen
Copy link
Collaborator

rickard-von-essen commented Nov 14, 2016

step_get_password.go - L103

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

@mwhooker
Copy link
Contributor

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

@mwhooker mwhooker changed the title 0.11.0 Crash Log builder/amazon: timeout waiting for auto-generated password for instance Nov 14, 2016
@rickard-von-essen rickard-von-essen changed the title builder/amazon: timeout waiting for auto-generated password for instance builder/amazon: Crashing getting auto-generated password for instance Nov 14, 2016
@rickard-von-essen
Copy link
Collaborator

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.

@rickard-von-essen
Copy link
Collaborator

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

@rickard-von-essen
Copy link
Collaborator

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.

@rickard-von-essen rickard-von-essen added this to the v0.12.1 milestone Nov 20, 2016
@mwhooker mwhooker removed this from the v0.12.1 milestone Dec 8, 2016
@mwhooker mwhooker added this to the v0.12.2 milestone Jan 5, 2017
@mwhooker
Copy link
Contributor

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

@mwhooker mwhooker modified the milestones: v1.0, v0.12.2 Jan 19, 2017
@mwhooker
Copy link
Contributor

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?

@rickard-von-essen
Copy link
Collaborator

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

Agree

@ghost ghost locked and limited conversation to collaborators Apr 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants