Setup problems: AWS

sandip,

I’ve followed your instructions, and now I’m running into this error when running

bash setup_p2.sh.1

setup_p2.sh.1: line 20: ./setup_instance.sh: No such file or directory

any ideas what the issue could be?

Hi mchineLRN,
here’s how I would start troubleshooting:

  1. Line 20 is the last line of the script; there are recommendations in this forum that the last line/end syntax may have invisible errors; dos2unix has been suggested as a fix. Cloning the entire github course repository is another. Search this forum for past Line 20 errors
  2. read the output you get with the cat command and see if that is all correct
  3. re-do the aws configure with the ID and Key

Sandip

I ran this from above:

wget https://raw.githubusercontent.com/fastai/courses/master/setup/setup_instance.sh

and it all worked out. I got this from the post by @macro2data up above from 3days ago

1 Like

Great! I am at lesson 1 now and there are a few other setup things to test and getting used to.

have you made it through lesson 1 yet? I’m having issues with setup:

I am still reviewing the video to get a hang of it…
Seems like the future module has something to do with python 3 vs the recommended python 2?


I will get to it soon…

Do you have one or two underscore characters on each side of the “future” string? I think it takes 2:
https://docs.python.org/2/library/future.html

If that’s not the issue, what version of Python are you using?

This is my first query which I decided to post here after a lot of searching through this forum and in the internet. I am running Windows 7, Anaconda 2.7 and have installed Cygwin. I was able to configure aws instance and received the instanceID which I saved to my location. When I try to connect using the statement
ssh -i/home/sswaroop/.ssh/aws-key.pem ubuntu@ec2-34-212-69-12.us-west-2.compute.amazonaws.com
I get the following :
usage: ssh [-1246AaCfGgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec]
[-D [bind_address:]port] [-E log_file] [-e escape_char]
[-F configfile] [-I pkcs11] [-i identity_file]
[-J [user@]host[:port]] [-L address] [-l login_name] [-m mac_spec]
[-O ctl_cmd] [-o option] [-p port] [-Q query_option] [-R address]
[-S ctl_path] [-W host:port] [-w local_tun[:remote_tun]]
[user@]hostname [command]

Any suggestions?

Hi all,

I’ve been trying to create the P2 instance using Windows 10 and Cygwin for 2 days. I also tried installing Ubuntu bash to no avail.

After almost losing the will to live and having experienced just about every setup_p2.sh error under the sun, I installed a Linux virtual machine, copied the entire setup folder from the git repository to my (virtual) Ubuntu desktop, installed aws, then ran the aws configuration followed by bash setup_p2.sh from the linux command line. Everything worked like a dream, and now the P2 instance is up and running. If you’re in a similar situation, this approach may help.

Yep, this was really helpful. Thanks!

samsonpaturi,

The error is suggestive of an error in the way ssh is invoked. In other words, one of the parameters is wrong.

Wild guess: there’s supposed to be a space after the ‘i’ in “-i/home/ss…”

If that’s not it, then closely review the ssh command line.

HTH,
JP

Hi JP, thanks for your suggestion. The issue is not the space, I tried that already. I get the same output if I simply type ssh command. I am basically stuck without any progress.

Oh, that’s a bummer. Let’s keep trying:

Can you ssh successfully anywhere else with any set of parameters? Back at school or in some corporate setup, I had access to many servers to practice on. Nowadays, I’d Google a bit and/or would setup my own SSH server. This thread for example, looks like a promising source of test locations:

You need to isolate the fault. Is it with the specific AWS parameters? Is it a ssh client install issue? Funky interaction with your shell?

Also, are you able to determine exactly which ssh client is being called? My memory of which unix commands are available on Cygwin is fuzzy, but perhaps “which ssh” would do it.

1 Like

After a LOT of time spent on this, I finally found a solution that works.

The primary issue is that the cygwin didn’t come with python installed, and doesn’t know where to find the existing Windows Anaconda version on your machine. This can be verified by running which python from within cygwin - it couldn’t find where python is saved. Note that this can be confusing because running pip install awscli likely doesn’t throw an error message. Cygwin actually installs awscli in the Window’s Anaconda installation of Python (I find this odd since we didn’t run conda install awscli).

HOWEVER, rather than try to point cygwin to the already installed version of Anaconda python on your machine it will save you a ton of headache to just install a cygwin-specific instance of python.

The initial steps to run in cygwin are (documented here: http://wiki.fast.ai/index.php/Awscli_in_cygwin)

  1. pip uninstall awscli
  2. wget rawgit.com/transcode-open/apt-cyg/master/apt-cyg
  3. install apt-cyg /bin
  4. apt-cyg install python
  5. wget https://bootstrap.pypa.io/get-pip.py python get-pip.py pip install awscli

…Note, however, that the first command pip uninstall awscli “hung up” for me. So just escape out of it using quit() and continue with the others in order.

You can check that everything worked if you run which python in cygwin and it points to the cygin version (i.e. /usr/bin/python , as opposed to: /users/…/Anaconda2/).

The next CRITICAL step is that when you download all the shell scripts from Github setup folder (https://github.com/fastai/courses/tree/master/setup), Windows automatically CRLF line terminators! Therefore, in cygwin, run the following commands:

  1. apt-cyg install dos2unix
  2. dos2unix setup_p2.sh
  3. dos2unix setup_instance.sh
  4. then finally, bash setup_p2.sh

This should do the trick.

Hi, mchineLRN, I am having the same issue setting up, I ran wget https://github.com/fastai/courses/blob/master/setup/setup_p2.sh and wget https://raw.githubusercontent.com/fastai/courses/master/setup/setup_instance.sh but I am still getting
$ bash setup_p2.sh
setup_p2.sh: line 2: syntax error near unexpected token newline' setup_p2.sh: line 2:

Can you please let me know how did you solve this?

Thank you
Susan

Hi, I am having the same error,
$ bash setup_p2.sh
setup_p2.sh: line 2: syntax error near unexpected token newline' setup_p2.sh: line 2:

and I tried wget https://raw.githubusercontent.com/fastai/courses/master/setup/aws-alias.sh
wget https://raw.githubusercontent.com/fastai/courses/master/setup/setup_instance.sh
wget https://raw.githubusercontent.com/fastai/courses/master/setup/setup_p2.sh
with no luck. You said copy paste text on github, which text?
Thanks
Susan

setup_instance.sh:
wget https://raw.githubusercontent.com/fastai/courses/master/setup/setup_instance.sh

should fix your problem if I remember correctly. Not sure the logic behind it but I installed it just playing around it worked for me.

Hi Josh, do you still remember how you solved this problem? my CAT command is full of HTML tags. What scripts did you use to make it right?

Thanks
Susan

Hi @susanli,

Did you delete the original setup_instance.sh file? If not, each new file you download with wget is appended with a number.

Thank you, now it works like a dream!

1 Like