ERROR: gcloud crashed (AttributeError): 'Thread' object has no attribute 'isAlive'

Viewed 3310

The problem occurs with macOs when trying to connect to VM through iap. The same command works from another system with the same credentials, so must be something to do with my local environment.

This is the command I'm trying to run:

gcloud compute ssh **** --project=**** --zone=europe-west4-a --tunnel-through-iap

And it fails with this error:

ERROR: gcloud crashed (AttributeError): 'Thread' object has no attribute 'isAlive'

If you would like to report this issue, please run the following command:
  gcloud feedback

To check gcloud for common problems, please run the following command:
  gcloud info --run-diagnostics
kex_exchange_identification: Connection closed by remote host
ERROR: (gcloud.compute.ssh) [/usr/bin/ssh] exited with return code [255].

Google gives me no answer whatsoever

2 Answers

gcloud wraps your host's ssh binary when you gcloud compute ssh ..., you're running ssh (per the error /usr/bin/ssh) with some args generated for you by gcloud.

The error suggests that your host is unable to connect to the remote machine and access it using ssh.

One approach is to gcloud compute ssh .... --log-http to get gcloud to output the complete ssh command. You could then try to repro the ssh command directly to determine the error.

Alternatively you can add gcloud ... --verbosity=debug to get more extensive logging.

Confirm that the instance is running, that you can access it and that you're permitted to ssh to it. You could try telnet [[host IP]] 22.

Related