oauth2service.json has an invalid format

931 views
Skip to first unread message

Graham Ingleby

unread,
Jan 11, 2018, 7:27:55 AM1/11/18
to GAM for G Suite
Since I upgraded to 4.40 I am getting an error about my oauth2service.json file being an invalid format on some commands

I can run
gam info domain
fine, I deleted the oauthfile and it recreated file

However, when I run 
gam user gra...@gitest.info check serviceaccount
I get the following error
Please run

gam create project
gam user <user> check serviceaccount

to create and configure a service account.

ERROR: The file G:\My Drive\gam-64\oauth2service.json has an invalid format.

I tried copying the oauth2service.json from a gam372 folder I have but still get the same error

The oauth2service.json file looks like this (actual keys replaced with x's):
{
  "private_key_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "private_key": "-----BEGIN PRIVATE KEY-----\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n-----END PRIVATE KEY-----\n",
  "type": "service_account"
}

This is a slightly different order to examples I have seen on here before, does it matter which order the lines are in? (I have seen type as the first line before for example)

Any ideas apart from creating a new project? My project has been in place for years (Oct 2014 according to the console) is there maybe something in there that needs updating?

Thanks
Graham

Jay Lee

unread,
Jan 11, 2018, 7:56:33 AM1/11/18
to google-ap...@googlegroups.com
Error indicates your Json format may be invalid. No need to create a new project or service account, there's an option in the console to download a new key, get it in Json format. I suggest revoking the old key at the same time.

Jay


This message is for the named person's use only. If you receive this message in error, please delete it and notify the sender. Ancoris reserves the right to monitor all e-mail communications through its networks. Ancoris Limited, Registered in England Number: 04830784, Registered address: 5a Frascati Way, Maidenhead, Berkshire SL6 4UY. Trading Address: Lily Hill House, Lily Hill Road, Bracknell, Berkshire RG12 2SJ




--
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/944248a9-1e7e-4f18-a3ff-c6305f11a436%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Graham Ingleby

unread,
Jan 11, 2018, 11:48:26 AM1/11/18
to GAM group
If I install GAM v 4.32 then it works OK

What is different in the way v4.40 looks at the oauth2services.json file?

 


Graham Ingleby  |  Google Cloud Consultant  |  +44 1344 203395  |  ging...@ancoris.com
             
Twitter Google+ LinkedIn YouTube Ancoris 

Subscribe to our blog and receive our latest articles straight to your inbox

Ancoris receives Computing Cloud Excellence Award

Powered by Ancoris Signatures


On 11 January 2018 at 12:56, Jay Lee <jay...@gmail.com> wrote:
Error indicates your Json format may be invalid. No need to create a new project or service account, there's an option in the console to download a new key, get it in Json format. I suggest revoking the old key at the same time.

Jay

On Thu, Jan 11, 2018, 7:27 AM 'Graham Ingleby' via GAM for G Suite <google-apps-manager@googlegroups.com> wrote:
Since I upgraded to 4.40 I am getting an error about my oauth2service.json file being an invalid format on some commands

I can run
gam info domain
fine, I deleted the oauthfile and it recreated file

However, when I run 
gam user gra...@gitest.info check serviceaccount
I get the following error
Please run

gam create project
gam user <user> check serviceaccount

to create and configure a service account.

ERROR: The file G:\My Drive\gam-64\oauth2service.json has an invalid format.

I tried copying the oauth2service.json from a gam372 folder I have but still get the same error

The oauth2service.json file looks like this (actual keys replaced with x's):
{
  "private_key_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "private_key": "-----BEGIN PRIVATE KEY-----\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n-----END PRIVATE KEY-----\n",
  "type": "service_account"
}

This is a slightly different order to examples I have seen on here before, does it matter which order the lines are in? (I have seen type as the first line before for example)

Any ideas apart from creating a new project? My project has been in place for years (Oct 2014 according to the console) is there maybe something in there that needs updating?

Thanks
Graham


This message is for the named person's use only. If you receive this message in error, please delete it and notify the sender. Ancoris reserves the right to monitor all e-mail communications through its networks. Ancoris Limited, Registered in England Number: 04830784, Registered address: 5a Frascati Way, Maidenhead, Berkshire SL6 4UY. Trading Address: Lily Hill House, Lily Hill Road, Bracknell, Berkshire RG12 2SJ




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

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

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

Ross Scroggs

unread,
Jan 11, 2018, 2:33:06 PM1/11/18
to google-ap...@googlegroups.com
Graham,

Add these two lines and try again:

Ross

  "type": "service_account"
}

This is a slightly different order to examples I have seen on here before, does it matter which order the lines are in? (I have seen type as the first line before for example)

Any ideas apart from creating a new project? My project has been in place for years (Oct 2014 according to the console) is there maybe something in there that needs updating?

Thanks
Graham


This message is for the named person's use only. If you receive this message in error, please delete it and notify the sender. Ancoris reserves the right to monitor all e-mail communications through its networks. Ancoris Limited, Registered in England Number: 04830784, Registered address: 5a Frascati Way, Maidenhead, Berkshire SL6 4UY. Trading Address: Lily Hill House, Lily Hill Road, Bracknell, Berkshire RG12 2SJ




--
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+unsubscribe...@googlegroups.com.


This message is for the named person's use only. If you receive this message in error, please delete it and notify the sender. Ancoris reserves the right to monitor all e-mail communications through its networks. Ancoris Limited, Registered in England Number: 04830784, Registered address: 5a Frascati Way, Maidenhead, Berkshire SL6 4UY. Trading Address: Lily Hill House, Lily Hill Road, Bracknell, Berkshire RG12 2SJ




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



--

Graham Ingleby

unread,
Jan 12, 2018, 11:16:43 AM1/12/18
to GAM group
Hi Ross

That fixed it!

Thanks very much
Graham

 


Graham Ingleby  |  Google Cloud Consultant  |  +44 1344 203395  |  ging...@ancoris.com
             
Twitter Google+ LinkedIn YouTube Ancoris 

Subscribe to our blog and receive our latest articles straight to your inbox

Ancoris receives Computing Cloud Excellence Award

Powered by Ancoris Signatures


On 11 January 2018 at 19:32, Ross Scroggs <ross.s...@gmail.com> wrote:
Graham,

Add these two lines and try again:

Ross



--

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

Max

unread,
Feb 9, 2018, 2:07:33 PM2/9/18
to GAM for G Suite
I too had the aforementioned issue.  I regenerated the token and set everything up all over again.  It worked for 1 day.

The addition of those two lines fixed it for me though.


On Thursday, January 11, 2018 at 2:33:06 PM UTC-5, Ross Scroggs wrote:
Graham,

Add these two lines and try again:

Ross
On Thu, Jan 11, 2018 at 8:48 AM, 'Graham Ingleby' via GAM for G Suite <google-ap...@googlegroups.com> wrote:
If I install GAM v 4.32 then it works OK

What is different in the way v4.40 looks at the oauth2services.json file?

 


Graham Ingleby  |  Google Cloud Consultant  |  +44 1344 203395  |  ging...@ancoris.com
             
Twitter Google+ LinkedIn YouTube Ancoris 

Subscribe to our blog and receive our latest articles straight to your inbox

Ancoris receives Computing Cloud Excellence Award

Powered by Ancoris Signatures

On 11 January 2018 at 12:56, Jay Lee <jay...@gmail.com> wrote:
Error indicates your Json format may be invalid. No need to create a new project or service account, there's an option in the console to download a new key, get it in Json format. I suggest revoking the old key at the same time.

Jay

On Thu, Jan 11, 2018, 7:27 AM 'Graham Ingleby' via GAM for G Suite <google-ap...@googlegroups.com> wrote:
Since I upgraded to 4.40 I am getting an error about my oauth2service.json file being an invalid format on some commands

I can run
gam info domain
fine, I deleted the oauthfile and it recreated file

However, when I run 
gam user gra...@gitest.info check serviceaccount
I get the following error
Please run

gam create project
gam user <user> check serviceaccount

to create and configure a service account.

ERROR: The file G:\My Drive\gam-64\oauth2service.json has an invalid format.

I tried copying the oauth2service.json from a gam372 folder I have but still get the same error

The oauth2service.json file looks like this (actual keys replaced with x's):
{
  "private_key_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "private_key": "-----BEGIN PRIVATE KEY-----\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n-----END PRIVATE KEY-----\n",
  "type": "service_account"
}

This is a slightly different order to examples I have seen on here before, does it matter which order the lines are in? (I have seen type as the first line before for example)

Any ideas apart from creating a new project? My project has been in place for years (Oct 2014 according to the console) is there maybe something in there that needs updating?

Thanks
Graham


This message is for the named person's use only. If you receive this message in error, please delete it and notify the sender. Ancoris reserves the right to monitor all e-mail communications through its networks. Ancoris Limited, Registered in England Number: 04830784, Registered address: 5a Frascati Way, Maidenhead, Berkshire SL6 4UY. Trading Address: Lily Hill House, Lily Hill Road, Bracknell, Berkshire RG12 2SJ




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

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


This message is for the named person's use only. If you receive this message in error, please delete it and notify the sender. Ancoris reserves the right to monitor all e-mail communications through its networks. Ancoris Limited, Registered in England Number: 04830784, Registered address: 5a Frascati Way, Maidenhead, Berkshire SL6 4UY. Trading Address: Lily Hill House, Lily Hill Road, Bracknell, Berkshire RG12 2SJ




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