Giter Club home page Giter Club logo

google-ads-java's Introduction

Google Ads API Client Library for Java

This project hosts the Java client library for the Google Ads API.

Features

  • Distributed via Maven.
  • Easy management of credentials.
  • Easy creation of Google Ads API service clients.

Requirements

  • Java 1.8+
  • Maven 3.0+

Maven artifacts

<dependency>
  <groupId>com.google.api-ads</groupId>
  <artifactId>google-ads</artifactId>
  <version>33.0.0</version>
</dependency>

Gradle dependency

implementation 'com.google.api-ads:google-ads:33.0.0'

Documentation

Our documentation is available here.

Miscellaneous

Wiki

Issue tracker

API Documentation:

Support forum

Authors

google-ads-java's People

Contributors

anashoommen avatar andrewmburke avatar aohren avatar benrkarl avatar christopherhackett avatar danielfrg avatar dependabot[bot] avatar devchas avatar fiboknacky avatar hamsterready avatar irbg avatar jradcliff avatar katka-h avatar laurachevalier4 avatar marcorosas1991 avatar nwbirnie avatar pierrickvoulet avatar raibaz avatar stevenberger avatar wayneluzw avatar wfansh avatar yangda avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

google-ads-java's Issues

Client hangs on UploadImage

I just wrote an UploadImage example and tried running it against v1. There seems to be a bug with the MediaFile service client where the client hangs and never responds after making the mutate request to upload an image. The request does complete, however, which I can verify by running a query to get all images.

Removed objects are not returned in query

Hi! We are trying to migrate to the new Google Ads API. Our use case is that we keep a local sync of the objects. When we query the change_status resource the REMOVED resources (for example: ad_group_criterion) are returned with the status 'REMOVED'.
The query is:

SELECT change_status.ad_group_criterion,
       change_status.resource_type, 
       change_status.last_change_date_time 
  FROM change_status
 WHERE change_status.last_change_date_time >= '2019-06-01 10:00:00' 
   AND change_status.resource_type = 'AD_GROUP_CRITERION' ;

But when we then query filtering by the resource_name that has been deleted (returned by the first query), that same resource is not brought by the API.

"SELECT ad_group_criterion.criterion_id , 
       ad_group_criterion.status, ad_group_criterion.type, 
       ad_group_criterion.webpage.criterion_name, 
  FROM ad_group_criterion 
WHERE ad_group_criterion.resource_name = '<the resource-name obtained> '

How can we get those complete adgroup criterions ?

Example on Smart Shopping ads issue

I am having a problem with the example shown in the smart shopping ads. In the doc it says that "Bidding Strategy must be set directly on the campaign" , but it is not set there.

When I try to run this example I am having this errors:

Request ID tAGY_PKNVPO_HqD2q2ZOgg failed due to GoogleAdsException. Underlying errors:
  Error 0: error_code {
  field_error: REQUIRED
}
message: "The required field was not present in the resource."
trigger {
  string_value: ""
}
location {
  field_path_elements {
    field_name: "operations"
    index {
    }
  }
  field_path_elements {
    field_name: "create"
  }
  field_path_elements {
    field_name: "campaign_bidding_strategy"
  }
}

  Error 1: error_code {
  mutate_error: RESOURCE_NOT_FOUND
}
message: "Resource was not found."
trigger {
  string_value: "131646244"
}
location {
  field_path_elements {
    field_name: "operations"
    index {
    }
  }
  field_path_elements {
    field_name: "create"
  }
  field_path_elements {
    field_name: "shopping_setting"
  }
  field_path_elements {
    field_name: "merchant_id"
  }
}

I tried setting the biddingStrategyType, but it did not work and looking in the source code, it seems to be something different than biddingStrategy.

I am not sure what the other error is btw.

Thanks for the help!

internal_failure for OAuth requests with Google OAuth Java Library

Requested by Google to post this issue on GitHub. Related issue is from https://groups.google.com/d/msg/adwords-api/394qh6XFwh4/SYLue6wbAgAJ

We saw a lot of authentication errors starting from the 2nd of May to the entire weekend (till 6th of May). Errors prompted occurred on OAuth token request while code did not change.
Token error response contains: "internal_failure". There are no more details, these errors pop up while requesting token information from Google. The "internal_failure" error is the whole message received from Google.

  • Problem is no longer visible, but we did see a lot of errors from 2-6 may.
  • Code did not change at our end, previously worked fine.
  • Problem was random. Sometimes it failed with internal_failure errors and sometimes all requests are successful.
  • Multiple accounts across different clients (and with different tokens).
  • We use the official Google OAuth Java Library.
  • We use Google AdWords Java Library to pull reports and push new items or updates to Google. Failures occurred randomly on both.
  • Software is hosted in Amazon AWS, located in Ireland (saw some issues here before).

We're not seeing this error anymore but I would like to have this figured out. Our software relies heavily on Google Ads to push changes and lots of our clients do too.

Thanks,
Igor Schut

Generate more useful object names in examples

Examples such as AddCampaigns.java use System.currentTimeMillis() to generate random names. This is somewhat useful, but is there an approach we could take to make these names human-readable? For example, if we used yyyyMMdd_HH:mm:ss in UTC, then users could easily identify when they ran each example or identify the most recently created objects.

Provide bill of materials

We depend on two versions of grpc-stub (1.16.1 and 1.7.0). Likely fix is to update the version of com.google.api.grpc:grpc-google-common-protos.

Dependency tree output:

[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ google-ads ---
<snip>
[INFO] +- com.google.api:gax-grpc:jar:1.35.0:compile
[INFO] |  +- (com.google.api:gax:jar:1.35.0:compile - omitted for duplicate)
[INFO] |  +- io.grpc:grpc-stub:jar:1.16.1:compile
[INFO] |  |  \- (io.grpc:grpc-core:jar:1.16.1:compile - omitted for duplicate)
<snip>
[INFO] +- com.google.api.grpc:grpc-google-common-protos:jar:1.0.0:compile
[INFO] |  +- (io.grpc:grpc-stub:jar:1.7.0:compile - omitted for conflict with 1.16.1)
[INFO] |  +- (com.google.api.grpc:proto-google-common-protos:jar:1.0.0:compile - omitted for conflict with 1.12.0)
[INFO] |  \- (io.grpc:grpc-protobuf:jar:1.7.0:compile - omitted for conflict with 1.16.1)

Mutate Calls Internal Server Error : unexpected EOS on DATA frame

Hi, I am having a problem with the Java client library. I am creating lots of Campaigns, Adgroups, Ads, keywords, etc.

I use the Mutate for every resource. For example :

try (AdGroupAdServiceClient adGroupAdServiceClient = googleAdsClient.getLatestVersion().createAdGroupAdServiceClient()) {
                    MutateAdGroupAdsResponse response =
                            adGroupAdServiceClient.mutateAdGroupAds(Long.toString(customerId), adGroupAdOperations);
                    for (MutateAdGroupAdResult result : response.getResultsList()) {
                        System.out.printf(
                                "Expanded text ad created with resource name: %s%n", result.getResourceName());
                    }
                } catch (GoogleAdsException gae) {
                    int j = 0;
                    for (GoogleAdsError googleAdsError : gae.getGoogleAdsFailure().getErrorsList()) {
                        System.err.printf("  Error %d: %s%n", j++, googleAdsError);
                    }
                }

Before, i used to do this in just one call adding all the operations in the adGroupAdOperations (that could be up to 2k operations), but I started having a problem with an exception in GRPC. "unexpected EOS on DATA frame" . So, I started grouping this requests in about 100 operations per mutate call. Now i have the RESOURCE_TEMPORARILY_EXHAUSTED error. Is this the expected way to operate or is it some kind of bug regarding the GRPC client? If not, how can I know which is the right amount of operations in mutate calls not to fall in the EOS problem and sleep time between calls not to get the Resource Exhausted?

Avoid dependency resolution issues

We have dependencies on some of the most commonly used libraries on the web, this will frequently lead to dependency resolution issues between us and other projects. We should investigate and provide a preemptive solution, perhaps by shading some/all dependencies into our jar.

Unable to Initialize the GoogleAdsClient Object using Google Ads API Client Library v1.0

While using the Google Ads API v1.0 with the client library v1.0, the following GoogleAdsClient object is being created :
image

As you can notice in this debug screen, The value for “googleAdsAllVersions” is being initialized to null. All the other fields including credentials & loginCustomerId seems to be initialized properly. This results in the call failing with the following error.
Stacktrace :

Caused by: java.lang.NullPointerException: null
	at com.sun.proxy.$Proxy124.hashCode(Unknown Source)
	at com.google.ads.googleads.lib.AutoValue_GoogleAdsClient.hashCode(AutoValue_GoogleAdsClient.java:98)
	at jp.co.rakuten.adplats.sem.mediasync.config.GoogleAdsConfiguration.hashCode(GoogleAdsConfiguration.java:7)
	at java.util.AbstractList.hashCode(AbstractList.java:541)
	at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:936)
	at java.util.concurrent.ConcurrentHashMap.containsKey(ConcurrentHashMap.java:964)

Code :

GoogleAdsClient
    .newBuilder().fromPropertiesFile(new ClassPathResource(fileName).getFile()).build();

Ads Properties :

# Configuration for Google Ads API
api.googleads.refreshToken=<REFRESH_TOKEN>
api.googleads.clientId=<CLIENT_ID>
api.googleads.developerToken=<DEVELOPER_TOKEN>
api.googleads.clientSecret=<CLIENT_SECRET>
api.googleads.loginCustomerId=<LOGIN_CUSTOMER_ID>

Maven Dependency :

<dependency>
  <groupId>com.google.api-ads</groupId>
  <artifactId>google-ads</artifactId>
  <version>1.0.0</version>
</dependency>

It seems like we are missing some new configuration to generate the “googleAdsAllVersions” object. Please confirm and let us know if there are any fixes for such an issue. Also, let us know if you have any suggestion on improving this implementation.

nresolved compilation problems

When I run GetAccountInformation, I am prompted with the following error:

`Exception in thread "main" java.lang.Error: Unresolved compilation problems: 
AutoValue_GoogleAdsClient cannot be resolved to a type
AutoValue_GoogleAdsClient cannot be resolved to a type
The method setInterceptorProvider(GrpcInterceptorProvider) in the type InstantiatingGrpcChannelProvider.Builder is not applicable for the arguments (() -> {})
The method of(E) in the type ImmutableList is not applicable for the arguments (LoggingInterceptor)

at com.google.ads.googleads.lib.GoogleAdsClient.newBuilder(GoogleAdsClient.java:69)
at com.google.ads.googleads.examples.accountmanagement.GetAccountInformation.main(GetAccountInformation.java:52)

`
Cannot find AutoValue_GoogleAdsClient file,Is there any code not submitted?
image

Inconsistency between Ads documentation for billingSetup and ResourceNames.paymentsAccount() method

I'm trying to use the ResourceNames.paymentsAccounts() method to generate the payments accounts resource name for a billing setup create request.

The method requires the customer id, payments profile id, and payments account id. However, the billing setup create request documentation states that if the payments account id is sent, the payments account info (which contains the payments profile id) should NOT be sent. The documentation also state that the billingSetups payments_account resource name is customers/{customer_id}/paymentsAccounts/{payments_account_id} and NOT customers/{customer_id}/paymentsAccounts/{payments_profile_id}~{payments_account_id}.
The required parameters for the ResourceNames.paymentsAccounts() method seem to conflict with the documentation.

Which one is correct?

COA Display Url - Optional in UI and Required in api request

Call Only Ad setting in UI - display url field is optional
image

and if empty in request - we get an error from engine: A required field was not specified or is an empty string., at mutate_operations[0].ad_group_ad_operation.create.ad.display_url

ErrorUtil should support MutateGoogleAdsResponse

The method getGoogleAdsErrors in class ErrorUtils should support also MutateGoogleAdsResponse .
current version refers to a fieldName:"operations" and not "mutate_operations" and should refer to both

code pointer: google-ads-1.1.0-shaded-for-ks.jar!/com/google/ads/googleads/v1/utils/ErrorUtils.class:48

Thanks,
Sara

Missing Remarketing examples

Hi, i would like to create listusers (audience) for my campaigns via API but in the remarketing folder are missing the examples to do that.
Here the examples available for AdWords API:

AddAudience.java
AddConversionTrackers.java
AddCrmBasedUserList.java
AddRuleBasedUserLists.java
UploadConversionAdjustment.java
UploadOfflineCallConversions.java
UploadOfflineConversions.java
UploadOfflineData.java

Is there a plan for the releasing of those examples also for the Google Ads API?
In particular i would like to create listusers bases on url rules for the remarketing. Thank you

Caused by: io.netty.handler.codec.http2.Http2Exception$HeaderListSizeException: Header size exceeded max allowed size (8192)

Getting an internal error related to grpc http2 headers exceeding the max allowed size (8192) when I make a mutateExpandedTextAdsRequest call

Headers: Metadata(content-type=application/grpc,request-id=E7Jw_ONuP9ZfNHK9tpyTgw,date=Fri, 07 Jun 2019 18:01:31 GMT,alt-svc=quic=":443"; ma=2592000; v="46,44,43,39") Body: null Failure message: null Status: Status{code=INTERNAL, description=http2 exception, cause=io.netty.handler.codec.http2.Http2Exception$HeaderListSizeException: Header size exceeded max allowed size (8192) at io.netty.handler.codec.http2.Http2Exception.headerListSizeError(Http2Exception.java:171) at io.netty.handler.codec.http2.Http2CodecUtil.headerListSizeExceeded(Http2CodecUtil.java:228) at io.netty.handler.codec.http2.HpackDecoder$Http2HeadersSink.finish(HpackDecoder.java:541) at io.netty.handler.codec.http2.HpackDecoder.decode(HpackDecoder.java:128) at io.netty.handler.codec.http2.DefaultHttp2HeadersDecoder.decodeHeaders(DefaultHttp2HeadersDecoder.java:127) at io.netty.handler.codec.http2.DefaultHttp2FrameReader$HeadersBlockBuilder.headers(DefaultHttp2FrameReader.java:745) at io.netty.handler.codec.http2.DefaultHttp2FrameReader$2.processFragment(DefaultHttp2FrameReader.java:483) at io.netty.handler.codec.http2.DefaultHttp2FrameReader.readHeadersFrame(DefaultHttp2FrameReader.java:491) at io.netty.handler.codec.http2.DefaultHttp2FrameReader.processPayloadState(DefaultHttp2FrameReader.java:254) at io.netty.handler.codec.http2.DefaultHttp2FrameReader.readFrame(DefaultHttp2FrameReader.java:160) at io.netty.handler.codec.http2.Http2InboundFrameLogger.readFrame(Http2InboundFrameLogger.java:41) at io.netty.handler.codec.http2.DefaultHttp2ConnectionDecoder.decodeFrame(DefaultHttp2ConnectionDecoder.java:118) at io.netty.handler.codec.http2.Http2ConnectionHandler$FrameDecoder.decode(Http2ConnectionHandler.java:390) at io.netty.handler.codec.http2.Http2ConnectionHandler.decode(Http2ConnectionHandler.java:450) at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:502) at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:441) at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:278) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) at io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1432) at io.netty.handler.ssl.SslHandler.decodeJdkCompatible(SslHandler.java:1199) at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1243) at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:502) at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:441) at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:278) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1434) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:965) at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163) at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:648) at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:583) at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:500) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:462) at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:897) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) at java.lang.Thread.run(Thread.java:745) }.

How to set up partial http proxy

Hello,the following line of code

// Send the keyword ideas request.
GenerateKeywordIdeaResponse response =
                    keywordPlanServiceClient.generateKeywordIdeas(requestBuilder.build());

It will time out if I don't set the proxy.

System.setProperty("https.proxyHost", "proxyHost");
System.setProperty("https.proxyPort", "proxyPort");

But i don't want to use System.setProperty() in my project. What should I do?
Thanks.

Update Ad

I try to update an ad using AdService/MutateAds
if the ad type is EXTENDED_TEXT_AD the service works correctly.
if the ad type is GMAIL_AD the service fails.
By the following the request and the response:

Request

MethodName: google.ads.googleads.v2.services.AdService/MutateAds
Endpoint: googleads.googleapis.com:443
Headers: {developer-token=REDACTED, login-customer-id=XXXXXX, x-goog-api-client=gl-java/1.8.0_201 gapic/ gax/ grpc/}
Body: customer_id: "XXXXXX"
operations {
update {
final_urls {
value: "XXXXXX"
}
type: GMAIL_AD
tracking_url_template {
value: "XXXXXX"
}
resource_name: "customers/XXXXXX/ads/XXXXXX"
}
update_mask {
paths: "resource_name"
paths: "final_urls"
paths: "tracking_url_template"
paths: "type"
}
}

Response

Headers: Metadata(content-type=application/grpc,request-id=r1ZL8RaOBYJpVdl-3dvpEA,date=Thu, 08 Aug 2019 14:54:14 GMT,alt-svc=quic=":443"; ma=2592000; v="46,43,39")
Body: null
Failure message: errors {
error_code {
ad_error: INVALID_AD_TYPE
}
message: "Invalid Ad type. A specific type of Ad is required."
trigger {
string_value: ""
}
location {
field_path_elements {
field_name: "operations"
index {
}
}
field_path_elements {
field_name: "update"
}
field_path_elements {
field_name: "resource_name"
}
}
}

Status Runtime Exception: Internal error encountered

Hi!
I have a problem when try get a list of MerchantCenterLinks.

My code:

        try (MerchantCenterLinkServiceClient service = googleAdsClient.getLatestVersion().createMerchantCenterLinkServiceClient()) {
            ListMerchantCenterLinksResponse response = service.listMerchantCenterLinks(Long.toString(customerId));
            List<MerchantCenterLink> list = response.getMerchantCenterLinksList();
            for (MerchantCenterLink link : list) {
                MerchantCenterLink newLink = link.toBuilder().setStatus(MerchantCenterLinkStatusEnum.MerchantCenterLinkStatus.ENABLED).build();
                MerchantCenterLinkOperation operation = MerchantCenterLinkOperation.newBuilder().setUpdate(newLink).build();
                service.mutateMerchantCenterLink(Long.toString(customerId), operation);

                LOGGER.info("Updated Merchant Center Link.");
            }
        } catch (GoogleAdsException gae) {
            LOGGER.error("Request ID {} failed due to GoogleAdsException. Underlying errors:",
                    gae.getRequestId());
            int j = 0;
            for (GoogleAdsError googleAdsError : gae.getGoogleAdsFailure().getErrorsList()) {
                LOGGER.error("Error {}: {}", j++, googleAdsError);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }

I get an error when try get the ListMerchantCenterLinksResponse with the following trace after running the code above:

Request
-------
MethodName: google.ads.googleads.v1.services.MerchantCenterLinkService/ListMerchantCenterLinks
Endpoint: googleads.googleapis.com:443
Headers: {developer-token=REDACTED, login-customer-id=1503892305, x-goog-api-client=gl-java/1.8.0_211 gapic/ gax/1.35.0 grpc/1.16.1}
Body: customer_id: "5126903092"


Response
--------
Headers: Metadata(content-type=application/grpc,request-id=ZZWK92IZ7lwak8vkxHlHGQ,date=Wed, 15 May 2019 19:55:34 GMT,alt-svc=quic=":443"; ma=2592000; v="46,44,43,39")
Body: null
Status: Status{code=INTERNAL, description=Internal error encountered., cause=null}.
com.google.api.gax.rpc.InternalException: io.grpc.StatusRuntimeException: INTERNAL: Internal error encountered.
	at com.google.api.gax.rpc.ApiExceptionFactory.createException(ApiExceptionFactory.java:67)
	at com.google.api.gax.grpc.GrpcApiExceptionFactory.create(GrpcApiExceptionFactory.java:72)
	at com.google.api.gax.grpc.GrpcApiExceptionFactory.create(GrpcApiExceptionFactory.java:60)
	at com.google.api.gax.grpc.GrpcExceptionCallable$ExceptionTransformingFuture.onFailure(GrpcExceptionCallable.java:97)
	at com.google.api.core.ApiFutures$1.onFailure(ApiFutures.java:68)
	at com.google.common.util.concurrent.Futures$CallbackListener.run(Futures.java:1052)
	at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:398)
	at com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:1030)
	at com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:871)
	at com.google.common.util.concurrent.AbstractFuture.setException(AbstractFuture.java:716)
	at io.grpc.stub.ClientCalls$GrpcFuture.setException(ClientCalls.java:507)
	at io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:482)
	at io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39)
	at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23)
	at io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40)
	at com.google.ads.googleads.lib.logging.LoggingInterceptor$1$1.onClose(LoggingInterceptor.java:111)
	at io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39)
	at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23)
	at io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40)
	at io.grpc.internal.CensusStatsModule$StatsClientInterceptor$1$1.onClose(CensusStatsModule.java:678)
	at io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39)
	at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23)
	at io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40)
	at io.grpc.internal.CensusTracingModule$TracingClientInterceptor$1$1.onClose(CensusTracingModule.java:397)
	at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:459)
	at io.grpc.internal.ClientCallImpl.access$300(ClientCallImpl.java:63)
	at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:546)
	at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$600(ClientCallImpl.java:467)
	at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:584)
	at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
	at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266)
	at java.util.concurrent.FutureTask.run(FutureTask.java)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
	Suppressed: com.google.api.gax.rpc.AsyncTaskException: Asynchronous task failed
		at com.google.api.gax.rpc.ApiExceptions.callAndTranslateApiException(ApiExceptions.java:57)
		at com.google.api.gax.rpc.UnaryCallable.call(UnaryCallable.java:112)
		at com.google.ads.googleads.v1.services.MerchantCenterLinkServiceClient.listMerchantCenterLinks(MerchantCenterLinkServiceClient.java:233)
		at com.google.ads.googleads.v1.services.MerchantCenterLinkServiceClient.listMerchantCenterLinks(MerchantCenterLinkServiceClient.java:209)
		at com.adtomiclabs.admin.backend.services.google.GoogleSetupServiceImpl.testInvitation(GoogleSetupServiceImpl.java:151)
		at com.adtomiclabs.admin.backend.services.google.GoogleSetupServiceImpl.setupGoogleAccount(GoogleSetupServiceImpl.java:93)
		at com.adtomiclabs.admin.backend.services.google.GoogleSetupServiceImpl$$FastClassBySpringCGLIB$$944d1abb.invoke(<generated>)
		at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
		at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:738)
		at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
		at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
		at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282)
		at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
		at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
		at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:673)
		at com.adtomiclabs.admin.backend.services.google.GoogleSetupServiceImpl$$EnhancerBySpringCGLIB$$b84b4238.setupGoogleAccount(<generated>)
		at com.adtomiclabs.admin.backend.web.controller.rest_endpoints.SetupEndpoint.lambda$setupGoogleAccount$0(SetupEndpoint.java:126)
		at java.util.Optional.map(Optional.java:215)
		at com.adtomiclabs.admin.backend.web.controller.rest_endpoints.SetupEndpoint.setupGoogleAccount(SetupEndpoint.java:124)
		at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
		at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
		at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
		at java.lang.reflect.Method.invoke(Method.java:498)
		at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
		at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144)
		at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161)
		at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:160)
		at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99)
		at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)
		at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347)
		at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)
		at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326)
		at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
		at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
		at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
		at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
		at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
		at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
		at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305)
		at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)
		at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473)
		at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427)
		at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388)
		at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341)
		at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228)
		at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
		at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
		at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
		at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
		at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
		at com.adtomiclabs.commons.authentication.TokenAuthenticationFilter.successfulAuthentication(TokenAuthenticationFilter.java:105)
		at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:240)
		at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
		at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
		at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)
		at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
		at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
		at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
		at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:317)
		at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:114)
		at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
		at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137)
		at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
		at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111)
		at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
		at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:170)
		at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
		at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63)
		at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
		at com.adtomiclabs.commons.authentication.TokenAuthenticationFilter.successfulAuthentication(TokenAuthenticationFilter.java:105)
		at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:240)
		at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
		at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:64)
		at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
		at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
		at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105)
		at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
		at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56)
		at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
		at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
		at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:214)
		at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:177)
		at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:347)
		at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:263)
		at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
		at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
		at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
		at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
		at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
		at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
		at com.adtomiclabs.commons.config.UncaughtExceptionHandlerFilter.doFilter(UncaughtExceptionHandlerFilter.java:57)
		at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
		at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
		at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
		at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
		at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478)
		at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
		at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
		at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
		at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
		at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)
		at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
		at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
		at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)
		at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
		at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
		at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
		at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
		... 1 more
Caused by: io.grpc.StatusRuntimeException: INTERNAL: Internal error encountered.
	at io.grpc.Status.asRuntimeException(Status.java:526)
	... 28 more

java.lang.UnsatisfiedLinkError: no io_grpc_netty_shaded_netty_tcnative_osx_x86_64 in java.library.path

when I run GetAdGroups I got information as follow.
The problem happens at the line :
try (GoogleAdsServiceClient googleAdsServiceClient =
googleAdsClient.getLatestVersion().createGoogleAdsServiceClient()) {

debug infomation:
16:19:08.271 [main] DEBUG io.grpc.netty.shaded.io.netty.util.internal.NativeLibraryLoader - Unable to load the library 'io_grpc_netty_shaded_netty_tcnative_osx_x86_64', trying other loading mechanism.
java.lang.UnsatisfiedLinkError: no io_grpc_netty_shaded_netty_tcnative_osx_x86_64 in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
at io.grpc.netty.shaded.io.netty.util.internal.NativeLibraryUtil.loadLibrary(NativeLibraryUtil.java:38)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at io.grpc.netty.shaded.io.netty.util.internal.NativeLibraryLoader$1.run(NativeLibraryLoader.java:336)
at java.security.AccessController.doPrivileged(Native Method)
at io.grpc.netty.shaded.io.netty.util.internal.NativeLibraryLoader.loadLibraryByHelper(NativeLibraryLoader.java:328)
at io.grpc.netty.shaded.io.netty.util.internal.NativeLibraryLoader.loadLibrary(NativeLibraryLoader.java:306)
at io.grpc.netty.shaded.io.netty.util.internal.NativeLibraryLoader.load(NativeLibraryLoader.java:136)
at io.grpc.netty.shaded.io.netty.util.internal.NativeLibraryLoader.loadFirstAvailable(NativeLibraryLoader.java:96)
at io.grpc.netty.shaded.io.netty.handler.ssl.OpenSsl.loadTcNative(OpenSsl.java:440)
at io.grpc.netty.shaded.io.netty.handler.ssl.OpenSsl.(OpenSsl.java:97)
at io.grpc.netty.shaded.io.grpc.netty.GrpcSslContexts.defaultSslProvider(GrpcSslContexts.java:244)
at io.grpc.netty.shaded.io.grpc.netty.GrpcSslContexts.configure(GrpcSslContexts.java:171)
at io.grpc.netty.shaded.io.grpc.netty.GrpcSslContexts.forClient(GrpcSslContexts.java:120)
at io.grpc.netty.shaded.io.grpc.netty.NettyChannelBuilder.buildTransportFactory(NettyChannelBuilder.java:377)
at io.grpc.internal.AbstractManagedChannelImplBuilder.build(AbstractManagedChannelImplBuilder.java:406)
at com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.createSingleChannel(InstantiatingGrpcChannelProvider.java:246)
at com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.createChannel(InstantiatingGrpcChannelProvider.java:160)
at com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.getTransportChannel(InstantiatingGrpcChannelProvider.java:152)
at com.google.api.gax.rpc.ClientContext.create(ClientContext.java:149)
at com.google.ads.googleads.v1.services.stub.GrpcGoogleAdsServiceStub.create(GrpcGoogleAdsServiceStub.java:78)
at com.google.ads.googleads.v1.services.stub.GoogleAdsServiceStubSettings.createStub(GoogleAdsServiceStubSettings.java:110)
at com.google.ads.googleads.v1.services.GoogleAdsServiceClient.(GoogleAdsServiceClient.java:142)
at com.google.ads.googleads.v1.services.GoogleAdsServiceClient.create(GoogleAdsServiceClient.java:123)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.google.ads.googleads.lib.catalog.GoogleAdsVersionFactory$VersionDescriptorInvocationHandler.createServiceClient(GoogleAdsVersionFactory.java:106)
at com.google.ads.googleads.lib.catalog.GoogleAdsVersionFactory$VersionDescriptorInvocationHandler.handleInvocation(GoogleAdsVersionFactory.java:100)

Correlate a request List with a response List

Hello,

I am using AdGroupAdServiceClient.mutateAdGroupAds to create List of Ads, let's say with attributes (h1, h2, h3, d1, d2).
As a response I get List[MutateAdGroupAdResult] where each MutateAdGroupAdResult has only resource_name.

I want to persist the result in some my datastore as List[(resource_name, h1, h2, h3, d1, d2)]
Is it safe to correlate requests and responses lists by order?
Is it possible to make Google Ads API to return the whole mutated operation instead of just resource_name?
Is it any other technique to safely achieve my goal?

Enable protected branch for master

Currently the maven release script pushes at least 2 commits directly to master. It needs to not do this, because that prevents users with write access from making releases if branch protection is on.

Once the maven release script is updated we should re-enable branch protection.

Support setting the GoogleAdsClient config file location via a system property

By default, GoogleAdsClient.fromPropertiesFile() will look in the user's home directory for the ads.properties file. The library should allow a user to set a system property that modifies the default location so users who don't want to put the file in their home directory can still use the convenient, no-arg fromPropertiesFile() method.

FieldMasks.allSetFieldsOf() doesnt work correct for subpaths

I have a problem with all FieldMasks.allSetFieldsOf() for objects with sub objects for example AdGroupCriterion

KeywordInfo keywordInfo = KeywordInfo.newBuilder().setText(StringValue.of("test")).build();
AdGroupCriterion criterion = AdGroupCriterion.newBuilder().setResourceName(ResourceNames.adGroupCriterion(Long.parseLong(order.getGoogleCustomerId()), adGroup.getGoogleId(), keyword.getGoogleId()))
	.setStatus(AdGroupCriterionStatus.ENABLED)
	.setKeyword(keywordInfo).build();
System.out.println(FieldMasks.allSetFieldsOf(criterion));

Response:

paths: "resource_name"
paths: "status"
paths: "keyword.text"
paths: "keyword.match_type"

Why match_type I didn't set the keyword.match_type so my update for the keyword doesnt work because I can not update the match_type so I have do build the FieldMask by myself.

FieldMasks for repeated sub-messages constructing incorrectly

FieldMasks for repeated sub-messages are currently being constructed incorrectly. Rather than searching through the repeated sub-message to see which fields have been updated, the FieldMask is just adding the entire message to the updateMask.

I am working on a fix for this.

Migrating to Ads API, All requests are stuck at Java call GoogleAdsServiceClient.search(SearchGoogleAdsRequest request)

Hey,

I have been migrating my code from Adwords to Google Ads API. I have been attempting to run GetCampaigns example or any other example provided from the repo. It is stuck calling GoogleAdsServiceClient.search(SearchGoogleAdsRequest request) with no errors or results and will be stuck until I abort it manually. console.developers.google.com statistics show no errors as well.

I tried various different configuration permutations.
I added oAuth tokens I used for Adwords and added loginCustomerId as the manager account. And then when I run getCampaigns using a clientCustomerAccount under that MCC, it is stuck

am I missing something obvious?

best regards

Bug from version 3.0.1 to 4.0.0

Mutate Campaign Budget

[Gax-1] WARN shaded.com.google.ads.googleads.lib.request.summary - FAILURE REQUEST SUMMARY. Method: google.ads.googleads.v2.services.CampaignBudgetService/MutateCampaignBudgets, Endpoint: googleads.googleapis.com:443, CustomerID: XXXXX, RequestID: null, ResponseCode: INTERNAL, Fault: Panic! This is a bug!.
[Gax-1] INFO shaded.com.google.ads.googleads.lib.request.detail - FAILURE REQUEST DETAIL.
Request
MethodName: google.ads.googleads.v2.services.CampaignBudgetService/MutateCampaignBudgets
Endpoint: googleads.googleapis.com:443
Headers: {developer-token=REDACTED, login-customer-id=XXXXX, x-goog-api-client=gl-java/1.8.0_201 gapic/ gax/ grpc/}
Body: customer_id: "XXXXX"
operations {
create {
name {
value: "Budget #Search XXXX"
}
amount_micros {
value: 5000000
}
delivery_method: STANDARD
}
}

Response

Headers: null
Body: null
Failure message: null
Status: Status{code=INTERNAL, description=Panic! This is a bug!, cause=java.lang.IllegalStateException: Could not find policy 'pick_first'. Make sure its implementation is either registered to LoadBalancerRegistry or included in META-INF/services/io.grpc.LoadBalancerProvider from your jar files.
at io.grpc.internal.AutoConfiguredLoadBalancerFactory$AutoConfiguredLoadBalancer.(AutoConfiguredLoadBalancerFactory.java:98)
at io.grpc.internal.AutoConfiguredLoadBalancerFactory.newLoadBalancer(AutoConfiguredLoadBalancerFactory.java:65)
at io.grpc.internal.ManagedChannelImpl.exitIdleMode(ManagedChannelImpl.java:373)
at io.grpc.internal.ManagedChannelImpl$ChannelTransportProvider$1ExitIdleModeForTransport.run(ManagedChannelImpl.java:467)
at io.grpc.SynchronizationContext.drain(SynchronizationContext.java:88)
at io.grpc.SynchronizationContext.execute(SynchronizationContext.java:120)
at io.grpc.internal.ManagedChannelImpl$ChannelTransportProvider.get(ManagedChannelImpl.java:471)
at io.grpc.internal.ClientCallImpl.startInternal(ClientCallImpl.java:255)
at io.grpc.internal.ClientCallImpl.start(ClientCallImpl.java:188)
at io.grpc.internal.CensusTracingModule$TracingClientInterceptor$1.start(CensusTracingModule.java:394)
at io.grpc.internal.CensusStatsModule$StatsClientInterceptor$1.start(CensusStatsModule.java:695)
at io.grpc.ForwardingClientCall.start(ForwardingClientCall.java:32)
at shaded.com.google.api.gax.grpc.GrpcHeaderInterceptor$1.start(GrpcHeaderInterceptor.java:94)
at io.grpc.ForwardingClientCall.start(ForwardingClientCall.java:32)
at shaded.com.google.ads.googleads.lib.logging.LoggingInterceptor$1.start(LoggingInterceptor.java:78)
at io.grpc.stub.ClientCalls.startCall(ClientCalls.java:310)
at io.grpc.stub.ClientCalls.asyncUnaryRequestCall(ClientCalls.java:282)
at io.grpc.stub.ClientCalls.futureUnaryCall(ClientCalls.java:191)
at shaded.com.google.api.gax.grpc.GrpcDirectCallable.futureCall(GrpcDirectCallable.java:58)
at shaded.com.google.api.gax.grpc.GrpcUnaryRequestParamCallable.futureCall(GrpcUnaryRequestParamCallable.java:65)
at shaded.com.google.api.gax.grpc.GrpcExceptionCallable.futureCall(GrpcExceptionCallable.java:64)
at shaded.com.google.api.gax.rpc.UnaryCallable$1.futureCall(UnaryCallable.java:126)
at shaded.com.google.ads.googleads.lib.ExceptionTransformingCallable.futureCall(ExceptionTransformingCallable.java:51)
at shaded.com.google.api.gax.rpc.UnaryCallable$1.futureCall(UnaryCallable.java:126)
at shaded.com.google.api.gax.rpc.UnaryCallable.futureCall(UnaryCallable.java:87)
at shaded.com.google.api.gax.rpc.UnaryCallable.call(UnaryCallable.java:112)
at shaded.com.google.ads.googleads.v2.services.CampaignBudgetServiceClient.mutateCampaignBudgets(CampaignBudgetServiceClient.java:350)
at shaded.com.google.ads.googleads.v2.services.CampaignBudgetServiceClient.mutateCampaignBudgets(CampaignBudgetServiceClient.java:324)
at com.onetag.frontend.handlers.pagecontent.demand.integration.search.Util.addCampaignBudget(Util.java:111)
at com.onetag.frontend.handlers.pagecontent.demand.integration.search.Util.createCampaign(Util.java:147)
at com.onetag.frontend.handlers.pagecontent.demand.integration.search.GoogleManagement.manageRemoteGoogle(GoogleManagement.java:781)
at com.onetag.frontend.handlers.pagecontent.demand.CampaignCreateHandler.lambda$handle$13(CampaignCreateHandler.java:1492)
at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1626)
at java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1618)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
}.

Channel ManagedChannelImpl was not shutdown properly

Working at the Ads API Workshop in NYC I came across this error using the Java client library.

This error is intermittent. In the code example below, the error occurs on the 2nd search call:

List adGroupRows = googleSearchService.search( adGroupRequest );

Once the error is thrown it seems to not get thrown again. ie. I can call this code once, get the error, and then call it 2 -> n times without getting the error again.

Gradle dependency: implementation "com.google.api-ads:google-ads:0.7.0"

Stacktrace:

2019-03-06 14:52:00,799 INFO summary - SUCCESS REQUEST SUMMARY. Method: google.ads.googleads.v0.services.GoogleAdsService/Search, Endpoint: googleads.googleapis.com:443, CustomerID: 7402014503, RequestID: WvvumPapGMwF2YJSE_oJBw, ResponseCode: OK, Fault: null.

2019-03-06 14:52:05,179 ERROR ManagedChannelOrphanWrapper - ~* Channel ManagedChannelImpl{logId=1, target=googleads.googleapis.com:443} was not shutdown properly!!! *~
Make sure to call shutdown()/shutdownNow() and wait until awaitTermination() returns true.
java.lang.RuntimeException: ManagedChannel allocation site
at io.grpc.internal.ManagedChannelOrphanWrapper$ManagedChannelReference.(ManagedChannelOrphanWrapper.java:103)
at io.grpc.internal.ManagedChannelOrphanWrapper.(ManagedChannelOrphanWrapper.java:53)
at io.grpc.internal.ManagedChannelOrphanWrapper.(ManagedChannelOrphanWrapper.java:44)
at io.grpc.internal.AbstractManagedChannelImplBuilder.build(AbstractManagedChannelImplBuilder.java:411)
at com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.createSingleChannel(InstantiatingGrpcChannelProvider.java:246)
at com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.createChannel(InstantiatingGrpcChannelProvider.java:160)
at com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.getTransportChannel(InstantiatingGrpcChannelProvider.java:152)
at com.google.api.gax.rpc.ClientContext.create(ClientContext.java:149)
at com.google.ads.googleads.v0.services.stub.GrpcGoogleAdsServiceStub.create(GrpcGoogleAdsServiceStub.java:78)
at com.google.ads.googleads.v0.services.stub.GoogleAdsServiceStubSettings.createStub(GoogleAdsServiceStubSettings.java:110)
at com.google.ads.googleads.v0.services.GoogleAdsServiceClient.(GoogleAdsServiceClient.java:141)
at com.google.ads.googleads.v0.services.GoogleAdsServiceClient.create(GoogleAdsServiceClient.java:122)
at com.google.ads.googleads.lib.GrpcServiceDescriptor$GoogleAdsServiceDescriptor.newServiceClient(GrpcServiceDescriptor.java:988)
at com.google.ads.googleads.lib.GrpcServiceDescriptor$GoogleAdsServiceDescriptor.newServiceClient(GrpcServiceDescriptor.java:981)
at com.google.ads.googleads.lib.GoogleAdsClient.getGoogleAdsServiceClient(GoogleAdsClient.java:420)
at inc.fluency.google.service.google.newapi.GoogleSearchService.search(GoogleSearchService.java:23)
at inc.fluency.google.service.google.newapi.TestNewAPI.testGetAllCampaigns(TestNewAPI.java:79)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71)
at sun.reflect.GeneratedMethodAccessor115.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:275)
at javax.management.modelmbean.RequiredModelMBean$4.run(RequiredModelMBean.java:1252)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1246)
at javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:1085)
at org.springframework.jmx.export.SpringModelMBean.invoke(SpringModelMBean.java:90)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
at mx4j.tools.adaptor.http.InvokeOperationCommandProcessor.executeRequest(InvokeOperationCommandProcessor.java:164)
at mx4j.tools.adaptor.http.HttpAdaptor$HttpClient.run(HttpAdaptor.java:980)

2019-03-06 14:52:07,206 INFO summary - SUCCESS REQUEST SUMMARY. Method: google.ads.googleads.v0.services.GoogleAdsService/Search, Endpoint: googleads.googleapis.com:443, CustomerID: 7402014503, RequestID: aKj_a-9aFIYfnr4QdMalng, ResponseCode: OK, Fault: null.

Simplified code:

final String campaignQuery = "select campaign.id, campaign.name from campaign";
final String adGroupQuery = "select campaign.id, campaign.name, ad_group.id, ad_group.name, ad_group.campaign from ad_group";

final SearchGoogleAdsRequest campaignRequest = SearchGoogleAdsRequest.newBuilder()
.setCustomerId( fluentAccount.getReferenceId() )
.setPageSize( PAGE_SIZE )
.setQuery( campaignQuery )
.build();

final SearchGoogleAdsRequest adGroupRequest = SearchGoogleAdsRequest.newBuilder()
.setCustomerId( fluentAccount.getReferenceId() )
.setPageSize( PAGE_SIZE )
.setQuery( adGroupQuery )
.build();

List campaignRows = googleSearchService.search( campaignRequest );
List adGroupRows = googleSearchService.search( adGroupRequest );

public List search( SearchGoogleAdsRequest request ) throws Exception {

    return Lists.newArrayList(
        googleService
            .getGoogleAdsClient()
            .getGoogleAdsServiceClient()
            .search( request )
            .iterateAll() );

}

public GoogleAdsClient getGoogleAdsClient() throws Exception {

    if( googleAdsClient == null ) {
        googleAdsClient = GoogleAdsClient.newBuilder()
            .setCredentials( getUserCredentials() )
            .setDeveloperToken( developerToken )
            .setLoginCustomerId( Long.valueOf( clientCustomerId ) )
            .build();
    }

    return googleAdsClient;
}

private Credentials getUserCredentials() throws Exception {

    /* Prime the clientId / clientSecret / refreshToken / developerToken */
    getAdwordsCredentials();

    return UserCredentials.newBuilder()
        .setClientId( clientId )
        .setClientSecret( clientSecret )
        .setRefreshToken( refreshToken )
        .build();
}

private Credential getAdwordsCredentials() throws Exception {
if ( adWordsCredentials == null ) {

        adWordsCredentials = new OfflineCredentials.Builder()
                .forApi(OfflineCredentials.Api.ADWORDS)
                .withClientSecrets( credentials.getClientId(), credentials.getClientSecret() )
                .withRefreshToken( credentials.getRefreshToken() )
                .build()
                .generateCredential();
    }

    return adWordsCredentials;

}

OutOfMemoryError when trying to run com.google.ads.googleads.examples.basicoperations.GetAdGroups

Got an OOM error when trying to run one of the examples.

I set -Xmx2512m but even though i got the following error

Information:java: The system is out of resources.
Information:java: Consult the following stack trace for details.
Information:java: 	at com.sun.tools.javac.code.Scope.dble(Scope.java:173)
Information:java: 	at com.sun.tools.javac.code.Scope.enter(Scope.java:213)
Information:java: 	at com.sun.tools.javac.code.Scope.enter(Scope.java:202)
Information:java: 	at com.sun.tools.javac.code.Scope$StarImportScope.importAll(Scope.java:553)
Information:java: 	at com.sun.tools.javac.comp.MemberEnter.importAll(MemberEnter.java:165)
Information:java: 	at com.sun.tools.javac.comp.MemberEnter.visitTopLevel(MemberEnter.java:525)
Information:java: 	at com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:518)
Information:java: 	at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:437)
Information:java: 	at com.sun.tools.javac.comp.MemberEnter.complete(MemberEnter.java:1038)
Information:java: 	at com.sun.tools.javac.code.Symbol.complete(Symbol.java:574)
Information:java: 	at com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:1037)
Information:java: 	at com.sun.tools.javac.code.Symbol$ClassSymbol.flags(Symbol.java:973)
Information:java: 	at com.sun.tools.javac.comp.Resolve.isAccessible(Resolve.java:299)
Information:java: 	at com.sun.tools.javac.comp.Resolve.isAccessible(Resolve.java:294)
Information:java: 	at com.sun.tools.javac.comp.Resolve.loadClass(Resolve.java:1908)
Information:java: 	at com.sun.tools.javac.comp.Resolve.findGlobalType(Resolve.java:2007)
Information:java: 	at com.sun.tools.javac.comp.Resolve.findType(Resolve.java:2081)
Information:java: 	at com.sun.tools.javac.comp.Resolve.findIdent(Resolve.java:2110)
Information:java: 	at com.sun.tools.javac.comp.Resolve.resolveIdent(Resolve.java:2384)
Information:java: 	at com.sun.tools.javac.comp.Attr.visitIdent(Attr.java:3170)
Information:java: 	at com.sun.tools.javac.tree.JCTree$JCIdent.accept(JCTree.java:2011)
Information:java: 	at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:576)
Information:java: 	at com.sun.tools.javac.comp.Attr.attribType(Attr.java:638)
Information:java: 	at com.sun.tools.javac.comp.Attr.attribType(Attr.java:631)
Information:java: 	at com.sun.tools.javac.comp.Attr.attribBase(Attr.java:786)
Information:java: 	at com.sun.tools.javac.comp.MemberEnter.complete(MemberEnter.java:1072)
Information:java: Errors occurred while compiling module 'google-ads'
Information:javac 1.8.0_202 was used to compile java sources
Information:2019-05-24 09:05 - Build completed with 1 error and 0 warnings in 11 m 38 s 632 ms
Error:java: OutOfMemoryError: insufficient memory

Determine if additional cleanup is required in GoogleAdsClient

When running examples via mvn exec:java, the following warnings appear during shutdown:

[WARNING] thread Thread[threadDeathWatcher-1-1,1,com.google.ads.googleads.examples.basicoperations.GetCampaigns] was interrupted but is still alive after waiting at least 14995msecs
[WARNING] thread Thread[threadDeathWatcher-1-1,1,com.google.ads.googleads.examples.basicoperations.GetCampaigns] will linger despite being asked to die via interruption
[WARNING] thread Thread[grpc-default-worker-ELG-2-1,5,com.google.ads.googleads.examples.basicoperations.GetCampaigns] will linger despite being asked to die via interruption
[WARNING] thread Thread[grpc-default-worker-ELG-2-2,5,com.google.ads.googleads.examples.basicoperations.GetCampaigns] will linger despite being asked to die via interruption
[WARNING] thread Thread[grpc-default-worker-ELG-2-3,5,com.google.ads.googleads.examples.basicoperations.GetCampaigns] will linger despite being asked to die via interruption
[WARNING] thread Thread[grpc-default-worker-ELG-2-4,5,com.google.ads.googleads.examples.basicoperations.GetCampaigns] will linger despite being asked to die via interruption
[WARNING] thread Thread[grpc-default-worker-ELG-2-5,5,com.google.ads.googleads.examples.basicoperations.GetCampaigns] will linger despite being asked to die via interruption
[WARNING] thread Thread[grpc-shared-destroyer-0,5,com.google.ads.googleads.examples.basicoperations.GetCampaigns] will linger despite being asked to die via interruption
[WARNING] NOTE: 7 thread(s) did not finish despite being asked to  via interruption. This is not a problem with exec:java, it is a problem with the running code. Although not serious, it should be remedied.
[WARNING] Couldn't destroy threadgroup org.codehaus.mojo.exec.ExecJavaMojo$IsolatedThreadGroup[name=com.google.ads.googleads.examples.basicoperations.GetCampaigns,maxpri=10]
java.lang.IllegalThreadStateException
        at java.lang.ThreadGroup.destroy(ThreadGroup.java:778)
        at org.codehaus.mojo.exec.ExecJavaMojo.execute(ExecJavaMojo.java:321)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
...

As a workaround, I set the cleanupDaemonThreads option of exec-maven-plugin to false (default is true), but we should verify that there is no additional cleanup required in GoogleAdsClient.

java.lang.Exception: Failed ALPN negotiation: Unable to find compatible protocol

Hi, I am getting the following error while trying to fetch a customer.

public class GetCustomer {

    public static void main(String[] args) {

        Credentials credentials = UserCredentials.newBuilder()
                .setClientId("removed")
                .setClientSecret("removed")
                .setRefreshToken("removed")
                .build();
        GoogleAdsClient googleAdsClient = GoogleAdsClient.newBuilder()
                .setCredentials(credentials)
                .setDeveloperToken("removed")
                .setLoginCustomerId(6878877556L)
                .build();

        try {
            new GetCustomer().runExample(googleAdsClient, "customers/9120473352");
        }
        catch (GoogleAdsException gae) {
            gae.printStackTrace();
            System.err.printf("Request ID %s failed due to GoogleAdsException. Underlying errors:%n", gae.getRequestId());
            int i = 0;
            for (GoogleAdsError googleAdsError : gae.getGoogleAdsFailure().getErrorsList()) {
                System.err.printf("  Error %d: %s%n", i++, googleAdsError);
            }
        }
    }

    private void runExample(GoogleAdsClient googleAdsClient, String customerResource) {
        Customer customer = null;
        try (CustomerServiceClient customerServiceClient = googleAdsClient.getLatestVersion().createCustomerServiceClient()) {
            customer = customerServiceClient.getCustomer(customerResource);
        }
    }
}

Following is the error log

2019-06-17 12:54:44,470 WARN  [Gax-2] logging.RequestLogger (RequestLogger.java:159) - FAILURE REQUEST SUMMARY. Method: google.ads.googleads.v1.services.CustomerService/GetCustomer, Endpoint: googleads.googleapis.com:443, CustomerID: null, RequestID: null, ResponseCode: UNKNOWN, Fault: null.
2019-06-17 12:54:44,721 INFO  [Gax-2] 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, login-customer-id=6878877556, x-goog-api-client=gl-java/1.8.0_211 gapic/ gax/1.35.0 grpc/1.16.1}
Body: resource_name: "customers/9120473352"


Response
--------
Headers: null
Body: null
Failure message: null
Status: Status{code=UNKNOWN, description=null, cause=java.lang.Exception: Failed ALPN negotiation: Unable to find compatible protocol.
	at io.grpc.netty.shaded.io.grpc.netty.ProtocolNegotiators$BufferUntilTlsNegotiatedHandler.userEventTriggered(ProtocolNegotiators.java:684)
	at io.grpc.netty.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeUserEventTriggered(AbstractChannelHandlerContext.java:329)
	at io.grpc.netty.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeUserEventTriggered(AbstractChannelHandlerContext.java:315)
	at io.grpc.netty.shaded.io.netty.channel.AbstractChannelHandlerContext.fireUserEventTriggered(AbstractChannelHandlerContext.java:307)
	at io.grpc.netty.shaded.io.netty.handler.ssl.SslHandler.setHandshakeSuccess(SslHandler.java:1530)
	at io.grpc.netty.shaded.io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1368)
	at io.grpc.netty.shaded.io.netty.handler.ssl.SslHandler.decodeJdkCompatible(SslHandler.java:1199)
	at io.grpc.netty.shaded.io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1243)
	at io.grpc.netty.shaded.io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:502)
	at io.grpc.netty.shaded.io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:441)
	at io.grpc.netty.shaded.io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:278)
	at io.grpc.netty.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
	at io.grpc.netty.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
	at io.grpc.netty.shaded.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
	at io.grpc.netty.shaded.io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1434)
	at io.grpc.netty.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
	at io.grpc.netty.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
	at io.grpc.netty.shaded.io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:965)
	at io.grpc.netty.shaded.io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)
	at io.grpc.netty.shaded.io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:644)
	at io.grpc.netty.shaded.io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:579)
	at io.grpc.netty.shaded.io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:496)
	at io.grpc.netty.shaded.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:458)
	at io.grpc.netty.shaded.io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:897)
	at io.grpc.netty.shaded.io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.lang.Thread.run(Thread.java:748)
}.
Exception in thread "main" com.google.api.gax.rpc.UnknownException: io.grpc.StatusRuntimeException: UNKNOWN
	at com.google.api.gax.rpc.ApiExceptionFactory.createException(ApiExceptionFactory.java:47)
	at com.google.api.gax.grpc.GrpcApiExceptionFactory.create(GrpcApiExceptionFactory.java:72)
	at com.google.api.gax.grpc.GrpcApiExceptionFactory.create(GrpcApiExceptionFactory.java:60)
	at com.google.api.gax.grpc.GrpcExceptionCallable$ExceptionTransformingFuture.onFailure(GrpcExceptionCallable.java:97)
	at com.google.api.core.ApiFutures$1.onFailure(ApiFutures.java:68)
	at com.google.common.util.concurrent.Futures$CallbackListener.run(Futures.java:1052)
	at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:398)
	at com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:1030)
	at com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:871)
	at com.google.common.util.concurrent.AbstractFuture.setException(AbstractFuture.java:716)
	at io.grpc.stub.ClientCalls$GrpcFuture.setException(ClientCalls.java:507)
	at io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:482)
	at io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39)
	at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23)
	at io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40)
	at com.google.ads.googleads.lib.logging.LoggingInterceptor$1$1.onClose(LoggingInterceptor.java:111)
	at io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39)
	at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23)
	at io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40)
	at io.grpc.internal.CensusStatsModule$StatsClientInterceptor$1$1.onClose(CensusStatsModule.java:678)
	at io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39)
	at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23)
	at io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40)
	at io.grpc.internal.CensusTracingModule$TracingClientInterceptor$1$1.onClose(CensusTracingModule.java:397)
	at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:459)
	at io.grpc.internal.ClientCallImpl.access$300(ClientCallImpl.java:63)
	at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:546)
	at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$600(ClientCallImpl.java:467)
	at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:584)
	at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
	at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266)
	at java.util.concurrent.FutureTask.run(FutureTask.java)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
	Suppressed: com.google.api.gax.rpc.AsyncTaskException: Asynchronous task failed
		at com.google.api.gax.rpc.ApiExceptions.callAndTranslateApiException(ApiExceptions.java:57)
		at com.google.api.gax.rpc.UnaryCallable.call(UnaryCallable.java:112)
		at com.google.ads.googleads.v1.services.CustomerServiceClient.getCustomer(CustomerServiceClient.java:208)
		at com.google.ads.googleads.v1.services.CustomerServiceClient.getCustomer(CustomerServiceClient.java:185)
		at GetCustomer.runExample(GetCustomer.java:40)
		at GetCustomer.main(GetCustomer.java:25)
Caused by: io.grpc.StatusRuntimeException: UNKNOWN
	at io.grpc.Status.asRuntimeException(Status.java:526)
	... 28 more
Caused by: java.lang.Exception: Failed ALPN negotiation: Unable to find compatible protocol.
	at io.grpc.netty.shaded.io.grpc.netty.ProtocolNegotiators$BufferUntilTlsNegotiatedHandler.userEventTriggered(ProtocolNegotiators.java:684)
	at io.grpc.netty.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeUserEventTriggered(AbstractChannelHandlerContext.java:329)
	at io.grpc.netty.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeUserEventTriggered(AbstractChannelHandlerContext.java:315)
	at io.grpc.netty.shaded.io.netty.channel.AbstractChannelHandlerContext.fireUserEventTriggered(AbstractChannelHandlerContext.java:307)
	at io.grpc.netty.shaded.io.netty.handler.ssl.SslHandler.setHandshakeSuccess(SslHandler.java:1530)
	at io.grpc.netty.shaded.io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1368)
	at io.grpc.netty.shaded.io.netty.handler.ssl.SslHandler.decodeJdkCompatible(SslHandler.java:1199)
	at io.grpc.netty.shaded.io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1243)
	at io.grpc.netty.shaded.io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:502)
	at io.grpc.netty.shaded.io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:441)
	at io.grpc.netty.shaded.io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:278)
	at io.grpc.netty.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
	at io.grpc.netty.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
	at io.grpc.netty.shaded.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
	at io.grpc.netty.shaded.io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1434)
	at io.grpc.netty.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
	at io.grpc.netty.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
	at io.grpc.netty.shaded.io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:965)
	at io.grpc.netty.shaded.io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)
	at io.grpc.netty.shaded.io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:644)
	at io.grpc.netty.shaded.io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:579)
	at io.grpc.netty.shaded.io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:496)
	at io.grpc.netty.shaded.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:458)
	at io.grpc.netty.shaded.io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:897)
	at io.grpc.netty.shaded.io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	... 1 more

How to enable logging in Java client library?

How to enable logging in this Java client library? It seems like it doesn't have a configuration for logging just like in AdWords API Java client lib. I want to get my request and response logs and it seems its not included in any of your guides.

looking forward for your immediate response.

Thanks
Kimpoy

Problem with creating Accounts

Hi, how are you?

I would like to ask you a question regarding the Google Ads Beta Java Client Library. Im trying to create a new Client under my Manager Account. I think I already set the GoogleAdsClient correctly, because I could use them for other services, but I am not sure if there is something I am missing here.
After getting the Google Ads Credential, I am doing this:

GoogleAdsClient googleAdsClient = GoogleServiceUtil.getGoogleAdsClient();
// Create Account for Google Ads Manager
try (CustomerServiceClient customerServiceClient = googleAdsClient.getCustomerServiceClient()) {
 String customerId = googleAdsClient.getLoginCustomerId().toString();
 Customer customerClient = Customer.newBuilder().setResourceName("TestingClient").build();
 CreateCustomerClientResponse response = customerServiceClient.createCustomerClient(customerId, customerClient);
 System.out.printf("%s",response);
}

The customerId is my MCC which is the Manager Account I put on the credentials also. I also tried getting the CustomerServiceClient by doing CustomerServiceClient.create(), but there I get an error regarding some GOOGLE_APPLICATION_CREDENTIALS, which I can’t the relation with this. We host our backend in AWS, not in Google Cloud.

I get an error with the following trace after running the code above:

Thanks for your help!

Request
-------
MethodName: google.ads.googleads.v0.services.CustomerService/CreateCustomerClient
Endpoint: googleads.googleapis.com:443
Headers: {developer-token=REDACTED, login-customer-id=1503892305, x-goog-api-client=gl-java/1.8.0_162 gapic/ gax/1.35.0 grpc/1.16.1}
Body: customer_id: "1503892305"
customer_client {
}


Response
--------
Headers: Metadata(content-type=application/grpc,request-id=x8aqWEkooVAjEMDzuOeHpg,date=Fri, 22 Feb 2019 18:42:26 GMT,alt-svc=quic=":443"; ma=2592000; v="44,43,39")
Body: null
Status: Status{code=INTERNAL, description=Internal error encountered., cause=null}.
2019-02-22 15:42:44.199 ERROR 16329 --- [nio-8000-exec-3] c.a.c.error_handlers.ThrowableHandler    : An uncaught exception was thrown

com.google.ads.googleads.lib.GoogleAdsException: io.grpc.StatusRuntimeException: INTERNAL: Internal error encountered.
	at com.google.ads.googleads.lib.GoogleAdsExceptionTransformation.transform(GoogleAdsExceptionTransformation.java:45)
	at com.google.ads.googleads.lib.ExceptionTransformingCallable$ExceptionTransformingFuture.onFailure(ExceptionTransformingCallable.java:83)
	at com.google.api.core.ApiFutures$1.onFailure(ApiFutures.java:68)
	at com.google.common.util.concurrent.Futures$CallbackListener.run(Futures.java:1052)
	at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:398)
	at com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:1030)
	at com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:871)
	at com.google.common.util.concurrent.AbstractFuture.setException(AbstractFuture.java:716)
	at com.google.api.core.AbstractApiFuture$InternalSettableFuture.setException(AbstractApiFuture.java:95)
	at com.google.api.core.AbstractApiFuture.setException(AbstractApiFuture.java:77)
	at com.google.api.gax.grpc.GrpcExceptionCallable$ExceptionTransformingFuture.onFailure(GrpcExceptionCallable.java:97)
	at com.google.api.core.ApiFutures$1.onFailure(ApiFutures.java:68)
	at com.google.common.util.concurrent.Futures$CallbackListener.run(Futures.java:1052)
	at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:398)
	at com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:1030)
	at com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:871)
	at com.google.common.util.concurrent.AbstractFuture.setException(AbstractFuture.java:716)
	at io.grpc.stub.ClientCalls$GrpcFuture.setException(ClientCalls.java:507)
	at io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:482)
	at io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39)
	at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23)
	at io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40)
	at com.google.ads.googleads.lib.logging.LoggingInterceptor$1$1.onClose(LoggingInterceptor.java:111)
	at io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39)
	at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23)
	at io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40)
	at io.grpc.internal.CensusStatsModule$StatsClientInterceptor$1$1.onClose(CensusStatsModule.java:678)
	at io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39)
	at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23)
	at io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40)
	at io.grpc.internal.CensusTracingModule$TracingClientInterceptor$1$1.onClose(CensusTracingModule.java:397)
	at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:459)
	at io.grpc.internal.ClientCallImpl.access$300(ClientCallImpl.java:63)
	at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:546)
	at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$600(ClientCallImpl.java:467)
	at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:584)
	at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
	at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)
	at java.util.concurrent.Executors$RunnableAdapter.call$$$capture(Executors.java:511)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java)
	at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266)
	at java.util.concurrent.FutureTask.run(FutureTask.java)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
	Suppressed: com.google.api.gax.rpc.AsyncTaskException: Asynchronous task failed
		at com.google.api.gax.rpc.ApiExceptions.callAndTranslateApiException(ApiExceptions.java:57)
		at com.google.api.gax.rpc.UnaryCallable.call(UnaryCallable.java:112)
		at com.google.ads.googleads.v0.services.CustomerServiceClient.createCustomerClient(CustomerServiceClient.java:439)
		at com.google.ads.googleads.v0.services.CustomerServiceClient.createCustomerClient(CustomerServiceClient.java:413)
		at com.adtomiclabs.admin.backend.services.SetupServiceImpl.setupGoogle(SetupServiceImpl.java:96)
		at com.adtomiclabs.admin.backend.services.SetupServiceImpl$$FastClassBySpringCGLIB$$fa7c5e83.invoke(<generated>)
		at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
		at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:738)
		at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
		at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
		at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282)
		at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
		at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
		at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:673)
		at com.adtomiclabs.admin.backend.services.SetupServiceImpl$$EnhancerBySpringCGLIB$$cb51e71c.setupGoogle(<generated>)
		at com.adtomiclabs.admin.backend.web.controller.rest_endpoints.SetupEndpoint.lambda$initiateSetup$0(SetupEndpoint.java:66)
		at java.util.Optional.map(Optional.java:215)
		at com.adtomiclabs.admin.backend.web.controller.rest_endpoints.SetupEndpoint.initiateSetup(SetupEndpoint.java:64)
		at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
		at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
		at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
		at java.lang.reflect.Method.invoke(Method.java:498)
		at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
		at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144)
		at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161)
		at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:160)
		at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99)
		at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)
		at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347)
		at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)
		at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326)
		at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
		at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
		at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
		at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
		at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
		at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
		at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305)
		at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)
		at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473)
		at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427)
		at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388)
		at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341)
		at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228)
		at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
		at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
		at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
		at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
		at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
		at com.adtomiclabs.commons.authentication.TokenAuthenticationFilter.successfulAuthentication(TokenAuthenticationFilter.java:105)
		at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:240)
		at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
		at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
		at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)
		at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
		at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
		at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
		at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:317)
		at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:114)
		at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
		at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137)
		at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
		at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111)
		at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
		at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:170)
		at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
		at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63)
		at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
		at com.adtomiclabs.commons.authentication.TokenAuthenticationFilter.successfulAuthentication(TokenAuthenticationFilter.java:105)
		at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:240)
		at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
		at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:64)
		at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
		at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
		at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105)
		at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
		at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56)
		at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
		at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
		at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:214)
		at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:177)
		at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:347)
		at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:263)
		at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
		at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
		at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
		at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
		at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
		at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
		at com.adtomiclabs.commons.config.UncaughtExceptionHandlerFilter.doFilter(UncaughtExceptionHandlerFilter.java:57)
		at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
		at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
		at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
		at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
		at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478)
		at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
		at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
		at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
		at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
		at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)
		at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
		at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
		at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)
		at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
		at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
		at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
		at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
		... 1 common frames omitted
Caused by: io.grpc.StatusRuntimeException: INTERNAL: Internal error encountered.
	at io.grpc.Status.asRuntimeException(Status.java:526)
	... 29 common frames omitted

GoogleAdsServiceClient.search() can easily exceed gRPC maximum size

I am only able to reliably run single-day search queries due to responses exceeding gRPC's max message size, triggering a RESOURCE_EXHAUSTED exception. The default 4MB size seems inadequate for the API's needs, but is seemingly not configurable when constructing a GoogleAdsClient or GoogleAdsServiceClient. Example:

cli.search(customerId, """
SELECT customer.descriptive_name,
       customer.time_zone,
       customer.id,
       campaign.id,
       campaign.name,
       campaign.status,
       ad_group_ad.ad_group,
       ad_group.name,
       ad_group.status,
       ad_group_ad.status,
       ad_group_ad.ad.id,
       ad_group_ad.ad.name,
       segments.date,
       segments.click_type,
       segments.ad_network_type,
       segments.device,
       segments.keyword.info.text,
       segments.keyword.info.match_type,
       segments.keyword.ad_group_criterion,
       metrics.impressions,
       metrics.all_conversions,
       metrics.conversions,
       metrics.cross_device_conversions,
       metrics.current_model_attributed_conversions,
       metrics.view_through_conversions
FROM ad_group_ad
WHERE segments.date DURING LAST_7_DAYS
  AND metrics.impressions > 0""") 
----------------------------------------------------------------------------------------
com.google.api.gax.rpc.ResourceExhaustedException: io.grpc.StatusRuntimeException: RESOURCE_EXHAUSTED: gRPC message exceeds maximum size 4194304: 4978193

  com.google.api.gax.rpc.ApiExceptionFactory.createException(ApiExceptionFactory.java:57)

  com.google.api.gax.grpc.GrpcApiExceptionFactory.create(GrpcApiExceptionFactory.java:72)

  com.google.api.gax.grpc.GrpcApiExceptionFactory.create(GrpcApiExceptionFactory.java:60)

  com.google.api.gax.grpc.GrpcExceptionCallable$ExceptionTransformingFuture.onFailure(GrpcExceptionCallable.java:97)

  com.google.api.core.ApiFutures$1.onFailure(ApiFutures.java:68)

  com.google.common.util.concurrent.Futures$CallbackListener.run(Futures.java:1052)

  com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:398)

  com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:1030)

  com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:871)

  com.google.common.util.concurrent.AbstractFuture.setException(AbstractFuture.java:716)

  io.grpc.stub.ClientCalls$GrpcFuture.setException(ClientCalls.java:507)

  io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:482)

  io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39)

  io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23)

  io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40)

  com.google.ads.googleads.lib.logging.LoggingInterceptor$1$1.onClose(LoggingInterceptor.java:111)

  io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39)

  io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23)

  io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40)

  io.grpc.internal.CensusStatsModule$StatsClientInterceptor$1$1.onClose(CensusStatsModule.java:678)

  io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39)

  io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23)

  io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40)

  io.grpc.internal.CensusTracingModule$TracingClientInterceptor$1$1.onClose(CensusTracingModule.java:397)

  io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:459)

  io.grpc.internal.ClientCallImpl.access$300(ClientCallImpl.java:63)

  io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:546)

  io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$600(ClientCallImpl.java:467)

  io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:584)

  io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)

  io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)

  java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)

  java.util.concurrent.FutureTask.run(FutureTask.java:266)

  java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)

  java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)

  java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

  java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

  java.lang.Thread.run(Thread.java:748)

io.grpc.StatusRuntimeException: RESOURCE_EXHAUSTED: gRPC message exceeds maximum size 4194304: 4978193

  io.grpc.Status.asRuntimeException(Status.java:526)

  io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:482)

  io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39)

  io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23)

  io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40)

  com.google.ads.googleads.lib.logging.LoggingInterceptor$1$1.onClose(LoggingInterceptor.java:111)

  io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39)

  io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23)

  io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40)

  io.grpc.internal.CensusStatsModule$StatsClientInterceptor$1$1.onClose(CensusStatsModule.java:678)

  io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39)

  io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23)

  io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40)

  io.grpc.internal.CensusTracingModule$TracingClientInterceptor$1$1.onClose(CensusTracingModule.java:397)

  io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:459)

  io.grpc.internal.ClientCallImpl.access$300(ClientCallImpl.java:63)

  io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:546)

  io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$600(ClientCallImpl.java:467)

  io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:584)

  io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)

  io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)

  java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)

  java.util.concurrent.FutureTask.run(FutureTask.java:266)

  java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)

  java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)

  java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

  java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

  java.lang.Thread.run(Thread.java:748)

Bidding Strategy Learning Status

In AdWords UI there is a "Learning" Bidding Strategy status.

It is not available with Google Ads API.

Is it feasible this feature can be implemented by an external contributor?
Do you have any plans to implement this feature?

Investigate why netty-codec-http2 and grpc-core are always downloaded.

Investigate why netty-codec-http2 and grpc-core are always downloaded.

google-ads-examples (scratch) 10158$ mvn compile
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Google Ads API client library for Java examples 0.7.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: https://repo.maven.apache.org/maven2/io/grpc/grpc-core/maven-metadata.xml
Downloaded: https://repo.maven.apache.org/maven2/io/grpc/grpc-core/maven-metadata.xml (1.8 kB at 2.9 kB/s)
Downloading: https://repo.maven.apache.org/maven2/io/netty/netty-codec-http2/maven-metadata.xml
Downloaded: https://repo.maven.apache.org/maven2/io/netty/netty-codec-http2/maven-metadata.xml (2.1 kB at 35 kB/s)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.