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

Mutate gender bid: google.api_core.exceptions.InternalServerError: 500 Internal error encountered. #222

Closed
ricardocancar opened this issue Feb 14, 2020 · 12 comments
Assignees

Comments

@ricardocancar
Copy link

Hi,
this is one operator example to modify the age bid
operator example
update {
resource_name: "customers/customer_id/adGroupCriteria/ad_group_id~503006"
bid_modifier {
value: 0.9
}
}
update_mask {
paths: "resource_name"
paths: "bid_modifier"
}

I getting the following error

Response

Fault: {
"created": "@1581675413.638711689","description":"Error received from peer ipv4:74.125.193.95:443",
"file": "src/core/lib/surface/call.cc",
"file_line": 1056,
"grpc_message": "Internal error encountered.",
"grpc_status": 13
}

I checked that the ad_group_id exist and is enable the criterion id 503006 is enable also and
the campaign type is search this code were working before and the error doesn't give me some information

i just trying to change our bid by age target.
this is the output that i get when I run this code.

 ad_group_service = client.get_service('AdGroupService', version='v2')
 
operators = []
 for ad_group_id in changes['ad_group_id']:
      for mutation in changes['demographic_adjustments']:
            ad_group_criterion_operation = client.get_type(
                    'AdGroupCriterionOperation')
            # update operation to modify the bid for device
            ad_group_criterion = ad_group_criterion_operation.update
           # Set the campaign path we want to update
            ad_group_criterion.resource_name =\
                 agc_service.ad_group_criteria_path(
                      customer_id, '%s~%s' % (ad_group_id,
                                             mutation['criterion_id']))
            # update the bid for each device
            bid_modifier_value = 1 + mutation['recommended_bid_ajustment']
            ad_group_criterion.bid_modifier.value = bid_modifier_value
            fm = protobuf_helpers.field_mask(None, ad_group_criterion)
            ad_group_criterion_operation.update_mask.CopyFrom(fm)
            operators.append(ad_group_criterion_operation)

ad_group_criterion_response = (
           agc_service.mutate_ad_group_criteria(
                customer_id, operators))



thanks: Ricardo 
@wihl
Copy link
Contributor

wihl commented Feb 14, 2020

Your code snippet looks fine. You may have found a bug in the server. Please email googleadsapi-support@google.com with private information like your DevToken, customer Id, request id, etc. Mention this GitHub issue as ask them to escalate the case to David Wihl. We can then do a more detailed investigation. Thanks for the bug report!

@wihl wihl self-assigned this Feb 14, 2020
@wihl
Copy link
Contributor

wihl commented Feb 17, 2020

See this line for an example of retrieving the request id.

@ricardocancar
Copy link
Author

it return a None Request_id

[WARNING] 2020-02-17T16:48:58.960Z Request made: ClientCustomerId: customer_id, Host: googleads.googleapis.com:443, Method: /google.ads.googleads.v2.services.AdGroupCriterionService/MutateAdGroupCriteria, RequestId: None, IsFault: True, FaultMessage: Internal error encountered.

@ricardocancar
Copy link
Author

Also I have this header:

Host: googleads.googleapis.com:443
Headers: {
  "developer-token": "token",
  "login-customer-id": "login_id",
  "x-goog-api-client": "gl-python/3.6.9 grpc/1.26.0 gax/1.16.0 gapic/4.0.0",
  "x-goog-request-params": "customer_id=customer"
}

My python version is below than 3.7 and I using google-ads==4.0.0 this may be the problem, but when I downgrade the google ads library, I have the same issue.

@wihl
Copy link
Contributor

wihl commented Feb 17, 2020

I don't think it is an issue with Python 3.6 / google-ads=4.0.0. Thanks for the additional information.

@ricardocancar
Copy link
Author

ricardocancar commented Feb 18, 2020 via email

@elviskahoro
Copy link

elviskahoro commented Mar 29, 2020

Hey David (@wihl).

I'm having a similar error response (Internal Error Encountered) but through a call to the KeywordPlanService: client.get_type('KeywordPlanForecastIntervalEnum', version='v3')

The script I'm running is an almost exact copy from: examples/planning/add_keyword_plan.py

Here's the error
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":"@1585381494.191782000","description":"Error received from peer ipv4:64.233.185.95:443","file":"src/core/lib/surface/call.cc","file_line":1055,"grpc_message":"Internal error encountered.","grpc_status":13}"

@BenRKarl
Copy link
Contributor

@ricardocancar @elviskahoro thanks for raising this issue. Does this problem occur consistently or is it always reproducible? Can you each share your version of Python, the version of the Google Ads API you're using (i.e version='v2' when calling client.get_service) and the result of running pip freeze so that I can try to reproduce myself?

@ricardocancar
Copy link
Author

ricardocancar commented Mar 30, 2020 via email

@elviskahoro
Copy link

I've tried both the MCC for our manager account and the ads account.

keyword_plan_service` = client.get_service('KeywordPlanService', version='v3')

breaks on this following line

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

PIP Freeze (python 3.7.3)
google-ads==5.0.2
google-api-core==1.16.0
google-auth==1.7.1
google-auth-oauthlib==0.4.1
google-pasta==0.1.8
googleapis-common-protos==1.51.0

Same line: 1055 as rivardo
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":"@1586014796.743902000","description":"Error received from peer ipv4:172.217.2.42:443","file":"src/core/lib/surface/call.cc","file_line":1055,"grpc_message":"Internal error encountered.","grpc_status":13}"

@BenRKarl
Copy link
Contributor

BenRKarl commented Jun 1, 2020

@elviskahoro That error might indicate that an exception was returned by the API that this library doesn't know how to handle. You can print the error details by printing the raw trailing_metadata by inserting a print statement like this. Can you try adding this print statement and pasting the trailing metadata here? Be sure to scan the output and remove any credentials, such as your CID or developer token, before pasting.

@BenRKarl BenRKarl self-assigned this Jun 1, 2020
@BenRKarl
Copy link
Contributor

@elviskahoro closing this out, assuming the issue has been resolved by now. Please reopen if that's not the case.

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

4 participants