Troubleshooting "GRPC target method can't be resolved."

4,784 views
Skip to first unread message

David Booke

unread,
Aug 30, 2022, 12:26:28 PM8/30/22
to Google Ads API and AdWords API Forum
Hello,

I'm using the google-ads python client and am attempting to troubleshoot the following error:
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
    status = StatusCode.UNIMPLEMENTED
    details = "GRPC target method can't be resolved."
    debug_error_string = "{"created":"@1661869388.853682000","description":"Error received from peer ipv4:74.125.138.95:443","file":"src/core/lib/surface/call.cc","file_line":967,"grpc_message":"GRPC target method can't be resolved.","grpc_status":12}"

google.api_core.exceptions.MethodNotImplemented: 501 GRPC target method can't be resolved.


I currently have google-ads version 7.0.0 and grpcio 1.47.0 installed. Due to the requirements of our project, I can't use a newer version of google-ads than 7.0.0. I've tried installing and using various older versions of grpcio to no avail. I've checked the requirements of each module installed as a requirement of google-ads 7.0.0 (google-api-core, proto-plus, google-auth, etc.), and there are no conflicting versions.

I've tried using both the SearchGoogleAdsStreamRequest and SearchGoogleAdsRequest request types, but I get the same error from both. Is it possible to make a request and retrieve a response from the Google Ads API using google-ads version 7.0.0 or am I forced to install a newer version?

Sample code for reference:
from google.ads.google_ads.client import GoogleAdsClient

creds_dict = {
"developer_token": "REDACTED",
"refresh_token": "REDACTED",
"client_id": "REDACTED",
"client_secret": "REDACTED",
"use_proto_plus": "True",
"login_customer_id": "REDACTED"
}
client = GoogleAdsClient.load_from_dict(creds_dict)
ga_service = client.get_service("GoogleAdsService")
search_request = client.get_type("SearchGoogleAdsStreamRequest")

customer_id = "REDACTED"
query = """
SELECT
customer_client.client_customer,
customer_client.status
FROM customer_client
"""

stream = ga_service.search_stream(customer_id=customer_id, query=query)


I'd really appreciate any and all assistance! Let me know if there's any other information I can provide that'd be helpful.

Google Ads API Forum Advisor

unread,
Aug 30, 2022, 2:04:44 PM8/30/22
to david...@smiledirectclub.com, adwor...@googlegroups.com
Hi David,

Our Client library and supported versions shows you are trying a sunsetted API endpoint. To continue to use the Python Client Library you will need to upgrade. You may always use REST Interface instead.

Regards,

Google Logo
Aryeh
Google Ads API Team
 


ref:_00D1U1174p._5004Q2dtQGB:ref

David Booke

unread,
Aug 30, 2022, 2:58:07 PM8/30/22
to Google Ads API and AdWords API Forum
Thank you, Aryeh! I'll use the REST interface.

Miguel Martín González

unread,
Feb 21, 2023, 7:18:07 AM2/21/23
to Google Ads API and AdWords API Forum
Hello,
I am also having the same issue. An old script I made seems to be using deprecated methods now, particularly this line:

response = keyword_plan_service.mutate_keyword_plans(customer_id=customer_id, operations=[operation])

Is there any way, guide or otherwise, to easily convert the process I followed to the new system using rest?

Thanks

Google Ads API Forum Advisor

unread,
Feb 21, 2023, 1:26:32 PM2/21/23
to miguel...@feverup.com, adwor...@googlegroups.com

Hi Miguel, 

This is Marjorie from the Google Ads API team as well. Thank you for getting back to us.

Moving forward to your concern about the issue while using the keyword_plan_service.mutate_keyword_plans, you may see Google Ads API customers.keywordPlans.mutate documentation and guidance for reference for this matter.

For additional information, as you mentioned that “An old script I made seems to be using deprecated methods now” and “Is there any way, guide or otherwise, to easily convert the process I followed to the new system using rest?”, please note that below Google Ads API v11 is already deprecated and after the sunset will begin to fail. We highly recommend to please migrate to a newer version to ensure your API access is unaffected.

For additional information, please see Deprecation and Sunset, and Release Notes for the functionality and changes added in v12.

In addition, if you have further clarifications or assistance on this matter, feel free to contact us again. But please note that, if you encounter different issues or have another concern in Google Ads API, I recommend you to create a new thread for better tracking and updates.

Have a great day.

Regards,

Google Logo
Marjorie
Google Ads API Team
 


ref:_00D1U1174p._5004Q2dtQGB:ref
Reply all
Reply to author
Forward
0 new messages