Bug in Ads API? UNAUTHENTICATED Exception started popping up when making call to Google Ads CustomerServiceClient.GetCustomer

720 views
Skip to first unread message

Darshan Pradhan

unread,
May 6, 2019, 3:23:23 PM5/6/19
to AdWords API and Google Ads API Forum
Hi, 

We just noticed we started seeing an error when fetching a customer details from new Google Ads Api. 

Here is the error details. My user has 4 accessible accounts. I think the issue is only when I am getting an account which is not fully activated, which used to work without issue before. We do not pass loginCustomerId for these call as we did not need to. 


2019-05-06T19:13:03.630Z WARN  [Gax-3] com.google.ads.googleads.lib.request.summary: FAILURE REQUEST SUMMARY. Method: google.ads.googleads.v1.services.CustomerService/GetCustomer, Endpoint: googleads.googleapis.com:443, CustomerID: null, RequestID: 8uXJ2oCwff8aC_MLQn1CwA, ResponseCode: UNAUTHENTICATED, Fault: Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project..
2019-05-06 15:13:03.644  INFO 59069 --- [          Gax-3] c.g.ads.googleads.lib.request.detail     : FAILURE REQUEST DETAIL.
Request
-------
MethodName: google.ads.googleads.v1.services.CustomerService/GetCustomer
Headers: {developer-token=REDACTED, x-goog-api-client=gl-java/1.8.0_192 gapic/ gax/1.35.0 grpc/1.16.1}
Body: resource_name: "customers/3011223529"


Response
--------
Headers: Metadata(content-type=application/grpc,request-id=8uXJ2oCwff8aC_MLQn1CwA,date=Mon, 06 May 2019 19:13:03 GMT,alt-svc=quic=":443"; ma=2592000; v="46,44,43,39")
Body: null
Failure message: errors {
  error_code {
    authentication_error: AUTHENTICATION_ERROR
  }
  message: "Authentication of the request failed."
}

Status: Status{code=UNAUTHENTICATED, description=Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project., cause=null}.


Thanks,
Darshan.

googleadsapi...@google.com

unread,
May 7, 2019, 2:26:51 AM5/7/19
to AdWords API and Google Ads API Forum
Hi Darshan,

Thank you for reaching out to us. The AUTHENTICATION_ERROR occurs if the authentication of the request failed or if you are using incorrect credentials when making API calls. Could you confirm if you are using the correct credentials when making API calls? Also, could you please confirm if the issue is persistent? If it is persistent, I would suggest that you follow this guide to regenerate all the credentials (client Id, client secret, refresh token), make sure that the email address you are using has access to your Google Ads account. Should the issue persist after using this new credentials, let me know so I could assist you further.

Regards,
Dave
Google Ads API Team


=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    https://ads-developers.googleblog.com/search/label/google_ads_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Was your question answered? Please rate your experience with us by taking a short survey.
If not -- reply to this email and tell us what else we can do to help.

Take Survey

Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
 
You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to the Google Groups "AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/ed970bc0-2152-422e-b33e-e8dbedccd7bc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Message has been deleted

Darshan Pradhan

unread,
May 7, 2019, 9:39:09 AM5/7/19
to AdWords API and Google Ads API Forum
I retested this morning to make sure the issue is not on my end. So I regenerated a refreshToken and ran the examples available in official java client
  1.  ListAccessibleCustomers (request and response shown below)

2019-05-07 09:16:13,019 INFO  [Gax-3] logging.RequestLogger (RequestLogger.java:157) - SUCCESS REQUEST SUMMARY. Method: google.ads.googleads.v1.services.CustomerService/ListAccessibleCustomers, Endpoint: googleads.googleapis.com:443, CustomerID: null, RequestID: 2_F-uiGFImKQKzTtn72dmw, ResponseCode: OK, Fault: null.
2019-05-07 09:16:13,133 DEBUG [Gax-3] logging.RequestLogger (RequestLogger.java:161) - SUCCESS REQUEST DETAIL.
Request
-------
MethodName: google.ads.googleads.v1.services.CustomerService/ListAccessibleCustomers
Endpoint: googleads.googleapis.com:443
Headers: {developer-token=REDACTED, x-goog-api-client=gl-java/11.0.1 gapic/ gax/1.35.0 grpc/1.16.1}
Body: 
Response
--------
Headers: Metadata(content-disposition=attachment,content-type=application/grpc,request-id=2_F-uiGFImKQKzTtn72dmw,date=Tue, 07 May 2019 13:16:12 GMT,alt-svc=quic=":443"; ma=2592000; v="46,44,43,39")
Body: resource_names: "customers/8730611186"
resource_names: "customers/3011223529"
resource_names: "customers/6991317584"
resource_names: "customers/8356782372"
Failure message: null
Status: Status{code=OK, description=null, cause=null}.
Total results: 4
Customer resource name: customers/8730611186
Customer resource name: customers/3011223529
Customer resource name: customers/6991317584
Customer resource name: customers/8356782372
Process finished with exit code 0
  1. GetCustomer call with all of the accounts above (request and response shown below)
    1. 8730611186 (Success response): 

      2019-05-07 09:21:09,051 INFO  [Gax-3] logging.RequestLogger (RequestLogger.java:157) - SUCCESS REQUEST SUMMARY. Method: google.ads.googleads.v1.services.CustomerService/GetCustomer, Endpoint: googleads.googleapis.com:443, CustomerID: null, RequestID: Bcvc_bUe4xUwdzpRL6goig, ResponseCode: OK, Fault: null.
      2019-05-07 09:21:09,163 DEBUG [Gax-3] logging.RequestLogger (RequestLogger.java:161) - SUCCESS REQUEST DETAIL.
    1. Request
      -------
      MethodName: google.ads.googleads.v1.services.CustomerService/GetCustomer
      Endpoint: googleads.googleapis.com:443
    1. Headers: {developer-token=REDACTED, x-goog-api-client=gl-java/11.0.1 gapic/ gax/1.35.0 grpc/1.16.1}
      Body: resource_name: "customers/8730611186"

      Response
      --------
      Headers: Metadata(content-disposition=attachment,content-type=application/grpc,request-id=Bcvc_bUe4xUwdzpRL6goig,date=Tue, 07 May 2019 13:21:08 GMT,alt-svc=quic=":443"; ma=2592000; v="46,44,43,39")
      Body: resource_name: "customers/8730611186"
      [REDACTED]
      Failure message: null
      Status: Status{code=OK, description=null, cause=null}.
      Customer with ID 8730611186, descriptive name '[REDACTED]', currency code 'USD', timezone '[REDACTED]', tracking URL template '' and auto tagging enabled 'false' was retrieved.
      Class transformation time: 0.031278638s for 7049 classes or 4.43731564760959E-6s per class
       

      Process finished with exit code 0
    2. 3011223529 (AUTHENTICATION_ERROR)

      2019-05-07 09:24:00,479 WARN  [Gax-3] logging.RequestLogger (RequestLogger.java:159) - FAILURE REQUEST SUMMARY. Method: google.ads.googleads.v1.services.CustomerService/GetCustomer, Endpoint: googleads.googleapis.com:443, CustomerID: null, RequestID: oad0CZRp0VSIRyF22WVEWw, ResponseCode: UNAUTHENTICATED, Fault: Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project..
      2019-05-07 09:24:00,690 INFO  [Gax-3] logging.RequestLogger (RequestLogger.java:157) - FAILURE REQUEST DETAIL.

    1. Request
      -------
      MethodName: google.ads.googleads.v1.services.CustomerService/GetCustomer
      Endpoint: googleads.googleapis.com:443
    1. Headers: {developer-token=REDACTED, x-goog-api-client=gl-java/11.0.1 gapic/ gax/1.35.0 grpc/1.16.1}

    1. Body: resource_name: "customers/3011223529"

      Response
      --------
    1. Headers: Metadata(content-type=application/grpc,request-id=oad0CZRp0VSIRyF22WVEWw,date=Tue, 07 May 2019 13:24:00 GMT,alt-svc=quic=":443"; ma=2592000; v="46,44,43,39")

    1. Body: null
      Failure message: errors {
        error_code {
          authentication_error: AUTHENTICATION_ERROR
        }
        message: "Authentication of the request failed."
      }
      Status: Status{code=UNAUTHENTICATED, description=Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project., cause=null}.
    1. Request ID oad0CZRp0VSIRyF22WVEWw failed due to GoogleAdsException. Underlying errors:
        Error 0: error_code {

    1.   authentication_error: AUTHENTICATION_ERROR
      }
      message: "Authentication of the request failed."
    1. 6991317584 (AUTHENTICATION_ERROR)

      2019-05-07 09:24:23,596 WARN  [Gax-3] logging.RequestLogger (RequestLogger.java:159) - FAILURE REQUEST SUMMARY. Method: google.ads.googleads.v1.services.CustomerService/GetCustomer, Endpoint: googleads.googleapis.com:443, CustomerID: null, RequestID: kZPKIuVYZywxIJpp-wIVkA, ResponseCode: UNAUTHENTICATED, Fault: Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project..
      2019-05-07 09:24:23,766 INFO  [Gax-3] logging.RequestLogger (RequestLogger.java:157) - FAILURE REQUEST DETAIL.
    1. Request
      -------
      MethodName: google.ads.googleads.v1.services.CustomerService/GetCustomer
      Endpoint: googleads.googleapis.com:443
    1. Headers: {developer-token=REDACTED, x-goog-api-client=gl-java/11.0.1 gapic/ gax/1.35.0 grpc/1.16.1}
      Body: resource_name: "customers/6991317584"
      Response
      --------
      Headers: Metadata(content-type=application/grpc,request-id=kZPKIuVYZywxIJpp-wIVkA,date=Tue, 07 May 2019 13:24:23 GMT,alt-svc=quic=":443"; ma=2592000; v="46,44,43,39")
    1. Body: null
      Failure message: errors {
        error_code {
          authentication_error: AUTHENTICATION_ERROR
        }
        message: "Authentication of the request failed."
      }
      Status: Status{code=UNAUTHENTICATED, description=Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project., cause=null}.
    1. Request ID kZPKIuVYZywxIJpp-wIVkA failed due to GoogleAdsException. Underlying errors:
        Error 0: error_code {
    1.   authentication_error: AUTHENTICATION_ERROR
      }
      message: "Authentication of the request failed."
    1.  

    2. 8356782372 (AUTHENTICATION_ERROR)


2019-05-07 09:24:47,621 WARN  [Gax-3] logging.RequestLogger (RequestLogger.java:159) - FAILURE REQUEST SUMMARY. Method: google.ads.googleads.v1.services.CustomerService/GetCustomer, Endpoint: googleads.googleapis.com:443, CustomerID: null, RequestID: i-1eZcEJNX1YYY9V1ho3fw, ResponseCode: UNAUTHENTICATED, Fault: Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project..
2019-05-07 09:24:47,809 INFO  [Gax-3] logging.RequestLogger (RequestLogger.java:157) - FAILURE REQUEST DETAIL.
Request
-------
MethodName: google.ads.googleads.v1.services.CustomerService/GetCustomer
Endpoint: googleads.googleapis.com:443
Headers: {developer-token=REDACTED, x-goog-api-client=gl-java/11.0.1 gapic/ gax/1.35.0 grpc/1.16.1}
Body: resource_name: "customers/8356782372"

Response
--------
Headers: Metadata(content-type=application/grpc,request-id=i-1eZcEJNX1YYY9V1ho3fw,date=Tue, 07 May 2019 13:24:47 GMT,alt-svc=quic=":443"; ma=2592000; v="46,44,43,39")
Body: null
Failure message: errors {
  error_code {
    authentication_error: AUTHENTICATION_ERROR
  }
  message: "Authentication of the request failed."
}
Status: Status{code=UNAUTHENTICATED, description=Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project., cause=null}.
Request ID i-1eZcEJNX1YYY9V1ho3fw failed due to GoogleAdsException. Underlying errors:
  Error 0: error_code {
  authentication_error: AUTHENTICATION_ERROR
}
message: "Authentication of the request failed."

Process finished with exit code 0




All of this call were working last i check may be a few weeks back. Looks like something broke. Please have somebody from the Ads Api review the issue. 

Thanks,
Darshan.

Darshan Pradhan

unread,
May 9, 2019, 10:52:46 AM5/9/19
to AdWords API and Google Ads API Forum
Any update on this issue?

googleadsapi...@google.com

unread,
May 10, 2019, 1:16:42 AM5/10/19
to AdWords API and Google Ads API Forum
Hi Darshan,

Upon checking with the team, the accounts that you are trying to access are either cancelled or in draft. You need to finish setting the accounts up in order for these accounts to be accessible via the API. Feel free to write back if you are finished setting up the accounts and are still not accessible via the API.

I hope this will help.

Regards,
Dave
Google Ads API Team


=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    https://ads-developers.googleblog.com/search/label/google_ads_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Was your question answered? Please rate your experience with us by taking a short survey.
If not -- reply to this email and tell us what else we can do to help.

Take Survey

Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/

Darshan Pradhan

unread,
May 10, 2019, 4:51:36 PM5/10/19
to AdWords API and Google Ads API Forum
Hi,

These accounts are accessible via the api, partially though, since they are returned from the ListAccessibleCustomers call. They should be all or nothing i.e. they should not be accessible from ListAccessibleCustomers call as well. Also before this issue started GetCustomer was able to pull these accounts info. Our application functionality is currently broke because of this issue that was introduced. Please request Ads Team to provide a full resolution.

Thanks,
Darshan.

googleadsapi...@google.com

unread,
May 14, 2019, 1:28:09 AM5/14/19
to AdWords API and Google Ads API Forum
Hi Darshan,

I am a colleague of Dave, allow me to provide support for your concern. I can see that the account you are trying to access (3011223529) is a draft account (this means that account set up is not finished). That said, kindly finish setting up this account so you could continue making API calls using this account.

If you have any other accounts that encounter the same error, kindly provide them so I can further investigate.

Regards,
Dannison
Google Ads API Team


=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    https://ads-developers.googleblog.com/search/label/google_ads_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Was your question answered? Please rate your experience with us by taking a short survey.
If not -- reply to this email and tell us what else we can do to help.

Take Survey

Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/

googleadsapi...@google.com

unread,
May 14, 2019, 1:29:12 AM5/14/19
to AdWords API and Google Ads API Forum
Hi Darshan,

Kindly use the reply privately to author option when providing the clientCustomerIds.

Regards,
Dannison
Google Ads API Team


=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    https://ads-developers.googleblog.com/search/label/google_ads_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Was your question answered? Please rate your experience with us by taking a short survey.
If not -- reply to this email and tell us what else we can do to help.

Take Survey

Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/

Darshan Pradhan

unread,
May 14, 2019, 10:11:52 AM5/14/19
to AdWords API and Google Ads API Forum
Hi Ads API Support,

This is very frustrating. It has been a long time since I opened this support request and it is unfortunate that the Support Team is not understanding the issue. I understand that the accounts that are erroring on getCustomer call are not completely setup but that is not the issue. Please try and understand the main issue here and please do not respond with the same comment about the account not being setup properly.

For the readers convenience I will summarize and reiterate the issue in this entry.

 ListAccessibleCustomers only returns the resource name of the accounts and does not provide the status of an account. So programmatically I cannot tell if I am ok to make the follow up getCustomer call. But the main problem is  ListAccessibleCustomers should not return a partially setup account or if it did the customerServiceClient.getCustomer call should not fail when trying to retrieve a partially setup customer account. 

The whole reason behind this call is because listAccessibleCustomers call only return resourcenames of the account and I need name of the account, so we make follow up call to get the name of the accounts.

Also, I repeat, the customerServiceClient.getCustomer call were working for partially setup account before and it should not be failing with code=UNAUTHENTICATED since my user has access to that account which i can see in my google Ads UI.

Please have these bounce off of the engineering team for a possible fix or a proper resolution.

Thanks,
Darshan.

cv

unread,
May 15, 2019, 3:30:09 AM5/15/19
to AdWords API and Google Ads API Forum
Hi,

Upvote for this issue.

Exactly what I was also looking at it on this forum question.
How automated process can know that the account is under Draft or cancelled or some other issue until we have simple procedure.
Atleast we can have information while getCtustomer service call as ListAccessibleAccounts might have MCC which has valid accounts with erroneous accounts.

Thanks,

googleadsapi...@google.com

unread,
May 15, 2019, 4:33:01 AM5/15/19
to dar...@companionlabs.com, AdWords API and Google Ads API Forum
Hello Darshan,

Let me sync with the engineering team.
Sorry for this back-and-forth.

Best,
Thanet, Google Ads API Team

=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    https://ads-developers.googleblog.com/search/label/google_ads_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Darshan Pradhan

unread,
May 15, 2019, 3:07:58 PM5/15/19
to googleadsapi...@google.com, AdWords API and Google Ads API Forum, Michael Martina
Thanks Thanet!

Please keep us posted.

Thanks,
Darshan Pradhan
Senior Application Architect
CompanionLabs

Start advertising smarter on Facebook. Sign up for your free 7 day trial at www.companionlabs.com.

googleadsapi...@google.com

unread,
May 16, 2019, 3:41:51 AM5/16/19
to Darshan Pradhan, AdWords API and Google Ads API Forum, Michael Martina
Hi Darshan,

We've filed a request to either not return canceled or drafted accounts OR having a way to determine if a given customer is canceled or drafted.
It'd take a while before any of them to happen. 

So, unfortunately, the only workaround would be a try-catch.
I've heard that this doesn't work well in some client libraries, so I'll let the client library owners check and provide help as much as possible for now.

Cheers,
Thanet, Google Ads API Team
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    https://ads-developers.googleblog.com/search/label/google_ads_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

On 05/16/19 04:07:26 dar...@companionlabs.com wrote:
Thanks Thanet!

Please keep us posted.

Thanks,
Darshan Pradhan
Senior Application Architect
CompanionLabs

Start advertising smarter on Facebook. Sign up for your free 7 day trial at www.companionlabs.com.


Reply all
Reply to author
Forward
0 new messages