ERROR: 500 when running GAM in batch mode

64 views
Skip to first unread message

Andrew Dunlop RCDSB

unread,
Sep 16, 2019, 11:28:05 AM9/16/19
to GAM for G Suite
Is this a bug or am I using GAM incorrectly?

I get ERROR: 500 when I run GAM in batch mode.  Here is what I am doing:

I am using GAM 4.94 on Windows 2012 R2.  

I have the following commands in a batch file called batch.txt that attempt to modify 3 settings on 2 groups:

gam update group AL...@rcdsb.on.ca update owner user us...@rcdsb.on.ca
gam update group AL...@rcdsb.on.ca max_message_bytes 25M
gam update group AL...@rcdsb.on.ca spam_moderation_level allow
gam update group BL...@rcdsb.on.ca update owner user us...@rcdsb.on.ca
gam update group BL...@rcdsb.on.ca max_message_bytes 25M
gam update group BL...@rcdsb.on.ca spam_moderation_level allow

If I run the batch file with only 1 thread, it works fine as follows:

set GAM_THREADS=1

c:\gam\gam.exe batch batch.txt
Using 1 processes...
 Group: al...@rcdsb.on.ca, us...@rcdsb.on.ca Updated to OWNER
updated group al...@rcdsb.on.ca
updated group al...@rcdsb.on.ca
 Group: bl...@rcdsb.on.ca, us...@rcdsb.on.ca Updated to OWNER
updated group bl...@rcdsb.on.ca
updated group bl...@rcdsb.on.ca

==================================

If I run the batch command with 2 or more threads, it fails as follows:

set GAM_THREADS=2

c:\gam\gam.exe batch batch.txt
Using 2 processes...
 Group: al...@rcdsb.on.ca, us...@rcdsb.on.ca Updated to OWNER
updated group al...@rcdsb.on.ca
updated group al...@rcdsb.on.ca
 Group: bl...@rcdsb.on.ca, us...@rcdsb.on.ca Updated to OWNER

ERROR: 500: Failed write includeInGlobalAddressList for group - 500
updated group bl...@rcdsb.on.ca

+KimNilsson

unread,
Sep 16, 2019, 11:33:30 AM9/16/19
to GAM for G Suite
Have you tried running the command with CSV instead of Batch?

Andrew Dunlop RCDSB

unread,
Sep 16, 2019, 12:09:33 PM9/16/19
to GAM for G Suite
I rewrote my script to use the CSV method and it works.  Thanks for the workaround.  

I believe it works as the CSV method is only making one change to one group at a time using parallel processing.  Batch mode is failing as it is trying to change 3 settings on one group at a time in parallel.  

Is this a limitation of batch mode then?

Jay Lee

unread,
Sep 16, 2019, 12:26:25 PM9/16/19
to google-ap...@googlegroups.com
Your wasting cycles making multiple API calls per group, multiple group settings can be changed at the same time and with one GAM command:

gam update group AL...@rcdsb.on.ca update owner user us...@rcdsb.on.ca
gam update group AL...@rcdsb.on.ca max_message_bytes 25M spam_moderation_level allow
gam update group BL...@rcdsb.on.ca update owner user us...@rcdsb.on.ca
gam update group BL...@rcdsb.on.ca max_message_bytes 25M spam_moderation_level allow

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/b2337c62-0a63-44b1-a7b5-2ecca449f953%40googlegroups.com.

Ross Scroggs

unread,
Sep 16, 2019, 12:44:37 PM9/16/19
to google-ap...@googlegroups.com
It's also the case that max_message_bytes is deprecated, you can omit it.

Ross



--

Andrew Dunlop RCDSB

unread,
Sep 16, 2019, 12:44:40 PM9/16/19
to GAM for G Suite
Thanks for the tip.  That makes my script much easier to update and faster to run.  


On Monday, 16 September 2019 12:26:25 UTC-4, Jay Lee wrote:
Your wasting cycles making multiple API calls per group, multiple group settings can be changed at the same time and with one GAM command:

gam update group AL...@rcdsb.on.ca update owner user us...@rcdsb.on.ca
gam update group AL...@rcdsb.on.ca max_message_bytes 25M spam_moderation_level allow
gam update group BL...@rcdsb.on.ca update owner user us...@rcdsb.on.ca
gam update group BL...@rcdsb.on.ca max_message_bytes 25M spam_moderation_level allow

On Mon, Sep 16, 2019 at 12:09 PM 'Andrew Dunlop RCDSB' via GAM for G Suite <google-ap...@googlegroups.com> wrote:
I rewrote my script to use the CSV method and it works.  Thanks for the workaround.  

I believe it works as the CSV method is only making one change to one group at a time using parallel processing.  Batch mode is failing as it is trying to change 3 settings on one group at a time in parallel.  

Is this a limitation of batch mode then?

On Monday, 16 September 2019 11:33:30 UTC-4, +KimNilsson wrote:
Have you tried running the command with CSV instead of Batch?

--
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.

Andrew Dunlop RCDSB

unread,
Sep 16, 2019, 12:46:37 PM9/16/19
to GAM for G Suite
Thanks for your tip as well Ross.  


On Monday, 16 September 2019 12:44:37 UTC-4, Ross Scroggs wrote:
It's also the case that max_message_bytes is deprecated, you can omit it.

Ross

On Mon, Sep 16, 2019 at 9:26 AM Jay Lee <jay...@gmail.com> wrote:
Your wasting cycles making multiple API calls per group, multiple group settings can be changed at the same time and with one GAM command:

gam update group AL...@rcdsb.on.ca update owner user us...@rcdsb.on.ca
gam update group AL...@rcdsb.on.ca max_message_bytes 25M spam_moderation_level allow
gam update group BL...@rcdsb.on.ca update owner user us...@rcdsb.on.ca
gam update group BL...@rcdsb.on.ca max_message_bytes 25M spam_moderation_level allow

On Mon, Sep 16, 2019 at 12:09 PM 'Andrew Dunlop RCDSB' via GAM for G Suite <google-ap...@googlegroups.com> wrote:
I rewrote my script to use the CSV method and it works.  Thanks for the workaround.  

I believe it works as the CSV method is only making one change to one group at a time using parallel processing.  Batch mode is failing as it is trying to change 3 settings on one group at a time in parallel.  

Is this a limitation of batch mode then?

On Monday, 16 September 2019 11:33:30 UTC-4, +KimNilsson wrote:
Have you tried running the command with CSV instead of Batch?

--
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.

--
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.


--
Ross Scroggs
Reply all
Reply to author
Forward
0 new messages