Schema Update Errors

486 views
Skip to first unread message

Paul Vincent

unread,
Aug 1, 2017, 7:06:27 AM8/1/17
to GAM for G Suite
I'm having some trouble with updating our users' custom schemas using GAM. We have the following schema structure:

OrgData.userRegion, OrgData.courseEnd, OrgData.userNumber etc. etc. I'm updating our records from CSV files on Windows server using Powershell scripts. They were working last week, but now I'm just getting errors such as: 

updating user xx...@xxxx.com...
.\gam.exe : ERROR: 400: Invalid Input: [OrgData] - invalid
At C:\Program Files\GAM\gam-64\update_CourseStatus_DAILY.ps1:5 char:5
+     .\gam.exe update user $($entry.Gmail) OrgData.courseEnd $($entry.'Course_End ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (ERROR: 400: Inv...Data] - invalid:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

I can't see why this should have suddenly stopped working. The only change I made last week to the schema was to change the parent schema name from StudentData to OrgData, but the scripts were running fine following that change. Has anyone else come across similar issues? I've tried the same command using the Python version and a similar 'invalid input 'OrgData'' error appears. If I try to show the custom schema, I get a Resource Not Found error, but this error doesn't occur with another custom schema and the properties are printed. Anyone encountered similar issues with Custom Schemas?

Many thanks,
Paul

Jay Lee

unread,
Aug 1, 2017, 7:11:06 AM8/1/17
to google-ap...@googlegroups.com
Can you show the output of:

gam info schema <name>

And then the output of an attempt to update a single field for a user?

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-apps-manager@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/9b83a416-2592-48e3-883f-ea4d250de77a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ross Scroggs

unread,
Aug 1, 2017, 6:42:43 PM8/1/17
to google-ap...@googlegroups.com
Paul,

Do: gam show schemas
Is OrgData or StudentData in the list?
How did you change the schema name from StudentData to OrgData?

Ross

On Tue, Aug 1, 2017 at 4:11 AM, Jay Lee <jay...@gmail.com> wrote:
Can you show the output of:

gam info schema <name>

And then the output of an attempt to update a single field for a user?
On Aug 1, 2017 7:06 AM, "Paul Vincent" <paulv...@oca.ac.uk> wrote:
I'm having some trouble with updating our users' custom schemas using GAM. We have the following schema structure:

OrgData.userRegion, OrgData.courseEnd, OrgData.userNumber etc. etc. I'm updating our records from CSV files on Windows server using Powershell scripts. They were working last week, but now I'm just getting errors such as: 

updating user xx...@xxxx.com...
.\gam.exe : ERROR: 400: Invalid Input: [OrgData] - invalid
At C:\Program Files\GAM\gam-64\update_CourseStatus_DAILY.ps1:5 char:5
+     .\gam.exe update user $($entry.Gmail) OrgData.courseEnd $($entry.'Course_End ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (ERROR: 400: Inv...Data] - invalid:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

I can't see why this should have suddenly stopped working. The only change I made last week to the schema was to change the parent schema name from StudentData to OrgData, but the scripts were running fine following that change. Has anyone else come across similar issues? I've tried the same command using the Python version and a similar 'invalid input 'OrgData'' error appears. If I try to show the custom schema, I get a Resource Not Found error, but this error doesn't occur with another custom schema and the properties are printed. Anyone encountered similar issues with Custom Schemas?

Many thanks,
Paul

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsubscribe...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-apps-manager@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.

For more options, visit https://groups.google.com/d/optout.



--

Ross Scroggs

unread,
Aug 1, 2017, 6:46:39 PM8/1/17
to google-ap...@googlegroups.com
Paul,


The following limits apply to custom schemas:

  • The maximum number of custom schemas allowed in an account is 100.
  • The maximum number of custom fields allowed in an account is 100.
  • The maximum number of characters allowed in a string field is 500.
  • The characters allowed in custom schemas and field names are alphanumeric characters, underscores (_), hyphens (-).
  • Changing the type of a field is not allowed.
  • A single-valued field can be made multi-valued, but the inverse operation is not allowed.
  • It is not possible to rename custom schemas or fields.
The last line is interesting.

Ross




--



--

Ross Scroggs

unread,
Aug 1, 2017, 6:55:17 PM8/1/17
to google-ap...@googlegroups.com
Paul,

OK, the API says you can't rename a schema, but the admin console says you can: https://support.google.com/a/answer/6208725?hl=en

"Click on the edit icon next to the attribute name field or on the name itself to edit the attribute name."

So I tried it. The admin console shows the new name but the API used by Gam still returns the old name.

Time to talk to Google,

Ross
--

Paul Vincent

unread,
Aug 2, 2017, 6:01:24 AM8/2/17
to GAM for G Suite
Thanks all for your replies;

I tried the info schema command, and that didn't work for the OrgData. It seems that Ross is correct - you can change the name of the Schema, and that name is passed on to other external services via SAML etc., but it can't be updated through that name. I've switched the command back to StudentData and it does now work. I had a parallel script running that masked the fact that the new schema name was no longer working. Sorry Jay - your docs actually state this behaviour and I missed it in my haste.

Cheers,
Paul
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.



--



--



--
Reply all
Reply to author
Forward
0 new messages