0

I am trying to set up datalab from my chrome book using the following tutorial https://cloud.google.com/dataproc/docs/tutorials/dataproc-datalab. However when trying to set up an SSH tunnel using the following guidelines https://cloud.google.com/dataproc/docs/concepts/accessing/cluster-web-interfaces#create_an_ssh_tunnel I keep on receiving the following error.

ERROR: (gcloud.compute.ssh) Could not fetch resource: - Project 57800607318 is not found and cannot be used for API calls. If it is recently created, enable Compute Engine API by visiting https://console.developers.google .com/apis/api/compute.googleapis.com/overview?project=57800607318 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our sy stems and retry.

The error message would lead me to believe my "Compute Engine API" is not enabled. However, I have double checked and "Compute Engine API" is enabled.

Here is what I am entering into the cloud shell

gcloud compute ssh ${test-cluster-m} \
    --project=${datalab-test-229519} --zone=${us-west1-b}  -- \
    -4 -N -L ${8080}:${test-cluster-m}:${8080}

1 Answers1

0

The ${} is for accessing the local environment variable. You set them in the step before with:

export PROJECT=project;export HOSTNAME=hostname;export ZONE=zone;PORT=number

In this case would be:

export PROJECT=datalab-test-229519;export HOSTNAME=test-cluster-m;export ZONE=us-west1-b;PORT=8080

Either try this:

gcloud compute ssh test-cluster-m \
    --project datalab-test-229519 --zone us-west1-b  -- \
    -D 8080 -N

Or access the enviroment variables with:

gcloud compute ssh ${HOSTNAME} \
    --project=${PROJECT} --zone=${ZONE}  -- \
    -D ${PORT} -N

Also check the VM you are trying to access is running.

Nahuel Varela
  • 1,022
  • 7
  • 17
  • I checked to make sure the VM was running and then tried the code you suggested. On the first try I got an error "bind: Cannot assign requested address". I found this article https://www.electricmonk.nl/log/2014/09/24/ssh-port-forwarding-bind-cannot-assign-requested-address/ and was able to solve the initial issue. However, now when I run there is no error and it simply sits there blinking in the console. – Rhizoblaster Jan 24 '19 at 20:41
  • Are you running this in the Cloud Shell? – Nahuel Varela Jan 25 '19 at 08:23
  • Yes, I am running cloud shell. Do you think it could have something to do with setting it up on a chrome os. I was able to run the quick start tutorial and get it running that way, but I am still unsure why the method described above does not work. – Rhizoblaster Jan 26 '19 at 00:56
  • I don't think so. Could you check the project selected in the Console is the same as the one you are trying to access? – Nahuel Varela Jan 28 '19 at 08:22