Setup problems: AWS

Hey Vladi,

I’m happy to help to the best of my limited abilities.

I’m not sure what is your current obstacle. Did my comment about requesting access to P2 instances from Amazon make sense? Jeremy mentions it in the first minute of the setup video:

All I did was to read the text in the last image you posted.

Sorry if I misunderstood your issue. In that case, please restate.
JP

@ Vladi: I am trying to resolve this step as well and from what I have figured out based on comments in this forum is that the wget command is not copying the right stuff. In Jeremy’s video after the cat setup_p2.sh (7:52 min) shows what the file should look like, however in my terminal it is an html file for google login or something like that, similar to what you are getting as you posted above . There is a suggestion to use dos2unix to create a clean version of the setup file but I don’t know how to do that yet. I am running Ubuntu on a chromebook.

Hey tomtran,

I’m not sure why you are getting this error. But here is how I’d go about troubleshooting.

Googling for the last error message yields these tips from AWS:
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesConnecting.html#TroubleshootingInstancesConnectingMindTerm

Are any of those useful?
JP

sandip,

the utility dos2unix is usually used to adapt the end-of-line (EOL) style difference between Unix and Windows. I highly doubt it’s an issue here. The utility sure won’t strip out HTML markup.

Silly question, are you logged into Github before issuing the wget command?

Finally, if I’m still off the mark, please provide the exact commands you are using with the exact, full error messages you are getting.

best,
JP

jp_beaudry, I am not logged into github while copying the file location :slight_smile: will try it now

jp_beaudry

so logging into github didn’t help.
the wget command saved the html code to file setup_p2.sh.7 and cat on this file shows, I think, 7 iterations of that google login html code.
Is there a way to delete these 7 versions of the file before trying wget again?
Thanks,
Sandip

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

instead of

wget https://github.com/fastai/courses/blob/master/setup/setup_p2.sh

copied the shell script instead of the html code.

This was mentioned earlier, on May31 by z0k


The only other hiccup was, had to install ssh using sudo apt-get install openssh-server

I was able to get to the jupyter notebook and import theano and keras


Summary

  • followed Jeremy’s video exactly
  • I had to install gnome terminal instead of the default xTerm to use copy/paste functionality
  • Use the raw setup_p2.sh file location

Sandip,
Congratulations on getting it working! I think I never ran into that problem because I cloned the whole fastai git repository instead of wgetting just one file.

I think this goes without saying but you can delete the needless setup_p2.sh.* files.
JP

Hi

I can’t get past the “bash setup_t2.sh part”. So any assistance would be gratefully received. I’m using Cygwin on Win7. I did it successfully once but had mistakenly put in the wrong region. So I went to through the steps again and keep getting the errors below when trying to run bash setup_t2.sh

./setup_instance.sh: line 5: $’\r’: command not found
./setup_instance.sh: line 8: $’\r’: command not found
./setup_instance.sh: line 128: syntax error: unexpected end of file

I’ve tried running dos2unix without success. I’ve tried doing some of the steps in different orders etc. Below is except from Console:

Tim@TimHP-PC ~/courses/setup
$ bash setup_t2.sh
setup_t2.sh: line 4: $’\r’: command not found
setup_t2.sh: line 9: syntax error near unexpected token elif' 'etup_t2.sh: line 9:elif [ $region = “eu-west-1” ]; then

Tim@TimHP-PC ~/courses/setup
$ dos2unix setup_t2.sh
dos2unix: converting file setup_t2.sh to Unix format…

Tim@TimHP-PC ~/courses/setup
$ bash setup_t2.sh
Only us-west-2 (Oregon), eu-west-1 (Ireland), and us-east-1 (Virginia) are currently supported

Tim@TimHP-PC ~/courses/setup
$ aws configure
AWS Access Key ID [****************JSSQ]: "Password Removed"
AWS Secret Access Key [****************Q4LK]: "Password Removed"
Default region name [us-east-2]: us-west-2
Default output format [text]: text

Tim@TimHP-PC ~/courses/setup
$ bash setup_t2.sh
./setup_instance.sh: line 5: $’\r’: command not found
./setup_instance.sh: line 8: $’\r’: command not found
./setup_instance.sh: line 128: syntax error: unexpected end of file

Tim@TimHP-PC ~/courses/setup
$ dos2unix setup_t2.sh
dos2unix: converting file setup_t2.sh to Unix format…

Tim@TimHP-PC ~/courses/setup
$ bash setup_t2.sh
./setup_instance.sh: line 5: $’\r’: command not found
./setup_instance.sh: line 8: $’\r’: command not found
./setup_instance.sh: line 128: syntax error: unexpected end of file

Hey Tim,

I think you are very close.

Short
run dos2unix on setup_instance.sh

Long
As you correctly guessed, complaints of ‘\r’ and end-of-file (EOF) are signs of file format mismatch between Unix and Windows. So you correctly ran the dos2unix utility on setup_t2.sh.

But note how later on the error message is generated by the ‘setup_instance.sh’ script. You need to run the conversion utility on it, and any other script called.

Hope this helps,
JP

When I head over to platform.ai/files to get the script to run, I get an error message of ACCESS DENIED. Anybody else had this problem?

I believe I found the script in github, mentioned by Rachel in another post, at this link: https://github.com/fastai/courses/blob/master/setup/setup_p2.sh

However, after installing that using
curl https://github.com/fastai/courses/blob/master/setup/setup_p2.sh in my terminal I ran cat setup_p2.sh and am getting a response of: No such file or directory

Any ideas on resolving these issues?

Alright, this was simple.

Had to install Homebrew, and then install wget after that. (curl was the wrong command, I just got a HTML source code response when I ran that)

After doing these 2 things I ran:
wget https://github.com/fastai/courses/blob/master/setup/setup_p2.sh
and WA-LAH!

CATCH IS: Now I’m running into this issue:

bash setup_p2.sh
setup_p2.sh: line 7: syntax error near unexpected token newline' setup_p2.sh: line 7:

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?