Setup problems: AWS

Try this:

chmod 400 /home/USER/.ssh/aws-key-fast-ai.pem

Hi @cghosh,

You also need to download the setup_instance.sh file.

1 Like

Iā€™m getting the same error. I tried Ubuntu Bash like Jeremy recommended and still get the error. I confirmed that both filepaths referenced exist. The only thing I can think is Iā€™m using Python 3.5 on my Anaconda instead of 2.7 like suggested? I installed awscli with pip.

I am trying to install on Windows with Cygwin. configuring AWS didnā€™t work so I used the fix here (http://wiki.fast.ai/index.php/Awscli_in_cygwin) but when I run ā€œinstall apt-cyg /binā€ I get:

install: cannot create regular file ā€˜/bin/apt-cygā€™: Permission denied

Any help is appreciated.

Unfortunately, this did not work for me. I do think what they are trying to solve is the issue though. Unfortunately I donā€™t know enough programming to understand how to get it to work myself. Both in cygwin and ubuntu bash for Windows, I believe the path for the version of Python is incorrect. I need it to use the anaconda, but itā€™s defaulting to python in windows I think. This has happened to me before, but fortunately reinstalling Anaconda worked in that it asks you if you want it to trace the right path for you. I might try that next and see if it helps, but Iā€™m not sure if it will

Getting same error as a few others (using both cygwin and ubuntu bash for Win10) ā€“ only when asking cygwin about aws, seems to be pointing to the same directory itā€™s telling me doesnā€™t exist:

tl;dr: my CLI and my AWS dashboard appear to disagree about the state of my account, which is preventing me from running the setup_t2 startup script (Iā€™m out of Elastic IPs and VPCs).

More detail:

awscli says I have two VPCs on my default profile, and 5 on my other profile (which was before I figured out how to set my default AWS profile):


I deleted the only VPC on my dashboard (which had a non-matching ID anyway) to see if it would affect the output of the CLI, and it did not:


So I figured I must be signed is as the wrong user, right? But on the dashboard Iā€™m signed in to an account with one IAM user:


And that user has the same access key (and secret) that Iā€™m using in my AWS CLI configuration.



I am thoroughly confused. Where are all of the VPCs that my CLI thinks exists but that I canā€™t see in my dashboard? Do I have another user with these credentials? Am I misunderstanding IAM? I followed the setup instructions in the YouTube video up until the setup_t2 step and my region is correct.

Discovered the answer - my VPCs and EIPs did indeed exist under that account, I had just somehow created them in the wrong availability zones! Itā€™s almost like each AZ is its own little AWS world.

Thereā€™s an issue in the aws_alias.sh file, itā€™s missing a single quote at the end of line 7.
Found, added a ' at the end, worked for me - but others might run into this too
Looks like someone already submitted a PR to fix: https://github.com/fastai/courses/pull/80/files

For what itā€™s worth - after a couple of days fiddling with cygwin, anaconda & Bash on Ubuntu on Windows, getting the same errors reported by you and others in this thread - trying the solutions proposed in Stack Overflow as well as here, without resolving the problem -

I gave up the effort on Windows 10, instead installed Linux Mint on VirtualBox on my Windows PC, and now have a working setup. Would it be worth you trying that approach?


Update: having satisfied myself that I could get a p2 instance running via VirtualBox, I tackled the native Windows installation again.

As noted elsewhere in this thread, the key instructions for enabling Awscli in Cygwin are in the course wiki at http://wiki.fast.ai/index.php/Awscli_in_cygwin. Iā€™d tried them before without success. This time I deleted all AWS files in my Anaconda installation (in \Lib\site-packages and \Scripts) before running the awscli_in_cygwin instructions - success!

ā€˜sshā€™ was not recognised by Cygwin and had to be installed manually.

Finally, running setup_p2.sh was throwing up lots of error messages, so I followed the ā€˜Starting Over with AWSā€™ in the wiki (http://wiki.fast.ai/index.php/Starting_Over_with_AWS) to clear the crud from previous failures, and setup_p2.sh ran successfully. I can now start, connect & stop instances via Cygwin - hooray! Time to tackle Lesson 1ā€¦

1 Like

Thanks for this great advice! Youā€™d mentioned editing the volume size to 30, and I am just starting the course. I made the change, deleted my original setup according to the wiki ā€˜start overā€™ instructions, and went back through the walkthrough I ran into this error:

$ bash setup_p2.sh
True

An error occurred (InvalidBlockDeviceMapping) when calling the RunInstances operation: Volume of size 30GB is smaller than snapshot ā€˜snap-2b6c1a18ā€™, expect size >= 128GB

An error occurred (MissingParameter) when calling the CreateTags operation: The request must contain the parameter resourceIdSet
Waiting for instance startā€¦

Waiter InstanceRunning failed: Waiter encountered a terminal failure state
usage: aws [options] [ ā€¦] [parameters]

Any ideas?

Hello,
I am having an issue where I have installed AWS on my windows 10 machine using pip but when I use the aws command in cygwin it says it cannot find it, even though the path it says it is looking in contains what it is looking for.

I have uninstalled any version I python I had before and re-installed anaconda with python 2.7. Nothing seems to work, have tried all the usual things like restarting and checking environmental variables.

The command prompt and windows powershell both recognize the aws command and can give me the version after installing it.
Thank you!
-Kyler

Sorry to have mislead you @jeh0753. I didnā€™t actually try that code and I guess that the setup.sh is only part of the process. I didnā€™t take into account that the AMI ā€˜snapshotā€™ was taken with a 128GB volume. Unfortunately Iā€™m not expert with AMI and/or creating an image which starts at 30GB.

Iā€™m going to go back and edit my post. Sorry that you had to be on the receiving end of my lack of knowledge.

Hi @jeh0753,

Try following the steps in this post to use a 30GB AMI volume.

1 Like

Hi @lhclack @connelly,

I donā€™t have Windows so Iā€™m not sure if I can help, but it seems that aws is still pointing to the Anaconda installed Python rather than Cygwin. What is the output you get when you type aws --version and which python pip?

@lhclack What is the output when you execute type aws? Maybe all you need to do (after following the steps you described in the wiki) is to clear the cache: hash -d aws.

awscli installed fine however when I run aws configure I get the following error:

$ aws
C:\users\charles.fried\appdata\local\programs\python\python35\python.exe: canā€™t open file ā€˜/cygdrive/c/Users/charles.fried/AppData/Local/Programs/Python/Python3 5/Scripts/awsā€™: [Errno 2] No such file or directory

Any ideas?

C:\Users\charles.fried\AppData\Local\Programs\Python\Python35\Scripts is referenced in Path and aws.cmd is in the file.

Tried this solution with no luck: http://wiki.fast.ai/index.php/Awscli_in_cygwin

The error persists:

$ aws
C:\users\charles.fried\appdata\local\programs\python\python35\python.exe: canā€™t open file ā€˜/cygdrive/c/Users/charles.fried/AppData/Local/Programs/Python/Python35/Scripts/awsā€™: [Errno 2] No such file or directory

Edit: Got it working using the step in the wiki linked above, itā€™s important to manually delete the AWS file in the python directory whether it be Anaconda or Python in my case.

1 Like

Thank you for the reply. I ended up doing the sequence described here:
http://wiki.fast.ai/index.php/Awscli_in_cygwin

I had to do it twice and manually delete some aws files in the anaconda install location, the uninstall command did not seem to be working properly on aws.

I am able to proceed now.

1 Like

This is very helpful and settles my mind that Iā€™m not crazy! I could definitely put linux on one of my computers. I used to dual boot and be primarily a linux user in the past but my work has brought me back to Windows and itā€™s been convenient enough that I just havenā€™t used linux in a few years. So that shouldnā€™t be a problem and might actually be more comforting to do this course on!

Iā€™ll check again, but I believe the ā€œwhichā€ brought me to the correct python, however I will definitely apply the cache clear and see if thereā€™s anything else like manually deleting the aws directory like others mentioned. Worst case is I think Iā€™ll try this setup from a linux machine. Thank you for your help!!

1 Like