(gcloud.compute.ssh) could not parse resource []

(Yifan Xu) #1

When I return to Google Cloud Platform, after I type

gcloud compute ssh --zone=$ZONE jupyter@$INSTANCE_NAME -- -L 8080:localhost:8080

I got an error from terminal:

(gcloud.compute.ssh) could not parse resource []

Any one knows what was the problem and what should I do?

2 Likes

(Maurice Mickens) #2

Hi Yifan,

I ran across the same issue. You may need to permanently store those environment variables in your ~/.bash_profile or ~/.zshrc for my case since I am using zshell.

So first copy these.

export ZONE="us-west2-b" # budget: "us-west1-b"
export INSTANCE_NAME="my-fastai-instance"
export INSTANCE_TYPE="n1-highmem-8" # budget: "n1-highmem-4"

Then inside of your terminal, doesn’t matter where run this command, which should open your editor.
vim ~/.bash_profile

Now paste the environment variables that you copied above at the end of this file and save it.
To make sure the changes take effect immediately run the command source ~/.bash_profile.

Make sure your gcp instance is started by going to your gcp console.

Run your gcloud compute ssh --zone=$ZONE jupyter@$INSTANCE_NAME -- -L 8080:localhost:8080 and now you should be good to go.

10 Likes

Platform: GCP ✅
(Yifan Xu) #3

Thanks that resolves this issue.

0 Likes

(Shiyu Tang) #4

Thank you a lot.
same issue and solved right away:)

0 Likes

(Sameer) #5

I was able to make this work also. Had to learn basic vim commands, but worked!

1 Like

#6

Thanks, very useful!

0 Likes

(Ami Aram) #7

me too

0 Likes

(Connor Martin) #8

Hi - I’m having the same problem, trying this solution but I can’t figure out how to save?

0 Likes

(Maurice Mickens) #9

Hey Yorke, if you are using vim, then after you make your changes in the editor escape out of edit mode with esc command and enter :x to save.

0 Likes

(Connor Martin) #10

thank you @Mickens - I figured it out.

0 Likes

(Kuan) #11

Hi, Thanks for this tips.

When I typed the above command, the terminal tells me that “Found a swap file by the name ~/.bash_profile.swp”, and “(1) Another program may be editing the same file” or maybe “(2) An edit session for this file crashed”. I tried restarting the computer but still gave me the same thing.

How to resolve this one? Many thanks!

0 Likes

(J) #12

Thanks for this help. It works but sometimes when I come back to my computer the next day I get the same error. If I then run source ~/.bash_profile it works again, even though I haven’t even opened bash_profile this time (see image). Any ideas how to fix this permanently?

0 Likes

(Matthew Matthee) #13

thanks, I had the same question and this resolved it.

I have another question - this method shows how to access the notebook tutorials in my browser with instructions from my local terminal. Is there anyway I can access the notebooks in a browser simply by running commands inside the GCP Fastai VM? ie so I don’t have to use my local terminal? Any help much appreciated, thanks

0 Likes

(David) #14

When I enter vim ~/.bash_profile, the terminal opens text which is hard to edit. I can insert some lines after the bottom after pressing ‘s’.

The whole textblock above starts with:
!! Contents within this block are managed by 'conda init' !!

How do I save this bash file?
EDIT: I used

touch ~/.bash_profile; open ~/.bash_profile
0 Likes

(Charlotte) #15

This is helpful - thanks David. To anyone else reading this: you need to open a new terminal session to load the new variables.

0 Likes