mitchellh / vagrant-aws

Use Vagrant to manage your EC2 and VPC instances.
MIT License
2.61k stars 574 forks source link

Vagrant fail when ssh to ubuntu ec2 #553

Closed naviat closed 5 years ago

naviat commented 5 years ago

I got an error when creating ec2 ubuntu, after created instance, the next step is
Waiting for instance to become "ready"... Waiting for SSH to become available...

It hang a minute then export the log below:

DEBUG ssh: == Net-SSH connection debug-level log END ==
ERROR warden: Error occurred: expected 64-byte String, got 3
 INFO warden: Beginning recovery process...
 INFO warden: Calling recover: #<VagrantPlugins::AWS::Action::RunInstance:0x00000001041d4890>
 INFO machine: Calling action: read_state on provider AWS (i-03057065918adf58e)
 INFO interface: Machine: action ["read_state", "start", {:target=>:earth}]
 INFO runner: Preparing hooks for middleware sequence...
 INFO runner: 1 hooks defined.
 INFO runner: Running action: machine_action_read_state #<Vagrant::Action::Builder:0x00000001029e34c0>
 INFO warden: Calling IN action: #<Vagrant::Action::Builtin::ConfigValidate:0x00000001029d9830>
 INFO warden: Calling IN action: #<VagrantPlugins::AWS::Action::ConnectAWS:0x00000001029d9808>
 INFO connect_aws: Connecting to AWS...
 INFO warden: Calling IN action: #<VagrantPlugins::AWS::Action::ReadState:0x00000001022638f8>

Did anyone know about this ERROR? Thanks!

nickpwhite commented 5 years ago

Did you resolve this issue? I'm experiencing it as well and looking for a solution.

Edit: Found a solution to my issue. My issue was with my shell not knowing about ssh-agent. Running ssh-agent and exporting the env vars that it outputs and then running ssh-add worked for me.