Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_all_disapproved_ads.py: "google.api_core.exceptions.InternalServerError: 500 Internal error encountered" #68

Closed
mbaader opened this issue Apr 2, 2019 · 11 comments
Assignees

Comments

@mbaader
Copy link

mbaader commented Apr 2, 2019

Hi,

when I'm running this example-code:

https://github.com/googleads/google-ads-python/blob/master/examples/campaign_management/get_all_disapproved_ads.py

... I keep getting the same error message (campaign.id and customerId redacted):

Request: {
"query": "SELECT ad_group_ad.ad.id, ad_group_ad.ad.type, ad_group_ad.policy_summary FROM ad_group_ad WHERE campaign.id = 1234567890",
"customerId": "1234567890",
"pageSize": 1000
}

Response

Headers: {
"request-id": "4YSRSCHSrLkHLNIIaUWIyA"
}
Fault: {
"created": "@1554112639.978011373",
"description": "Error received from peer",
"file": "src/core/lib/surface/call.cc",
"file_line": 1039,
"grpc_message": "Internal error encountered.",
"grpc_status": 13
}

The problem is persistant and replicable.
There are no disapproved ads in the campaigns affected but there are ads with multiple restrictions. I figure that these multiple restrictions are not handled correctly by the API.

Would you have someone look into it?

Regards
Mat

@BenRKarl
Copy link
Contributor

BenRKarl commented Apr 2, 2019

Hi @mbaader thanks you for submitting this issue! This is a known bug in the API that's being worked on currently. The hope is a solution will be released soon, but I can't say for sure exactly when. I'm going pin this issue for reference in case other users run into the same problem, and will follow up on it once the bugfix is released.

@BenRKarl BenRKarl self-assigned this Apr 2, 2019
@BenRKarl BenRKarl added bug Something isn't working and removed bug Something isn't working labels Apr 2, 2019
@BenRKarl BenRKarl pinned this issue Apr 2, 2019
@minguezalba
Copy link

Hi there,

Since this morning I am getting the same error when calling method: /google.ads.googleads.v1.services.CustomerClientLinkService/MutateCustomerClientLink

Here the request to generate a link with CustomerClientLinkService:

    link_service = manager_gads_client.get_service('CustomerClientLinkService', version='v1')
    status = manager_gads_client.get_type('ManagerLinkStatusEnum', version='v1')
    operation_create = manager_gads_client.get_type('CustomerClientLinkOperation', version='v1')

    link_create = operation_create.create
    link_create.client_customer.value = account_resource_name
    link_create.status = status.PENDING  # To send invitation must be PENDING

    try:
        mutate_link_response = link_service.mutate_customer_client_link(manager_id, operation_create)
    except ValueError:
        raise

Here the details of the exception:

grpc._channel._Rendezvous: <_Rendezvous of RPC that terminated with:

	status = StatusCode.INTERNAL
	details = "Internal error encountered."
	debug_error_string = "{"created":"@1554280012.041452270",
                               "description":"Error received from peer", 
                               "file":"src/core/lib/surface/call.cc", 
                               "file_line":1039,
                               "grpc_message": "Internal error encountered.",
                               "grpc_status":13}"

Are we talking about the same bug @BenRKarl mentioned? Any news about it?

Thank you very much!

Alba

@BenRKarl
Copy link
Contributor

BenRKarl commented Apr 3, 2019

Hi @minguezalba that appears to be a separate issue, would you mind filing a new Issue for it? And if you could share more of the logged response that would be very helpful.

@BenRKarl
Copy link
Contributor

BenRKarl commented Apr 3, 2019

@mbaader A bugfix for this issue was submitted and should resolve your problem querying for ad_group_ad.policy_summary. Can you try your script again to confirm?

@mbaader
Copy link
Author

mbaader commented Apr 4, 2019

Hi @BenRKarl ,

sadly I keep getting the same error:

`Request: {
"query": "SELECT ad_group_ad.ad.id, ad_group_ad.ad.type, ad_group_ad.policy_summary FROM ad_group_ad WHERE campaign.id = 1234567890",
"customerId": "1234567890",
"pageSize": 1000
}

Response

Headers: {
"request-id": "2zSpiQf41AuRy7TomhZVHg"
}
Fault: {
"created": "@1554355800.935678608",
"description": "Error received from peer",
"file": "src/core/lib/surface/call.cc",
"file_line": 1039,
"grpc_message": "Internal error encountered.",
"grpc_status": 13
}

[2019-04-04 07:30:00,936 - WARNING] Request made: ClientCustomerId: 1234567890, Host: googleads.googleapis.com:443, Method: /google.ads.googleads.v1.services.GoogleAdsService/Search, RequestId: None, IsFault: True, FaultMessage: Internal error encountered.
Traceback (most recent call last):
File "google_ads_check_single_customer.py", line 106, in
_DEFAULT_PAGE_SIZE)
File "google_ads_check_single_customer.py", line 48, in main
for row in results:
File "/usr/local/lib/python2.7/site-packages/google/api_core/page_iterator.py", line 204, in _items_iter
for page in self._page_iter(increment=False):
File "/usr/local/lib/python2.7/site-packages/google/api_core/page_iterator.py", line 235, in _page_iter
page = self._next_page()
File "/usr/local/lib/python2.7/site-packages/google/api_core/page_iterator.py", line 526, in _next_page
response = self._method(self._request)
File "/usr/local/lib/python2.7/site-packages/google/api_core/gapic_v1/method.py", line 143, in call
return wrapped_func(*args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/google/api_core/retry.py", line 270, in retry_wrapped_func
on_error=on_error,
File "/usr/local/lib/python2.7/site-packages/google/api_core/retry.py", line 179, in retry_target
return target()
File "/usr/local/lib/python2.7/site-packages/google/api_core/timeout.py", line 214, in func_with_timeout
return func(*args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/google/api_core/grpc_helpers.py", line 59, in error_remapped_callable
six.raise_from(exceptions.from_grpc_error(exc), exc)
File "/usr/local/lib/python2.7/site-packages/six.py", line 737, in raise_from
raise value
google.api_core.exceptions.InternalServerError: 500 Internal error encountered.`

@minguezalba
Copy link

Hi @BenRKarl , don't know why but, without changing anything from yesterday to today, now those lines work! Anyway, thanks you for your answer.

Regards,
Alba

@dafi-blinkhealth
Copy link

dafi-blinkhealth commented Apr 8, 2019

Hi, I'm also getting the same error for

offline_conversion_feed_service = client.get_service('ConversionUploadService', version='v1')
response = offline_conversion_feed_service.upload_click_conversions({customer_id}, {conversions}, {partial_failure})

Response:

<_Rendezvous of RPC that terminated with:
	status = StatusCode.INTERNAL
	details = "Internal error encountered."
	debug_error_string = "{"created":"@1554754992.576758000","description":"Error received from peer","file":"src/core/lib/surface/call.cc","file_line":1039,"grpc_message":"Internal error encountered.","grpc_status":13}"
>

Is this related?

@BenRKarl
Copy link
Contributor

BenRKarl commented Apr 9, 2019

@dafi-blinkhealth can you please paste in the complete error stack trace you're getting?

@mbaader
Copy link
Author

mbaader commented Apr 9, 2019

Hi Ben,

I checked again on a freshly installed python3 instance and the problem persists:

`Request: {
"customerId": "1234567890",
"query": "SELECT ad_group_ad.ad.id, ad_group_ad.ad.type, ad_group_ad.policy_summary FROM ad_group_ad WHERE campaign.id = 1234567890",
"pageSize": 1000
}

Response

Headers: {
"request-id": "aID3h6SjUBBUM9_YdDHWwA"
}
Fault: {
"created": "@1554817995.049278549",
"description": "Error received from peer",
"file": "src/core/lib/surface/call.cc",
"file_line": 1039,
"grpc_message": "Internal error encountered.",
"grpc_status": 13
}

[2019-04-09 15:53:15,049 - WARNING] Request made: ClientCustomerId: 1234567890, Host: googleads.googleapis.com:443, Method: /google.ads.googleads.v1.services.GoogleAdsService/Search, RequestId: None, IsFault: True, FaultMessage: Internal error encountered.
Traceback (most recent call last):
File "/home/ec2-user/.local/lib/python3.6/site-packages/google/api_core/grpc_helpers.py", line 57, in error_remapped_callable
return callable_(*args, **kwargs)
File "/home/ec2-user/.local/lib/python3.6/site-packages/grpc/_interceptor.py", line 215, in call
wait_for_ready=wait_for_ready)
File "/home/ec2-user/.local/lib/python3.6/site-packages/grpc/_interceptor.py", line 245, in _with_call
return call.result(), call
File "/home/ec2-user/.local/lib/python3.6/site-packages/grpc/_channel.py", line 294, in result
raise self
File "/home/ec2-user/.local/lib/python3.6/site-packages/grpc/_interceptor.py", line 236, in continuation
wait_for_ready=new_wait_for_ready)
File "/home/ec2-user/.local/lib/python3.6/site-packages/grpc/_interceptor.py", line 258, in with_call
wait_for_ready=wait_for_ready)
File "/home/ec2-user/.local/lib/python3.6/site-packages/grpc/_interceptor.py", line 245, in _with_call
return call.result(), call
File "/home/ec2-user/.local/lib/python3.6/site-packages/grpc/_channel.py", line 294, in result
raise self
File "/home/ec2-user/.local/lib/python3.6/site-packages/grpc/_interceptor.py", line 236, in continuation
wait_for_ready=new_wait_for_ready)
File "/home/ec2-user/.local/lib/python3.6/site-packages/grpc/_interceptor.py", line 258, in with_call
wait_for_ready=wait_for_ready)
File "/home/ec2-user/.local/lib/python3.6/site-packages/grpc/_interceptor.py", line 244, in _with_call
continuation, client_call_details, request)
File "/home/ec2-user/.local/lib/python3.6/site-packages/google/ads/google_ads/client.py", line 349, in intercept_unary_unary
self._handle_grpc_failure(response)
File "/home/ec2-user/.local/lib/python3.6/site-packages/google/ads/google_ads/client.py", line 328, in _handle_grpc_failure
raise exception
File "/home/ec2-user/.local/lib/python3.6/site-packages/grpc/_interceptor.py", line 236, in continuation
wait_for_ready=new_wait_for_ready)
File "/home/ec2-user/.local/lib/python3.6/site-packages/grpc/_channel.py", line 559, in with_call
return _end_unary_response_blocking(state, call, True, None)
File "/home/ec2-user/.local/lib/python3.6/site-packages/grpc/_channel.py", line 466, in _end_unary_response_blocking
raise _Rendezvous(state, None, None, deadline)
grpc._channel._Rendezvous: <_Rendezvous of RPC that terminated with:
status = StatusCode.INTERNAL
details = "Internal error encountered."
debug_error_string = "{"created":"@1554817995.049278549","description":"Error received from peer","file":"src/core/lib/surface/call.cc","file_line":1039,"grpc_message":"Internal error encountered.","grpc_status":13}"

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "google_ads_check_single_customer.py", line 106, in
_DEFAULT_PAGE_SIZE)
File "google_ads_check_single_customer.py", line 48, in main
for row in results:
File "/home/ec2-user/.local/lib/python3.6/site-packages/google/api_core/page_iterator.py", line 204, in _items_iter
for page in self._page_iter(increment=False):
File "/home/ec2-user/.local/lib/python3.6/site-packages/google/api_core/page_iterator.py", line 235, in _page_iter
page = self._next_page()
File "/home/ec2-user/.local/lib/python3.6/site-packages/google/api_core/page_iterator.py", line 526, in _next_page
response = self._method(self._request)
File "/home/ec2-user/.local/lib/python3.6/site-packages/google/api_core/gapic_v1/method.py", line 143, in call
return wrapped_func(*args, **kwargs)
File "/home/ec2-user/.local/lib/python3.6/site-packages/google/api_core/retry.py", line 270, in retry_wrapped_func
on_error=on_error,
File "/home/ec2-user/.local/lib/python3.6/site-packages/google/api_core/retry.py", line 179, in retry_target
return target()
File "/home/ec2-user/.local/lib/python3.6/site-packages/google/api_core/timeout.py", line 214, in func_with_timeout
return func(*args, **kwargs)
File "/home/ec2-user/.local/lib/python3.6/site-packages/google/api_core/grpc_helpers.py", line 59, in error_remapped_callable
six.raise_from(exceptions.from_grpc_error(exc), exc)
File "", line 3, in raise_from
google.api_core.exceptions.InternalServerError: 500 Internal error encountered.
`

@dafi-blinkhealth
Copy link

@BenRKarl here it is. It's quite similar with what @mbaader is having, grpc error from six

  File "/Users/muhammad.khadafi/.pyenv/versions/2.7.15/lib/python2.7/site-packages/google/ads/google_ads/v1/services/conversion_upload_service_client.py", line 220, in upload_click_conversions
    request, retry=retry, timeout=timeout, metadata=metadata)
  File "/Users/muhammad.khadafi/.pyenv/versions/2.7.15/lib/python2.7/site-packages/google/api_core/gapic_v1/method.py", line 143, in __call__
    return wrapped_func(*args, **kwargs)
  File "/Users/muhammad.khadafi/.pyenv/versions/2.7.15/lib/python2.7/site-packages/google/api_core/retry.py", line 270, in retry_wrapped_func
    on_error=on_error,
  File "/Users/muhammad.khadafi/.pyenv/versions/2.7.15/lib/python2.7/site-packages/google/api_core/retry.py", line 179, in retry_target
    return target()
  File "/Users/muhammad.khadafi/.pyenv/versions/2.7.15/lib/python2.7/site-packages/google/api_core/timeout.py", line 214, in func_with_timeout
    return func(*args, **kwargs)
  File "/Users/muhammad.khadafi/.pyenv/versions/2.7.15/lib/python2.7/site-packages/google/api_core/grpc_helpers.py", line 59, in error_remapped_callable
    six.raise_from(exceptions.from_grpc_error(exc), exc)
  File "/Users/muhammad.khadafi/.pyenv/versions/2.7.15/lib/python2.7/site-packages/six.py", line 737, in raise_from
    raise value
google.api_core.exceptions.InternalServerError: 500 Internal error encountered.

I've tried it on 2.7.15 and 3.6.6

@mbaader
Copy link
Author

mbaader commented Apr 12, 2019

Hi Ben,

fyi: as of today, this error seems to be fixed. The get_all_disapproved_ads.py and our tools don't throw this error anymore.

Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants