1

I am using the following command to spin up a new EC2 instance:

knife ec2 server create -I ami-f0b11187 --ssh-key "mykeyid" -f t2.micro --ssh-user ubuntu --identity-file ~/.ssh/mykey.pem -z --no-host-key-verify --server-connect-attribute public_ip_address

Instance ID: i-3675f897
Flavor: t2.micro
Image: ami-f0b11187
Region: eu-west-1
Availability Zone: eu-west-1b
Security Groups: default
Tags: Name: i-3675f897
SSH Key: mykeyid

Waiting for EC2 to create the instance......
Public DNS Name: ec2-52-19-107-179.eu-west-1.compute.amazonaws.com
Public IP Address: 52.19.107.179
Private DNS Name: ip-172-31-41-56.eu-west-1.compute.internal
Private IP Address: 172.31.41.56

Waiting for sshd access to become available..done
Doing old-style registration with the validation key at ...
Delete your validation key in order to use your user credentials instead

Connecting to 52.19.107.179
ERROR: TypeError: no implicit conversion of nil into String

Any clue why that last line could be occurring? The instance has been created, and I can now ssh in, but the knife ec2 process aborts here, and I have to perform the bootstrap operation separately. I would really like to get this down to a single command!

Ian Bamforth
  • 289
  • 3
  • 16

1 Answers1

0

An unconfigured knife can be the reason for such a behaviour.

I would recommend to run

knife configure

You also need to have some certificates files ready which you can easily create by

openssl genrsa -des3 -out private.pem 2048