RE: AddBatchJobOperations returns Internal error encountered.

116 views
Skip to first unread message
Message has been deleted

Google Ads API Forum Advisor

unread,
Mar 8, 2023, 5:47:55 AM3/8/23
to lakaen...@gmail.com, adwor...@googlegroups.com
Hi Jing,

Thank you for reaching out to the Google Ads API support team. I hope that you are doing well today.

Regarding the issue, it appears that this is about experiencing an Internal Error when creating Billing Setup through both Google Ads UI and API. This error means something unexpected happened while processing the request. The common cause of this error is that the API isn't functioning correctly due to a bug. As per this retryable errors guide, some errors, such as TRANSIENT_ERROR or INTERNAL_ERROR, can indicate a temporary problem that may be resolved by retrying the request after a short pause. As mentioned also in the said guide, we recommend that when you retry requests, use an exponential backoff policy. For example, if you first pause 5 seconds before the first retry, you could pause 10 seconds after the second and 20 seconds after the third retry. Exponential backoff helps ensure you are not calling the API too aggressively.

If the issue persists, you may then send us the updated complete request and response logs with the request ID and request header generated on your end for further investigation.

You can provide it via Reply privately to the author option. If this option is not available, then send it instead on this email address googleadsa...@google.com.

Kind regards,
Google Logo Google Ads API Team


ref:_00D1U1174p._5004Q2jXDA8:ref
Message has been deleted

Google Ads API Forum Advisor

unread,
Mar 8, 2023, 12:48:16 PM3/8/23
to lakaen...@gmail.com, adwor...@googlegroups.com

Hi Jing, 

Thank you for coming back to us. I hope you are doing well today.

Thank you for providing complete logs. Moving forward to the concern about the internal error, could you please confirm to us that you already follow the guideline provided before? Let me reiterate below for reference.

“The common cause of this Internal Error error is that the API isn't functioning correctly due to a bug. As per this retryable errors guide, some errors, such as TRANSIENT_ERROR or INTERNAL_ERROR, can indicate a temporary problem that may be resolved by retrying the request after a short pause. As mentioned also in the said guide, we recommend that when you retry requests, use an exponential backoff policy. For example, if you first pause 5 seconds before the first retry, you could pause 10 seconds after the second and 20 seconds after the third retry. Exponential backoff helps ensure you are not calling the API too aggressively.”

I ask this as this will help to raise your concern with the rest of the team for further investigation on this matter and find right recommendations.

Thank you for your patience and understanding. Have a great day.

Regards,

Jing CHEN

unread,
Mar 8, 2023, 9:04:12 PM3/8/23
to Google Ads API and AdWords API Forum
hi
I have already tried using exponential backoff for retries, but it still keeps returning errors. Meanwhile, batch operations to add no more than 4 campaigns are successful. Do you need more information from me? I can provide it. Thank you for your reply and have a pleasant day!

Google Ads API Forum Advisor

unread,
Mar 9, 2023, 4:52:30 AM3/9/23
to lakaen...@gmail.com, adwor...@googlegroups.com
Hi Jing,

Thank you for getting back to us.

I understand your concern, however please consider the Best Practices and Limitations of Batch Processing.
  • For better throughput, fewer larger jobs is preferred over many smaller jobs.
  • It is recommended to add no more than 1,000 operations per AddBatchJobOperationsRequest and use the sequence_token to upload the rest of the operations to the same job. Depending on the content of the operations, too many operations in a single AddBatchJobOperationsRequest could cause a REQUEST_TOO_LARGE error. You can handle this error by reducing the number of operations and retrying the AddBatchJobOperationsRequest.
  • When submitting multiple concurrent jobs for the same account, try to reduce the likelihood of jobs operating on the same objects at the same time, while maintaining large job sizes. Many unfinished jobs (with status of RUNNING) that try to mutate the same set of objects can lead to deadlock-like conditions resulting in severe slow-down and even job failures.
  • Don't submit multiple operations that mutate the same object in the same job, as the result can be unpredictable.
  • For better throughput, order uploaded operations by operation type. For example, if your job contains operations to add campaigns, ad groups, and ad group criteria, order the operations in your upload so that all of the campaign operations are first, followed by all of the ad group operations, and finally all ad group criterion operations.
  • Don't poll the job status too frequently or you risk hitting rate limit errors.
  • Don't retrieve more than 1,000 results per page. The server could return fewer than that due to load or other factors.
  • The results order will be the same as the upload order for batch processing.
  • You can set an upper bound for how long a batch job is allowed to run before being cancelled. When creating a new batch job, set the metadata.execution_limit_seconds field to your preferred time limit, in seconds. There is no default time limit if metadata.execution_limit_seconds is not set.

Furthermore, I would like you to know that we are going to delete your posts here on this forum as it contains confidential information such as the logs that you've provided.

I hope this helps.

Kind regards,

Jing CHEN

unread,
Mar 13, 2023, 12:26:17 PM3/13/23
to Google Ads API and AdWords API Forum
Hello, I confirm that I have not violated any restrictions. In the test code, I only added 5 campaigns to an account, but I kept getting internal errors in AddBatchJobOperations. However, when I split the task into 3 and 2 campaigns respectively, it worked fine again, which is very strange! If that's the case, I'll have to split all batch jobs into groups of 3, which is unnecessary and very slow to execute. I really need your help. If necessary, I can send you my code and logs via private message. I hope to solve this problem. Best wishes.

Google Ads API Forum Advisor

unread,
Mar 14, 2023, 1:50:55 AM3/14/23
to lakaen...@gmail.com, adwor...@googlegroups.com
Hi Jing,

That would be great. Could you please provide us the complete request and response logs with the request ID and request header generated on your end while executing a batch job? Please provide us both successful and the one that you encountered an internal error. This will help us If you haven't enabled the logging yet, logging can be enabled by navigating to the Client libraries > Your client library (ex. Java) > Logging documentation, which you can access from this link.


You can provide it via Reply privately to the author option. If this option is not available, then send it instead on this email address googleadsa...@google.com.

Reply all
Reply to author
Forward
0 new messages