When running the example create_and_attach_shared_keyword_set.py with the latest Python client 4.1.1 release, I'm getting the following error. I've also posted the issue in the Github python client issue section, but I'm wondering if there are limitations on what types of campaigns I can apply the shared keyword set to? In my case, I was trying to attach the shared keywords to a video campaign. Is this also the case for shared negative placements set? The strange thing is that it use to work but now is broken.
Created shared criterion "customers/{obfuscated}/sharedCriteria/{obfuscated}~{obfuscated}".
Created shared criterion "customers/{obfuscated}/sharedCriteria/{obfuscated}~{obfuscated}".
Request made: ClientCustomerId: {obfuscated}, Host: googleads.googleapis.com:443, Method: /google.ads.googleads.v2.services.CampaignSharedSetService/MutateCampaignSharedSets, RequestId: None, IsFault: True, FaultMessage: None
Traceback (most recent call last):
File "/Users/{obfuscated}/Projects/google-ads-python/examples/advanced_operations/create_and_attach_shared_keyword_set.py", line 130, in <module>
main(google_ads_client, args.customer_id, args.campaign_id)
File "/Users/{obfuscated}/Projects/google-ads-python/examples/advanced_operations/create_and_attach_shared_keyword_set.py", line 99, in main
customer_id, [campaign_set_operation]).results[0].resource_name)
File "/Users/{obfuscated}/.local/share/virtualenvs/google-ads-python-ObS9Yvf7/lib/python3.7/site-packages/google/ads/google_ads/v2/services/campaign_shared_set_service_client.py", line 402, in mutate_campaign_shared_sets
return self._inner_api_calls['mutate_campaign_shared_sets'](request, retry=retry, timeout=timeout, metadata=metadata)
File "/Users/{obfuscated}/.local/share/virtualenvs/google-ads-python-ObS9Yvf7/lib/python3.7/site-packages/google/api_core/gapic_v1/method.py", line 143, in __call__
return wrapped_func(*args, **kwargs)
File "/Users/{obfuscated}/.local/share/virtualenvs/google-ads-python-ObS9Yvf7/lib/python3.7/site-packages/google/api_core/retry.py", line 286, in retry_wrapped_func
on_error=on_error,
File "/Users/{obfuscated}/.local/share/virtualenvs/google-ads-python-ObS9Yvf7/lib/python3.7/site-packages/google/api_core/retry.py", line 184, in retry_target
return target()
File "/Users/{obfuscated}/.local/share/virtualenvs/google-ads-python-ObS9Yvf7/lib/python3.7/site-packages/google/api_core/timeout.py", line 214, in func_with_timeout
return func(*args, **kwargs)
File "/Users/{obfuscated}/.local/share/virtualenvs/google-ads-python-ObS9Yvf7/lib/python3.7/site-packages/google/api_core/grpc_helpers.py", line 57, in error_remapped_callable
return callable_(*args, **kwargs)
File "/Users/{obfuscated}/.local/share/virtualenvs/google-ads-python-ObS9Yvf7/lib/python3.7/site-packages/grpc/_interceptor.py", line 222, in __call__
compression=compression)
File "/Users/{obfuscated}/.local/share/virtualenvs/google-ads-python-ObS9Yvf7/lib/python3.7/site-packages/grpc/_interceptor.py", line 257, in _with_call
return call.result(), call
File "/Users/{obfuscated}/.local/share/virtualenvs/google-ads-python-ObS9Yvf7/lib/python3.7/site-packages/grpc/_interceptor.py", line 126, in result
raise self._exception
File "/Users/{obfuscated}/.local/share/virtualenvs/google-ads-python-ObS9Yvf7/lib/python3.7/site-packages/grpc/_interceptor.py", line 248, in continuation
compression=new_compression)
File "/Users/{obfuscated}/.local/share/virtualenvs/google-ads-python-ObS9Yvf7/lib/python3.7/site-packages/grpc/_interceptor.py", line 272, in with_call
compression=compression)
File "/Users/{obfuscated}/.local/share/virtualenvs/google-ads-python-ObS9Yvf7/lib/python3.7/site-packages/grpc/_interceptor.py", line 257, in _with_call
return call.result(), call
File "/Users/{obfuscated}/.local/share/virtualenvs/google-ads-python-ObS9Yvf7/lib/python3.7/site-packages/grpc/_interceptor.py", line 126, in result
raise self._exception
File "/Users/{obfuscated}/.local/share/virtualenvs/google-ads-python-ObS9Yvf7/lib/python3.7/site-packages/grpc/_interceptor.py", line 248, in continuation
compression=new_compression)
File "/Users/{obfuscated}/.local/share/virtualenvs/google-ads-python-ObS9Yvf7/lib/python3.7/site-packages/grpc/_interceptor.py", line 272, in with_call
compression=compression)
File "/Users/{obfuscated}/.local/share/virtualenvs/google-ads-python-ObS9Yvf7/lib/python3.7/site-packages/grpc/_interceptor.py", line 256, in _with_call
continuation, client_call_details, request)
File "/Users/{obfuscated}/.local/share/virtualenvs/google-ads-python-ObS9Yvf7/lib/python3.7/site-packages/google/ads/google_ads/interceptors/exception_interceptor.py", line 139, in intercept_unary_unary
self._handle_grpc_failure(response)
File "/Users/{obfuscated}/.local/share/virtualenvs/google-ads-python-ObS9Yvf7/lib/python3.7/site-packages/google/ads/google_ads/interceptors/exception_interceptor.py", line 105, in _handle_grpc_failure
google_ads_failure = self._get_google_ads_failure(trailing_metadata)
File "/Users/{obfuscated}/.local/share/virtualenvs/google-ads-python-ObS9Yvf7/lib/python3.7/site-packages/google/ads/google_ads/interceptors/exception_interceptor.py", line 68, in _get_google_ads_failure
ga_failure = error_protos.errors_pb2.GoogleAdsFailure()
AttributeError: module 'google.ads.google_ads.v2.proto.errors' has no attribute 'errors_pb2Hi Michael,
Thank you for reaching out. It looks like it’s a setup issue in which there could have been a problem with the way the client library was installed, in which it is not reading the attribute file ‘errors_pb2’ while the the attribute is being used in the script. In this case I would recommend you to re-download and install the latest version of our client library to remedy setup issues. For Google Ads Python, you can find the latest version here. Could you give that a try and let me know if you still run into issues with attaching the shared keyword set to your video campaign, as they should be able to have shared sets?
Thank you,
Bryan, Google Ads API Team
Hi Michael,
Thank you for the information. I tried applying a shared keyword set to a test video campaign and I did not run into any issues. If you use an old version of our client libraries, you may encounter the “INVALID_ARGUMENT” issue. For your previous issue with “AttributeError”, I advise that you reinstall the client library and give the query another try using the "create_an_attach_shared_keyword_set.py" file. Could you let me know if the video campaign is still giving you issues?
Thank you,
Bryan, Google Ads API Team