0

I've been playing with google datalab and it's hard to get a connection to the notebook

I can create/launch an instance successfuly but usually the notebook is unavailable

$ datalab create [instance]
Connecting to [instance].

This will create an SSH tunnel and may prompt you to create an rsa key pair. To manage these keys, see https://cloud.google.com/compute/docs/instances/adding-removing-ssh-keys
Waiting for Datalab to be reachable at http://localhost:8081/
ERROR: (gcloud.compute.ssh) [/usr/bin/ssh] exited with return code [255].
Connection broken
Attempting to reconnect...
Waiting for Datalab to be reachable at http://localhost:8081/

however, even while the notebook is unavailable, I can always SSH from the console

gcloud compute --project "[project]" ssh --zone "asia-east1-a" "[instance]"

sometimes I ^C and try again with datalab connect [instance] and it will eventually work. Am I doing anything wrong, or is it just hit/miss?

michael
  • 4,377
  • 8
  • 47
  • 73
  • Does this only occur after you've run `datalab create`, or can you reproduce by running `datalab connect` on a VM that has been running for some time? – Dan Kowalczyk Jan 31 '18 at 05:44
  • Is any error being returned or does it just take forever to connect? I have tried myself and it its true that it takes some time (connection after `datalab create` took >5min, but connection with `datalab connect --zone --port 8081 ` was almost instantaneous. Has this always happened to you or is this a transient issue? – dsesto Jan 31 '18 at 11:07

1 Answers1

0

It sometimes takes a few minutes for datalab to connect. If it does not connect, I also do as you describe and open a new Cloud Shell window (or use tmux to start another "tab") to run datalab connect [env] which usually works.

I believe this delay occurs because the web/notebook server takes time to start up after the environment is built.

Dan Kowalczyk
  • 4,103
  • 2
  • 18
  • 29