Hi I followed the code example to create query with *GoogleAdsService.searchStream* <https://developers.google.com/google-ads/api/reference/rpc/v12/GoogleAdsService#searchstream>: but encountered the following exception
Nov 28, 2022 11:21:58 AM io.grpc.internal.ManagedChannelImpl$2 uncaughtException SEVERE: [Channel<1>: (googleads.googleapis.com:443)] Uncaught exception in the SynchronizationContext. Panic! 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. This is the code snippet of the method that does the query, private void getUserList(){ log.info("get user list [{}]", audienceId); int offset = 0; userList = null; //String query = "SELECT user_list.id FROM user_list"; try (GoogleAdsServiceClient googleAdsServiceClient = googleAdsClient.getLatestVersion().createGoogleAdsServiceClient()) { String query = "SELECT user_list.id FROM user_list"; // Constructs the SearchGoogleAdsStreamRequest. SearchGoogleAdsStreamRequest request = SearchGoogleAdsStreamRequest.newBuilder() .setCustomerId(Long.toString(CUSTOMER_ID)) .setQuery(query) .build(); // Creates and issues a search Google Ads stream request that will retrieve all of the // requested field values for the keyword. ServerStream<SearchGoogleAdsStreamResponse> stream = googleAdsServiceClient.searchStreamCallable().call(request); // Iterates through the results in the stream response and prints all of the requested // field values for the keyword in each row. for (SearchGoogleAdsStreamResponse response : stream) { for (GoogleAdsRow googleAdsRow : response.getResultsList()) { System.out.printf("user list id = ", googleAdsRow.getUserList().getId()); } } } } I checked in the google-ads-java on giithub and followed the recommended workaround mentioned in this thread https://github.com/grpc/grpc-java/issues/5493#issuecomment-479156985 but I still get the same exception. I have raised a question on this exception in github since last week but yet to get any feedback. Attached is the log with the exception messages. May I know how can I resolved this exception? On Monday, 21 November 2022 at 18:51:18 UTC+8 adsapi wrote: > Hi Derek, > > Thanks for reaching out to the Google Ads API Forum. > > For you to migrate, you may refer to this *guide* > <https://developers.google.com/google-ads/api/docs/migration/user-data-service> > > for how to migrate from building user lists with *AdwordsUserListService* > <https://developers.google.com/adwords/api/docs/reference/latest/AdwordsUserListService> > > in the AdWords API to using *UserDataService* > <https://developers.google.com/google-ads/api/reference/rpc/v12/UserDataService> > > in the Google Ads API in order to sync Customer Match data. For more > information on the migrating AdWords API Services to Google Ads API > Services, you may refer to this *page* > <https://developers.google.com/google-ads/api/docs/migration/services>. > > Also, for you to get user_list.id, you may use this *code example* > <https://developers.google.com/google-ads/api/docs/samples/get-keyword-stats?hl=en> > > for reporting by issuing the following query with > *GoogleAdsService.searchStream* > <https://developers.google.com/google-ads/api/reference/rpc/v12/GoogleAdsService#searchstream> > : > > > > SELECT > > user_list.id, user_list.name, > > user_list.resource_name, user_list.type > > FROM user_list > > > > With this, you may consider updating your GAQL in the above provided > example. In addition, to create a user list (a.k.a. audience) and *uploads > members to populate the list* > <https://developers.google.com/google-ads/api/docs/remarketing/audience-types/customer-match>, > > you may refer to this *code example* > <https://developers.google.com/google-ads/api/docs/samples/add-customer-match-user-list> > > in the Java client library. > > Let us know if you have any followup questions. > > Regards, > [image: Google Logo] > Yasar > Google Ads API Team > > > ref:_00D1U1174p._5004Q2gR1JZ:ref > -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog: https://googleadsdeveloper.blogspot.com/ =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ You received this message because you are subscribed to the Google Groups "AdWords API and Google Ads API Forum" group. To post to this group, send email to adwords-api@googlegroups.com To unsubscribe from this group, send email to adwords-api+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/adwords-api?hl=en --- You received this message because you are subscribed to the Google Groups "Google Ads API and AdWords API Forum" group. To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/3afac25d-99f6-47dc-81b1-7cfadda71933n%40googlegroups.com.
nohup: ignoring input Updating the ads.properties file action [1] initializing CUSTOMER_ID = 4356659910 processing fileName [null], deleting fileName [null] load files from dir [/home/bmuser/ggupload/data/] processing file GSH522R_689297442_202210.csv extracted audience id [689297442] from file name load file [GSH522R_689297442_202209] from dir [/home/bmuser/ggupload/data/processed/] get user list [689297442] Nov 28, 2022 11:21:58 AM io.grpc.internal.ManagedChannelImpl$2 uncaughtException SEVERE: [Channel<1>: (googleads.googleapis.com:443)] Uncaught exception in the SynchronizationContext. Panic! 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.<init>(AutoConfiguredLoadBalancerFactory.java:92) at io.grpc.internal.AutoConfiguredLoadBalancerFactory.newLoadBalancer(AutoConfiguredLoadBalancerFactory.java:63) at io.grpc.internal.ManagedChannelImpl.exitIdleMode(ManagedChannelImpl.java:409) at io.grpc.internal.ManagedChannelImpl$RealChannel$2.run(ManagedChannelImpl.java:984) at io.grpc.SynchronizationContext.drain(SynchronizationContext.java:95) at io.grpc.SynchronizationContext.execute(SynchronizationContext.java:127) at io.grpc.internal.ManagedChannelImpl$RealChannel.newCall(ManagedChannelImpl.java:981) at com.google.api.gax.grpc.GrpcChannelUUIDInterceptor.interceptCall(GrpcChannelUUIDInterceptor.java:52) at io.grpc.ClientInterceptors$InterceptorChannel.newCall(ClientInterceptors.java:156) at com.google.api.gax.grpc.GrpcHeaderInterceptor.interceptCall(GrpcHeaderInterceptor.java:80) at io.grpc.ClientInterceptors$InterceptorChannel.newCall(ClientInterceptors.java:156) at com.google.api.gax.grpc.GrpcMetadataHandlerInterceptor.interceptCall(GrpcMetadataHandlerInterceptor.java:54) at io.grpc.ClientInterceptors$InterceptorChannel.newCall(ClientInterceptors.java:156) at com.google.ads.googleads.lib.logging.LoggingInterceptor.interceptCall(LoggingInterceptor.java:68) at io.grpc.ClientInterceptors$InterceptorChannel.newCall(ClientInterceptors.java:156) at io.grpc.internal.ManagedChannelImpl.newCall(ManagedChannelImpl.java:923) at io.grpc.internal.ForwardingManagedChannel.newCall(ForwardingManagedChannel.java:63) at com.google.api.gax.grpc.ChannelPool$AffinityChannel.newCall(ChannelPool.java:434) at com.google.api.gax.grpc.ChannelPool.newCall(ChannelPool.java:176) at com.google.api.gax.grpc.GrpcClientCalls.newCall(GrpcClientCalls.java:99) at com.google.api.gax.grpc.GrpcDirectServerStreamingCallable.call(GrpcDirectServerStreamingCallable.java:65) at com.google.api.gax.grpc.GrpcServerStreamingRequestParamCallable.call(GrpcServerStreamingRequestParamCallable.java:61) at com.google.api.gax.grpc.GrpcExceptionServerStreamingCallable.call(GrpcExceptionServerStreamingCallable.java:59) at com.google.api.gax.rpc.WatchdogServerStreamingCallable.call(WatchdogServerStreamingCallable.java:69) at com.google.api.gax.rpc.ServerStreamingCallable$1.call(ServerStreamingCallable.java:237) at com.google.api.gax.rpc.ServerStreamingAttemptCallable.call(ServerStreamingAttemptCallable.java:234) at com.google.api.gax.rpc.ServerStreamingAttemptCallable.start(ServerStreamingAttemptCallable.java:194) at com.google.api.gax.rpc.RetryingServerStreamingCallable.call(RetryingServerStreamingCallable.java:87) at com.google.api.gax.tracing.TracedServerStreamingCallable.call(TracedServerStreamingCallable.java:76) at com.google.api.gax.rpc.ServerStreamingCallable$1.call(ServerStreamingCallable.java:237) at com.google.ads.googleads.lib.stubs.callables.ExceptionTransformingServerStreamingCallable.call(ExceptionTransformingServerStreamingCallable.java:46) at com.google.api.gax.rpc.ServerStreamingCallable.call(ServerStreamingCallable.java:127) at com.google.api.gax.rpc.ServerStreamingCallable.call(ServerStreamingCallable.java:113) at com.globalsources.remarketing.AudienceManager.getUserList(AudienceManager.java:290) at com.globalsources.remarketing.AudienceManager.execute(AudienceManager.java:197) at com.globalsources.remarketing.Main.main(Main.java:34)