Setup problems: AWS

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

4 Likes

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.

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.

1 Like

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

@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

2 Likes

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

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

@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

3 Likes

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:

@ethan can you post the full error message?

@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?

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

@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.

@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”

I can see that my p2 instance is running though

@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

6 Likes

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…

@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

@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


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