When updating primaryemail, getting an "Update Failed: Invalid Input: primary_user_email" error

1,235 views
Skip to first unread message

Devon Peña

unread,
Jun 24, 2021, 12:55:51 PM6/24/21
to GAM for Google Workspace
Hello there!

Thanks for support in advance. Whenever I use the command to update a user's primary email:

gam update user $current_email primaryemail $new_email 

It receive the following error: 

"User: us...@user.com, Update Failed: Invalid Input: primary_user_email"

I can confirm I am on the newest version of GAM, but this was occurring before I updated as well. 

Thank you! 

Devon 

Ross Scroggs

unread,
Jun 24, 2021, 1:05:28 PM6/24/21
to google-ap...@googlegroups.com
Devon,

The value in $new_email is not valid.
Do: gam config debug_level 1 update user $current_email primaryemail $new_email 
In the output look for this line: reply: send: b'{"primaryEmail": "xxxyyyzzz"}'

What is xxxyyyzzz?

Ross


--
You received this message because you are subscribed to the Google Groups "GAM for Google Workspace" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/ba1c8daf-b3c3-4a8d-840d-193c65eaacfbn%40googlegroups.com.


--

Devon Peña

unread,
Jun 24, 2021, 5:04:02 PM6/24/21
to GAM for Google Workspace
Hi Ross, 

Thanks for replying and nice speaking to you again! The result of xxxyyyzzz is $new_email. I did find what the cause of the issue was... I am using a  " + "  in the email, in this case, I am using:  new+email@. At one point, I was able to use special characters. Perhaps I need to wrap it differently now respective to Shell? 


Appreciate your help! 

Ross Scroggs

unread,
Jun 24, 2021, 5:10:33 PM6/24/21
to google-ap...@googlegroups.com
Devon,

if xxxyyyzzz was $new_email, that says that Command Prompt/PowerShell did not replace the variable with its value.

Ross



--

Devon Peña

unread,
Jun 24, 2021, 5:41:27 PM6/24/21
to GAM for Google Workspace
Sorry, I should rephrase!

At some point, using GAM, I was able to create emails using a naming convention like offboard+user@ and now I am receiving the error from my initial post. This has been in the last week or so. The primaryEmail field on the debug log is only duplicating what I am entering on the initial command: 

if I enter: 

gam config debug_level 1 update user us...@user.com primaryemail users+n...@user.com

the above errors out and primaryEmail shows as user+newname@

if I enter: 

gam config debug_level 1 update user us...@user.com primaryemail usersn...@user.com 

the command is successful and the primaryEmail shows as userne...@user.com 


Are the use of symbols in the creation of emails no longer available in GAM? 

Ross Scroggs

unread,
Jun 24, 2021, 6:08:23 PM6/24/21
to google-ap...@googlegroups.com

Devon Peña

unread,
Jun 24, 2021, 6:59:14 PM6/24/21
to GAM for Google Workspace
Ok, I do see that on the Gmail side, however, it looks like Google Workspace Admin guidelines does allow it ? In my case, I did happen to try underscores but the command still failed. 

https://support.google.com/a/answer/9193374?hl=en 

----
Usernames
  • Usernames can contain letters (a-z), numbers (0-9), dashes (-), underscores (_), apostrophes ('), and periods (.).

  • Letters in usernames must be lowercase. If you enter uppercase letters when creating a username, they are converted to lowercase letters.

  • Usernames can't contain more than one period (.) in a row, accents, accented letters, ampersands (&), equal signs (=), brackets (<,>), plus signs (+), or commas (,). 
  • Periods (.) are not ignored in usernames the way they are in gmail.com accounts. If you create a user account called username, this user will not be able to receive messages addressed to user.name, or us.er.na.me, or any other combination of periods. To let a user receive mail with these variations, create an email alias for them.
--- 



Ross Scroggs

unread,
Jun 24, 2021, 7:01:55 PM6/24/21
to google-ap...@googlegroups.com
Devon,

Contact me directly.

Ross



--

Devon Peña

unread,
Jun 24, 2021, 7:15:48 PM6/24/21
to GAM for Google Workspace
Sounds good, I will reach out to you in the next business days to book sometime, thank you! 

Ross Scroggs

unread,
Jun 24, 2021, 7:27:06 PM6/24/21
to google-ap...@googlegroups.com
Devon,

I'm in California (PDT) and am generally available starting at 8. Tomorrow, I won't be available until 10:30.

Ross




--

Devon Peña

unread,
Jun 25, 2021, 11:36:50 AM6/25/21
to GAM for Google Workspace
Ok, sounds good. I am PTO through the 30th, so I will reach out to you after the 4th. 

Thanks so much Ross! 
Reply all
Reply to author
Forward
0 new messages