409

416 views
Skip to first unread message

Andrew Walls

unread,
May 30, 2018, 3:41:24 PM5/30/18
to GAM for G Suite
Hi - I have a ticket with Google support. However, thought GAM itself might be a good place to ask too. I wrote a batch file, based on GAM commands, that uses a daily automated export from my schools MIS (as a CSV) to create new Classrooms, add teachers to Classrooms and add students to Classrooms. It runs using Task Scheduler once a day. I put it on my blog last year (http://edtechschool.com/keeping-g-suite-and-google-classroom-in-sync-with-sims-daily-automated-and-free/).

As it tries to create courses for all entries in the spreadsheet (gam create course) it frequently returns 409 errors for duplicates (as I set the same alias for each unique class from the CSV). A bit lazy, and it would be nice for the MIS to not churn out duplicates, but the 409 error for duplicate classes means they won't get created so I thought what the heck, it won't create duplicate classes and it runs every day. Works for me!

Unfortunately, every time the command to create new classes runs the user appears to eat up the user's 2000 group quota (even though a 409 error is returned). I didn't realise this until users stopped being able to join new groups or create new classrooms due to this quota being reached after my script ran for several months chomping into the quota. I was able to prove this by creating some simulated users. After they've been added to 1000 duplicate classes they hit the 2000 total. This seems to match with Classroom's background feature of creating two hidden groups for each teacher who joins a classroom. The error I get back from GAM always indicates that the user has reached the 2000 group limit as well.

Unfortunately, I can't find a way to use GAM to reverse this. Ideally, I'd like GAM to tell me the hidden groups that have been created, or how it's eaten into the quota, and reverse it somehow. Perhaps giving me the group names to delete.

Don't worry, I'll version two the script too ;). Going to adapt it to use sync and update more and only run create once, or twice a year! I have learnt my lesson for sure! I didn't expect the groups to be created even if a 409 is returned. Unsure if GAM is the cause or the Google Classroom API does this whenever it's told to create a new class.

Any help would be much appreciated!

Jay Lee

unread,
May 30, 2018, 3:45:43 PM5/30/18
to google-ap...@googlegroups.com
In general, creating all of your courses with yourself / your admin user as the course owner is a bad idea and leads to these kind of issues.

Doesn't your MIS offer information on the main teacher of the course so that you can set them as the owner teacher? That would pretty much solve the issue for you.

Jay

--
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-man...@googlegroups.com.
To post to this group, send email to google-ap...@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/2921d0e0-92f4-41e7-8339-fdc6055b4ab0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jay Lee

unread,
May 30, 2018, 3:53:05 PM5/30/18
to google-ap...@googlegroups.com
I'd also strongly recommend sorting the CSV down to only unique aliases. Scripts that waste resources and effort doing things you know are going to fail tend to come back and bite you later. In my experience, it's usually when you least want to be dealing with it :-)

Jay

Andrew Walls

unread,
May 30, 2018, 5:09:00 PM5/30/18
to GAM for G Suite
Thanks Jay,

My script sets the teacher as the course owner not me/an admin account. The problem is that it runs over them so many times it seems to have nuked all teacher accounts. So that won't solve the issue.

For example the CSV looks like this:

Teacher, Group
staff...@domain.com, 09x/En_2017

I use the CSV method, but for ease of explanation the command that GAM executes is:
gam course create alias 09x/En_2017 name 09x/En_2017 teacher staff...@domain.com 

staff...@domain.com is the normal class teacher, not me or an admin.

If that command runs 1000 times over a year then staff...@domain.com gets 1 successful creation, 999 409 errors saying it's a duplicate group, then endless 412 errors claiming they're a member of 2000 groups. It then becomes impossible to add the user to any groups or classrooms.

The problem in terms of a resolution is that the teacher appears to only be a member of one group (09x/En_2017) and they're only listed as belonging to standard groups (whole staff mailing list, department mailing list, etc.). I can't see the phantom groups that the system claims to have created. There are no signs in Groups, API requests to see how many groups they're a member of or in Classroom at all.

I've modified the csv export now so that it exports a list of names/aliases at the start and then removes these using find and replace text from any future updates. That makes it much more efficient too! Definitely at the point where I don't want to deal with it lol, got timetable rollover next week. Urg! So everyone will need new Classrooms.

However, I've dug myself into a bit of a hole. I'm just wondering if GAM's error handling can show the phantom groups that seem to be created. There seems to be no evidence in the Admin Console or by running any GAM commands.I can't find a way to see the garbage my bad method has generated let alone a way to delete it.

Jay Lee

unread,
May 30, 2018, 6:33:39 PM5/30/18
to google-ap...@googlegroups.com
How many users do you have in this state?

--
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-man...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.

Andrew Walls

unread,
May 30, 2018, 7:08:34 PM5/30/18
to google-ap...@googlegroups.com
68.

Andrew Walls
Assistant Principal (ICT and New Technologies – MAT)
Sidney Stringer Multi Academy Trust
Primrose Hill Street
Coventry
West Midlands
CV1 5LY

Tel: 024 7625 1756 (ext. 3066)

Follow me on Twitter @theedtechschool

On Wed, 30 May 2018, 23:33 Jay Lee, <jay...@gmail.com> wrote:
How many users do you have in this state?

--
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-man...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.

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

--
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-man...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.

Andrew Walls

unread,
May 31, 2018, 4:58:12 AM5/31/18
to GAM for G Suite
Oh and 52 at another site. Yikes.

+KimNilsson

unread,
May 31, 2018, 5:31:43 AM5/31/18
to GAM for G Suite
On a related note, is it even at all possible to list/manipulate those hidden Classroom groups with GAM?
They are nowhere to be found in the admin console.

Andrew Walls

unread,
May 31, 2018, 7:29:40 AM5/31/18
to google-ap...@googlegroups.com
Can't be found in the admin console or using any API.

In the end, I found printing courses with all fields to a csv using GAM does work but it only shows the hidden Classroom codes linked to an active Classroom. However, there's no way to manipulate those groups.

I think I need a Google Groups Engineer to bail me out here. I've got a ticket open and escalated. Hopefully, they'll be able to get into it and chuck them out.


On Thu, 31 May 2018 at 10:31, +KimNilsson <there.is.no...@gmail.com> wrote:
On a related note, is it even at all possible to list/manipulate those hidden Classroom groups with GAM?
They are nowhere to be found in the admin console.

--
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-man...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.
Reply all
Reply to author
Forward
0 new messages