googleads / google-ads-python

Google Ads API Client Library for Python
Apache License 2.0
530 stars 481 forks source link

Google Ads v12 support for Protobuf3 #763

Closed bbalbon closed 1 year ago

bbalbon commented 1 year ago

Describe the bug: With the deprecation of v11, we can no longer use release 18.0 of this package which was the last version that supported protobuf3. Protobuf4 is not supported by our current infrastructure and is required for release 19.0/v12 protobuf>=4.21.5 (from google-ads==21.0.0).

  1. I'm wondering if you have any recommendations on how we can circumvent this protobuf requirement or use a deprecated version of the API. As an immediate bandaid we are using an isolated, lightweight service to initiate the calls to Google Ads using release 21.0 but this is a bit of a headache to setup and maintain.
  2. Is there anything we can do to be alerted of new Ads API versions and/or google-ads-python package releases? We have admin accounts in the Google Ads UI but we didn't receive a deprecation alert via email similar to what we got for the GoogleAdwords deprecation.

Steps to Reproduce: protobuf==3.20.0 google-ads==18.0.0 Expected behavior: N/A Client library version and API version: Client library version: 18 Google Ads API version: v11

-- Request/Response Logs:

terminated with:
    status = StatusCode.INVALID_ARGUMENT
    details = "Request contains an invalid argument."
    debug_error_string = "{"created":"@1680292107.332171285","description":"Error received from peer ipv4:10.46.141.41:10001","file":"src/core/lib/surface/call.cc","file_line":952,"grpc_message":"Request contains an invalid argument.","grpc_status":3}"
>, <_InactiveRpcError of RPC that terminated with:
    status = StatusCode.INVALID_ARGUMENT
    details = "Request contains an invalid argument."
    debug_error_string = "{"created":"@1680292107.332171285","description":"Error received from peer ipv4:10.46.141.41:10001","file":"src/core/lib/surface/call.cc","file_line":952,"grpc_message":"Request contains an invalid argument.","grpc_status":3}"
>, errors {
  error_code {
    request_error: UNKNOWN
  }
  message: "Version v11 is deprecated. Requests to this version will be blocked."
}
request_id: "D3T01e1himOThXb63v6Wvw"
, 'D3T01e1himOThXb63v6Wvw')

Anything else we should know about your project / environment: cc: @BenRKarl @g3or3

bobhancockg commented 1 year ago

Could you tell us what part of your infrastructure does not support protobuf v4? Is it a third party package like Apache Beam?

bbalbon commented 1 year ago

Unfortunately it's an internal library that we can't move to Protobuf4 anytime soon. I suppose we're kinda stuck here then ...

Luiz-Cruz commented 1 year ago

I am having the same problem, is there a temporary way to get the 17.0.0 API version to use v11?

I can't even use version 21.0.0 because it asks for protobuf in version >=4.21.5. but when I try to install this version of protobuf, I get the error that google-ads needs protobuf in version 3.20.0, how is it possible that google-ads lib needs two versions of protobuf at the same time? This looks like a bug.

Luiz-Cruz commented 1 year ago

@bbalbon are you able to use the lib normally? I wonder if there is any way I can use the lib, because I was using version 17.0.0 with the services in v11, but now they don't work anymore. I had to update the google-ads lib but now I am getting errors with the protobuf lib and can't get it to work.

bobhancock commented 1 year ago

v11 was sunset on 29 March 2023. It is not longer available. We announced the sunset on the Devsite in May 2022.

protobuf published version 4.x in May 2022 and as with all open source software they will support it for a year until May 2023. It won't be going away, but no functionality will be back ported nor will any security fixes be applied.

If you want to use the Google Ads API =>v12, you can try lowering the requirements as I've listed below. This is only guidance and we can not support this approach. With the rapidly approaching sunset of protobuf 3.x, we strongly recommend that you ensure that your dependencies are upgraded.

If you feel confident, you can fork a version of our library and modify the following dependencies. Github comments do not render spaces as fixed characters, so, I have used || to separate the columns

Dependency || Google Ads Version || Modified Version google-api-core || >= 2.10.1, <= 2.11.0 || >= 2.8.1, < 3.0.0dev, !=2.0., != 2.1., !=2.2., !=2.3.0 proto-plus || >= 1.22.1, < 1.23 || == 1.19.6 protobuf || >= 4.21.5 || >= 3.12.0, <= 3.20.0, !=3.18., !=3.19.*

You will experience slower performance but you should be able to get the same functionality. Again, we cannot support this and it is provided only as guidance.

bbalbon commented 1 year ago

@bobhancock thanks for the response, yeah we're actually on a lower Protobuf version than that so unfortunately we need to create a separate proxy service to handle the calls here. @Luiz-Cruz we weren't able to get it to work without upgrading to the newer version via a proxy service, sorry.