Setup problems: AWS


(Jeremy Howard) #1

This is a place to ask (or answer) questions about getting AWS set up.


How to create aws t2 instance
Permission denied (publickey)
Lesson 1 discussion
(Swathi Shyam Sunder) #2

Does anyone also get the instanceId in quotes when running aws-get-t2 ?
As I am getting this in quotes, aws-start is returning an error about unspecified instance.


(Jeremy Howard) #3

That might mean that when you ran ‘aws configure’ that you didn’t set the output type to ‘text’. See the video for how to do this.


(Kicho) #4

Hello! I set up p2.xlarge instance at AWS on Windows 7. This instance was fine for the first time when I set up, but I cannot access again. I turned on p2.xlarge instance at AWS website and typed the following command in Cygwin, seen from the screenshot. When I tried SSH, I get an error message: Connection timed out.

I followed the AWS website document to try to solve. I am currently stuck at step 4 and 5, because I cannot find “Inbound Rules tab” and “Outbound Rules tab”. Where are they? Fundamentally, is my approach correct? Thanks.

http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesConnecting.html


SSH into your AWS instance?
(Rachel Thomas) #5

@analytics20132333 The “connection timed out” message typically shows up when your instance is not running. After you set up your instance, you need to start it. If you’ve downloaded and sourced our aws_alias.sh file, you can run:
aws-get-p2
aws-start


SSH into your AWS instance?
(janardhanp22) #6

I am trying to execute: bash setup_p2.sh
rtbassoc-89997aef
True
setup_p2.sh: line 13: /Users//.ssh/aws-key.pem: Permission denied
An error occurred (InvalidKeyPair.NotFound) when calling the RunInstances operation: The key pair ‘aws-key’ does not exist
Waiting for instance start…

Waiter InstanceRunning failed: Max attempts exceeded
usage: aws [options] [ …] [parameters]
To see help text, you can run:

aws help
aws help
aws help
aws: error: argument --instance-id: expected one argument
securityGroupId=sg-b6b0d9cf
subnetId=subnet-0e147456
instanceId=
instanceUrl=None


Can't move past the `bash setup_p2.sh` part
(janardhanp22) #7

I tried recreating the key once more but didn’t work


(Rachel Thomas) #8

@janardhanp22 Be sure to check out the Common Problems section of our AWS install wiki http://wiki.fast.ai/index.php/AWS_install, where we recommend trying the below for that error:
rm ~/.ssh/aws-key.pem


(ethan) #9

I have the the InvalidKeyPair error when I run “setup_p2.sh”. On AWS Console, it says I have “no current key pairs in the region”. I tried to run “rm ~/.ssh/aws-key.pem” to fix it, but then it gives me “/Users/username/.ssh/aws-key.pem: No such file or directory”. I can send you the screenshots of the console/terminal/etc. if needed. Thanks :smiley:


(Rachel Thomas) #10

@ethan can you post the full error message?


(anaik2) #11

@rachel I am facing a similar problem as @janardhanp22 but for me it says No such file or directory.


$ bash setup_p2.sh
rtbassoc-a3f211c5
True
setup_p2.sh: line 13: /home/ashish/.ssh/aws-key.pem: No such file or directory
chmod: cannot access ‘/home/ashish/.ssh/aws-key.pem’: No such file or directory

An error occurred (InvalidKeyPair.NotFound) when calling the RunInstances operation: The key pair ‘aws-key’ does not exist
Waiting for instance start…


I tried the rm cmd but it gave me the same error.


$ rm ~/.ssh/aws-key.pem
rm: cannot remove ‘/home/ashish/.ssh/aws-key.pem’: No such file or directory


I am running Cygwin on Windows 7. My aws console instance limits show that I can have 1 ps.xlarge.

Any recommendations?


(janardhanp22) #12

@anaik2 Pls execute: rm ~/.ssh/aws-key.pem and try running bash setup_p2.sh


(janardhanp22) #13

@rachel Now I am hitting this error:

An error occurred (InstanceLimitExceeded) when calling the StartInstances operation: You have requested more instances (2) than your current instance limit of 1 allows for the specified instance type. Please visit http://aws.amazon.com/contact-us/ec2-request to request an adjustment to this limit.


(anaik2) #14

@janardhanp22 thanks! I did that… bash setup_p2.sh still shows the same error. Is it some kind of permissions issue which is not allowing the script to create the key-pair?

“aws ec2 create-key-pair --key-name aws-key --query ‘KeyMaterial’ --output text > ~/.ssh/aws-key.pem”


(janardhanp22) #15

I can see that my p2 instance is running though


(Rachel Thomas) #16

@anaik2 it sounds like you don’t have a ~/.ssh directory. To create one and set the correct permissions:
cd ~
mkdir .ssh
chmod 700 ~/.ssh
Then try running the setup script again


(ethan) #17

Here’s what the error looks like:

bash setup_p2.sh
rtbassoc-1cf5167a
True
setup_p2.sh: line 13: /Users/username/.ssh/aws-key.pem: No such file or directory
chmod: /Users/username/.ssh/aws-key.pem: No such file or directory

An error occurred (InvalidKeyPair.NotFound) when calling the RunInstances operation: The key pair ‘aws-key’ does not exist

An error occurred (AddressLimitExceeded) when calling the AllocateAddress operation: The maximum number of addresses has been reached.
Waiting for instance start…


(Rachel Thomas) #18

@janardhanp22 it sounds like you have already created an instance. If you are using our aws-alias.sh script, you can run:
aws-get-p2
to get the instance id, and:
aws-start
to start it


(anaik2) #19

@rachel Thanks! That worked, but now I am getting a AddressLimitExceeded error:


$ bash setup_p2.sh
rtbassoc-69f4170f
True

An error occurred (AddressLimitExceeded) when calling the AllocateAddress operation: The maximum number of addresses has been reached.
Waiting for instance start…
usage: aws [options] [ …] [parameters]
To see help text, you can run:

aws help
aws help
aws help
aws: error: argument --allocation-id: expected one argument
securityGroupId=sg-f3e1888a
subnetId=subnet-ad3913db
instanceId=i-d9c60386
instanceUrl=ec2-35-162-36-17.us-west-2.compute.amazonaws.com
Connect: ssh -i /home/ashish/.ssh/aws-key.pem ubuntu@ec2-35-162-36-17.us-west-2.compute.amazonaws.com



(ethan) #20

I am having the EXACT same error as you:

bash setup_p2.sh
rtbassoc-30fb1856
True

An error occurred (AddressLimitExceeded) when calling the AllocateAddress operation: The maximum number of addresses has been reached.
Waiting for instance start…
usage: aws [options] [ …] [parameters]
To see help text, you can run:

aws help
aws help
aws help
aws: error: argument --allocation-id: expected one argument
securityGroupId=sg-c1e38ab8
subnetId=subnet-fc455598
instanceId=i-05c20e83622f33de6
instanceUrl=ec2-35-161-141-4.us-west-2.compute.amazonaws.com
Connect: ssh -i /Users/ethanshaotran/.ssh/aws-key.pem ubuntu@ec2-35-161-141-4.us-west-2.compute.amazonaws.com