Can no longer connect to Jupyter instance on Gcloud. Can you help me Debug it?

552 views
Skip to first unread message

Graham Anderson

unread,
Sep 4, 2017, 10:33:49 PM9/4/17
to Google Cloud Developers

My Jupyter instance on GCloud was working a couple weeks ago. I restarted it and have been in hell ever since.

This proxy script is giving me errors

/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome  'http://my-google-compute-instance-name:8123'  --proxy-server='socks5://localhost:10000'--host-resolver-rules='MAP * 0.0.0.0 , EXCLUDE localhost' --user-data-dir=/tmp/

2017-09-04 11:32:24.927 Google Chrome[97104:33310120] NSWindow warning: adding an unknown subview: <FullSizeContentView: 0x7faf074c6dd0>. Break on NSLog to debug.
2017-09-04 11:32:24.927 Google Chrome[97104:33310120] Call stack:
(
   
"+callStackSymbols disabled for performance reasons"
)
objc
[97104]: __weak variable at 0x7faf0903e570 holds 0x2121212121212121 instead of 0x7faf0776ed30. This is probably incorrect use of objc_storeWeak() and objc_loadWeak(). Break on objc_weak_error to debug.

My Gcloud script 
(py27)$ gcloud compute ssh --zone=us-central1-a  --ssh-flag='-D' --ssh-flag='10000' --ssh-flag='-N' 'my-google-compute-instance-name'

connects but is giving me the below errors

channel 21: open failed: connect failed: Connection refused
channel
22: open failed: connect failed: Connection refused
channel
21: open failed: administratively prohibited: open failed


as my the name in gcloud and the name in the home directory (on my computer) are different, I tried
(py27)$ gcloud compute ssh mygcloudname@my-google-compute-instance-name --zone=us-central1-a  --ssh-flag='-D' --ssh-flag='10000' --ssh-flag='-N' '

This connects but gives the same open failed: connection failed: Connection refused error when I try to connect with Browser


Jupyter is living i the same director as myname. Still, could Jupyter be running in the wrong directory. How could I debug this?

As I'm not a sysadmin, I'm a bit a wits end..any help is appreciated. 

Graham Anderson

unread,
Sep 5, 2017, 4:15:47 AM9/5/17
to Google Cloud Developers
User Confusion:
Turns out ssh'ing into the project (under myname@instance)  takes me to a different location than creating the project  on Google Cloud Console (under the same user name). 
In my local terminal, I tried to find the project (manually created in Google Cloud) to no avail...even though they are using the same instance name.
When I install anaconda into the directory I ssh'd into, I can connect to jupyter fine.

So the question becomes....
When you create a project as a user in Google Cloud....how do you ssh into that project? 
Should be obvious...I haven't taken obvious for granted for quite some time.



Carlos (Cloud Platform Support)

unread,
Sep 5, 2017, 3:09:43 PM9/5/17
to Google Cloud Developers

Hi Graham,

From what you describe it seems you are unwarily logging in different servers. Moreover looks like the project you are accessing via Cloud Console is different from the one that has been configured on Cloud SDK (gcloud).

You do not actually SSH in your project. Instead you SSH into virtual servers. Here are some clarifications:

  1. One project may contain multiple virtual servers. You can connect via SSH (Linux) or RDP (Windows) to any of them.

  2. Your email account may have permissions in different projects.

  3. You will be able to SSH in any instance weather you have permissions or not on the project. That only happens if all the following conditions are met:

1) Your firewall rules in the VM and in Google project allows the connection.
2) You have the appropriate SSH keys to authenticate.
3) You are able to reach the instance (usually via an external IP)
 

gcloud compute ssh” is just a wrapper around plain SSH that will make sure to generate the SSH key pair if it does not exists (#2). To use the command, Cloud SDK must have to be authenticated with your project.  You can use “gcloud config list” and “gcloud auth list” to confirm which project and account are being used by Cloud SDK.

Another useful command is “gcloud compute instances list”. That will display the servers you have span and will also include any external IP address (which is unique to each server). Since the same VMs names may be repeated across different projects, a simple way to identify the server is by checking the external IP address (if it has one).

If you need to change Cloud SDK settings use “gcloud config set” . You will be able to set the account and the project being used. Finally use “gcloud projects list” to list the projects that are accessible by the active account. You can also switch the project you are working with in the top bar of your Cloud Console. For additional information on projects please refer to this article.


Reply all
Reply to author
Forward
0 new messages