Google Ads API v21: StatusRuntimeException INTERNAL error with GenerateKeywordHistoricalMetrics - Market-specific failures after upgrade

17 views
Skip to first unread message

Parth Vallabhdas Makadiya

unread,
Aug 28, 2025, 5:40:10 PM (7 days ago) Aug 28
to Google Ads API and AdWords API Forum
Issue Summary: After upgrading from an older Google Ads API version to v21 (using google-ads-stubs-v21-39.0.0), I'm experiencing intermittent io.grpc.StatusRuntimeException: INTERNAL: Internal error encountered errors when calling GenerateKeywordHistoricalMetrics. The issue is market-specific - some country/language combinations work perfectly while others consistently fail with this error.

Technical Details:
API Version: Google Ads API v21 java (google-ads-stubs-v21-39.0.0)
Endpoint: KeywordPlanIdeaServiceClient.generateKeywordHistoricalMetrics()
Error: io.grpc.StatusRuntimeException: INTERNAL: Internal error encountered
Pattern: Market-specific failures (some geo/language combinations work, others don't)
Request Configuration:
GenerateKeywordHistoricalMetricsRequest:
- Customer ID: [Valid customer ID]
- Keywords: List of keyword strings (batch size ~8000)
Error Stack Trace:
io.grpc.StatusRuntimeException: INTERNAL: Internal error encountered.
at com.google.ads.googleads.v21.errors.GoogleAdsException$Factory.createException(GoogleAdsException.java:42)
Caused by: io.grpc.StatusRuntimeException: INTERNAL: Internal error encountered.

What Changed:

Upgraded from previous Google Ads API version to v21
Same code logic, same data, same customer account
Issue only appeared after the v21 upgrade

Non-recoverable error: request_id: "0CuauXgUQ7i1FqeP5B57QA"

Questions:
Are there known issues with GenerateKeywordHistoricalMetrics in v21 for specific geo/language combinations?
Were there breaking changes in v21 regarding geo-targeting or language constraints that could cause this?
Should I implement different retry strategies for v21 compared to previous versions?

Google Ads API Forum Advisor

unread,
Aug 29, 2025, 3:19:33 AM (7 days ago) Aug 29
to parth.vallab...@zalando.de, adwor...@googlegroups.com

Hi,

Thank you for contacting the Google Ads API support team.

After reviewing your concern, I understand that you are encountering the "INTERNAL_ERROR" when trying to use KeywordPlanIdeaService.GenerateKeywordHistoricalMetrics method. Please note that the INTERNAL_ERROR occurs when something unexpected happens while processing the request. The common cause could be the API isn't functioning correctly. However, this is transient in nature and the API request will work again when retrying it after 30 seconds or some time. You may also retry any requests that failed with this error, using an exponential backoff schedule for the retries. Here is a code example demonstrating how to implement an exponential back off strategy.

If the issue still persists, then provide us with the below information, so that we can investigate this issue further.

  • Date of this issue started
  • How much time did you wait before retry of a request
  • Updated complete API request and response logs with request-id and request header generated at your end without redacting any information. If you are using a client library and haven't enabled the logging yet, I would request you to enable logging for the specific client library that you are using. You can refer to the guides Java, .Net, PHP, Python, Ruby or Perl to enable logging at your end. For REST interface requests, you can enable logging via the curl command by using the -i flag.

You can send the details via Reply privately to the author option, or direct private reply to this email.

Thanks,
 
Google Logo Google Ads API Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5
[2025-08-29 07:18:36Z GMT] This message is in relation to case "ref:!00D1U01174p.!500Ht01u5T00:ref" (ADR-00331288)



Reply all
Reply to author
Forward
0 new messages