This error
ERROR: (gcloud.compute.ssh) Users instance [sXXXXXXX@sty-holdings.com] not found: Project ID not found.
and its sometimes reports the error this way:
ERROR: (gcloud.compute.ssh) HttpError accessing <https://oslogin.googleapis.com/v1/users/scott.yacko@sty-holdings.com/loginProfile?alt=json&projectId=savup-production>: response: <{'vary': 'Origin, X-Origin, Referer', 'content-type': 'application/json; charset=UTF-8', 'content-encoding': 'gzip', 'date': 'Tue, 25 Jul 2023 19:02:40 GMT', 'server': 'ESF', 'cache-control': 'private', 'x-xss-protection': '0', 'x-frame-options': 'SAMEORIGIN', 'x-content-type-options': 'nosniff', 'alt-svc': 'h3=":443"; ma=2592000,h3-29=":443"; ma=2592000', 'transfer-encoding': 'chunked', 'status': 500}>, content <{
"error": {
"code": 500,
"message": "Internal error encountered.",
"status": "INTERNAL"
}
}
is returned from this command
gcloud compute ssh --zone "${GC_REGION}" "${GC_REMOTE_LOGIN}" --command "if [ ! -f \"/etc/original.fstab\" ]; then lsblk --noheadings --raw -o NAME,MOUNTPOINT | awk 'length(\$1) == 3 && \$1 != \"sda\"' > /tmp/drive-letter.tmp; fi";
which is the first command issued after the instance is built.
This same script has been run in a development project without any errors.
Instance command:
gcloud compute instances create savup-prod-0001
--zone=us-central1-c
--machine-type=e2-small
--network-interface=network-tier=PREMIUM,subnet=default,address=34.67.100.152
--metadata=environment=,enable-oslogin=true
--maintenance-policy=MIGRATE
--provisioning-model=STANDARD
--service-account=838247644754-compute@developer.gserviceaccount.com
--scopes=https://www.googleapis.com/auth/cloud-platform
--tags=nats,savup-http,savup-https,plaid
--no-shielded-secure-boot
--no-restart-on-failure
--create-disk=auto-delete=yes,boot=yes,device-name=,image=projects/ubuntu-os-cloud/global/images/ubuntu-2004-focal-v20230724,mode=rw
--shielded-vtpm
--shielded-integrity-monitoring
--maintenance-policy=MIGRATE
--reservation-affinity=any
--key-revocation-action-type=stop
--create-disk=device-name=savup-prod-0001-nats,mode=rw,name=savup-prod-0001-nats
Created [https://www.googleapis.com/compute/v1/projects/savup-production/zones/us-central1-c/instances/savup-prod-0001].
NAME ZONE MACHINE_TYPE PREEMPTIBLE INTERNAL_IP EXTERNAL_IP STATUS
savup-prod-0001 us-central1-c e2-small 10.128.0.43 34.67.100.152 RUNNING
The project id is set before the instance is created with this command:
gcloud config set project XXXXXXXXX
NOTE: This is a production level project
What I've done so far
- Rerun this in a non-production project and it works.
- Checked the gCloud CLI version which is
--version 438.0.0
- Changed the OS image to
projects/ubuntu-os-cloud/global/images/ubuntu-2004-focal-v20230724
- Rerun this again in a non-production project and it works.