Thursday, March 17, 2022

[SOLVED] Google Cloud Error: ERROR: INVALID_ARGUMENT: Request contains an invalid argument

Issue

I'm making a voice recognition program, but I can't seem to be able to send a request to the Cloud. Whenever I try:

gcloud projects add-iam-policy-binding [PROJECT_ID] --member "serviceAccount:[SEVICE-ACCOUNT-NAME]@[PROJECT_ID].iam.gserviceaccount.com" --role "roles/owner"

I get this:

ERROR: (gcloud.projects.add-iam-policy-binding) INVALID_ARGUMENT: Request contains an invalid argument.

Can anybody help?


Solution

As specified in the documentation, you should write the command like:

gcloud projects add-iam-policy-binding YOUR_PROJECT_ID --member "serviceAccount:NAME@YOUR_PROJECT_ID.iam.gserviceaccount.com" --role "roles/owner"

This should work for you!



Answered By - ericcco
Answer Checked By - Terry (WPSolving Volunteer)