0
votes

I get an error running gcloud SDK to set up a service account on the RPi3B+ using the Raspberian OS. I have an account on Google API under the email address of dxxxxx.xxxxx.xx@gmail.com with an API Key. The following error is generated under the command line:

pi@raspberrypi:~ $ gcloud iam service-accounts create dxxxxx.xxxxx.xx

ERROR: (gcloud.iam.service-accounts.create) argument NAME: Bad value [dxxxxx.xxxxx.xx]: Service account name must be between 6 and 30 characters (inclusive), must begin with a lowercase letter, and consist of lowercase alphanumeric characters that can be separated by hyphens. Usage: gcloud iam service-accounts create NAME [optional flags] optional flags may be --display-name | --help

For detailed information on this command and its flags, run: gcloud iam service-accounts create --help

I have met the NAME parameter requirements from what I read in the documentation. All the "x"s are lowercase alpha-numeric.

2
We can't tell whether your account name is valid or not, because (obviously) you can't give it to us to test. If you're certain it meets the requirements, contact Google Support directly for help, as they can verify that it's valid and access your account to deal with any issues.Ken White
Appreciate the suggestion. As far as I can tell the account NAME is valid; however, I was dubious about the inclusion of "." in the name? I will contact Google support - not sure at this point how to do that.Donald Downs

2 Answers

0
votes

Just to know, did you tried to run the command without the dots? as Google says, the dots don't matter on Gmail, and its possible that when you try to run this on the shell, you are getting the error for using dots.

TL:DR: can you try to run gcloud iam service-accounts create dxxxxxxxxxxxx

0
votes

You cannot use periods . in service account names.

You cannot use a regular email address as the name to create a service account. Service Account email addresses have a special format: name@<project_id>.iam.gserviceaccount.com

This means that you do not have a service account with the name dxxxxx.xxxxx.xx@gmail.com.

You can have a Google Accounts email address with periods in the email address.

The Google Cloud Console, when creating a service account, will convert periods to hyphens.

If you attempt to create a service account with periods using gcloud you will receive an error similar to the following:

gcloud.iam.service-accounts.create) argument NAME: Bad value [bob.jones]: Service account name must be between 6 and 30 characters (inclusive), must begin with a lowercase letter, and consist of lowercase alphanumeric characters that can be separated by hyphens.

If you attempt to create a service account with periods in it using Python 3.x you will receive an error similar to the following:

HttpError 400 when requesting https://iam.googleapis.com/v1/projects/development-123456/serviceAccounts?alt=json returned "bob.jones does not match [a-z][a-z\d-]*[a-z\d]."