Can not access Google Cloud Instance

Viewed 42

I am facing the following error while getting into Google Cloud Instance using the serial port. When I run this command, it starts throwing the error.

gcloud compute connect-to-serial-port instance-1

This is the error:

Sep 20 14:28:35 instance-1 OSConfigAgent[670]: 2022-09-20T14:28:35.5396Z OSConfigAgent Error main.go:196: network error when requesting metadata, make sure your instance has an active network and can reach the metadata server: Get http://169.254.169.254/computeMetadata/v1/?recursive=true&alt=json&wait_for_change=true&last_etag=b6d33d232458e45a&timeout_sec=60: dial tcp 169.254.169.254:80: connect: network is unreachable
Sep 20 14:29:33 instance-1 OSConfigAgent[670]: 2022-09-20T14:29:33.5432Z OSConfigAgent Warning: Error waiting for task (attempt 10 of 10): error fetching Instance IDToken: error getting token from metadata: Get http://169.254.169.254/computeMetadata/v1/instance/service-accounts/default/identity?audience=osconfig.googleapis.com&format=full: dial tcp 169.254.169.254:80: connect: network is unreachable 

I am also unable to access the instance using external IP, and the SSH does not work either. SSH throws the following error:

enter image description here

These are my network rules.

enter image description here

I don't want to restart my instance as I have a job running in Jenkinwhich will destroy the whole day's runtime.

1 Answers

From your error message "Connection via Cloud Identity-Aware Proxy Failed" these error occur when you try to use SSH when connecting to a VM that doesn't have a public IP address for which you haven't configured Identity-Aware Proxy on port 22.

you can Create a firewall rule on port 22 that allows ingress traffic from Identity-Aware Proxy.

Also from what @John Hanley suggested to check your VM if it have a service account.

Related