Error when reading or editing GCE default service account: googleapi: Error 403: Required 'compute.projects.get' permission for 'projects/******', forbidden

1,631 views
Skip to first unread message

Dave Morris

unread,
Apr 29, 2021, 10:53:31 AM4/29/21
to google-cloud-slurm-discuss
Has anyone encountered this error before, on a brand new GCP project and a fresh copy of the slurm-gcp master branch? My permissions on the project are:

Owner
Cloud Asset Viewer
Compute Organization Security Policy Admin
Service Account User
Project IAM Admin

Error Message

$ terraform apply -var-file=basic.tfvars
│ Error: Error when reading or editing GCE default service account: googleapi: Error 403: Required 'compute.projects.get' permission for 'projects/******', forbidden
│   with module.slurm_cluster_controller.data.google_compute_default_service_account.default,
│   on ../../modules/controller/main.tf line 29, in data "google_compute_default_service_account" "default":
│   29: data "google_compute_default_service_account" "default" {}
│ Error: Error when reading or editing GCE default service account: googleapi: Error 403: Required 'compute.projects.get' permission for 'projects/******', forbidden
│   with module.slurm_cluster_login.data.google_compute_default_service_account.default,
│   on ../../modules/login/main.tf line 19, in data "google_compute_default_service_account" "default":
│   19: data "google_compute_default_service_account" "default" {}

Dave Morris

unread,
Apr 29, 2021, 11:11:41 AM4/29/21
to google-cloud-slurm-discuss
For what it's worth, I was able to get past this issue by running:

gcloud auth application-default login

instead of 

gcloud auth login 

After that, I ran into a terraform google module version issue, and had to hard-code version 3.65 into the terraform modules to get past it. Here is a reference for the issue I experienced: https://github.com/hashicorp/terraform-provider-google/issues/9022

Alex Chekholko

unread,
Apr 29, 2021, 11:32:13 AM4/29/21
to Dave Morris, google-cloud-slurm-discuss
One way I avoid running into terraform configuration issues is to run the pre-configured terraform in the Cloud Shell.

--
You received this message because you are subscribed to the Google Groups "google-cloud-slurm-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-slurm-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-slurm-discuss/2198b16c-2389-4956-9d05-ad99e0379110n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages