Rishy
Rishy

Reputation: 95

Google Cloud Error: ERROR: INVALID_ARGUMENT: Request contains an invalid argument

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?

Upvotes: 9

Views: 28558

Answers (3)

Vincent Gerris
Vincent Gerris

Reputation: 7537

It's likely a wrong parameter as the output suggests.

Make sure you use the correct parameters as ericcco suggests. The project id is typically something like my-project-3473646 .

The command would then be something like:

gcloud projects add-iam-policy-binding my-project-3473646 --member "serviceAccount:[email protected]" --role "roles/owner"

It helps if you upvote or mark as solved, it will help others, thank you.

Upvotes: 0

ericcco
ericcco

Reputation: 776

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!

Upvotes: 3

Uladzislau Bayouski
Uladzislau Bayouski

Reputation: 1

It can be an issue of currently active environment config.

Please check it:

gcloud config configurations list

Upvotes: 0

Related Questions