Bad Gateway Errors when using BulkMutateJobServiceInterface.mutate() in Java Client API

18 views
Skip to first unread message

rz

unread,
Nov 23, 2009, 8:03:07 AM11/23/09
to AdWords API Forum
Greetings, API Team !

Language : Java
API Version : V200909
Service : BulkMutateJobServiceInterface
Using Sandbox

We are currently trying to test our Upload-Tool to upload _big_
Campaigns, consisting of several thousand AdGroups and ca. 4-5 TextAds
and 5-10 Keywords per AdGroup. Unfortunately it does not seem possible
to upload all Artefacts in one go (would be _the_ Killer-Feature,
really ...), so we structured our upload to use

- CampaignService.mutate() to upload one Campaign
- several(mostly just one) call(s) to bulkService.mutate() with n
CampaignCriterions
- several calls to bulkService.mutate() with n AdGroups
- several calls to bulkService.mutate() with n AdGroupCriterions
- several calls to bulkService.mutate() with n AdGroupAds

When using the sandbox at least, the aforementioned 'n' lies between
250 - 500. Anything larger, and the chance for 502 Bad Gateway Errors
increases dramatically.
My question is now: Is the 'n' in a range that constitutes an
unadvised 'Load Test' ? If that should be the case, how can I test
bigger 'n' ? I'd rather not (soap-)mock your Services :)

Cheers,
rainer

rz

unread,
Nov 23, 2009, 8:19:40 AM11/23/09
to AdWords API Forum
Ooops, I just now remembered what my original question was :)

In case of an error like Bad Gateway or something similar connection
related, what happens to the BulkMutateJob ? Is it discarded ? Can I
safely assume that no processing has taken place on the server side
and try to upload the same BulkJob again (maybe sometime later) ?

Cheers,
rainer

AdWords API Advisor

unread,
Nov 23, 2009, 2:05:48 PM11/23/09
to AdWords API Forum
Hi Rainer,

For which requests are you receiving the 502 errors? Are you
splitting your requests into multiple operation streams and multiple
parts?

Best,
- Eric Koleda, AdWords API Team

rz

unread,
Nov 23, 2009, 2:30:19 PM11/23/09
to AdWords API Forum
> For which requests are you receiving the 502 errors?  Are you
> splitting your requests into multiple operation streams and multiple
> parts?
Our tests use only one OperationStream á 200-500 artefacts and one
Request per Job. Please note that these errors only seem to appear
when using the Sandbox-Environment.


I am currently having a test running that uses a real account with 40
AdGroups that have 10 AdGroupCriterions and 10 TextAds each. We have
not experienced Bad Gateway errors so far. I am currently waiting for
the last Job (400 TextAds in 4 OperationStreams in 4 RequestParts) to
finish (It's running for over 40minutes now ...). The previous job,
having 400 AdGroupCriterions, finished in under 5min. Is it normal to
wait this long for a (fairly normal) Job to finish ?

Also: is there an operation/call that cancels a job ?

Cheerfully waiting (and waiting and ... :),
rainer

AdWords API Advisor

unread,
Nov 23, 2009, 6:54:54 PM11/23/09
to AdWords API Forum
Hi Rainer,

A key feature of the BulkMutateJobService is the ability to submit the
job in multiple parts. Very large requests can be problematic, as
server and client side limitations exist that can lead to timeouts,
502 errors, etc. For this reason we recommend breaking up large
requests into multiple operation streams and/or parts. An example of
using multiple parts can be found here:

http://adwordsapi.blogspot.com/2009/10/asynchronous-requests-with.html

Unfortunately it isn't possible to cancel a running job. The running
time of the job depends on the type of operations in the job, so the
time you are seeing may be appropriate.

Best,
- Eric

rz

unread,
Nov 24, 2009, 2:43:27 AM11/24/09
to AdWords API Forum
Hi Eric,

sorry, I was not to clear on what I meant with regards to canceling a
job. We are already using multiple parts. I'd like to know if there is
possibility to cancel an incomplete job (in the sense that the job has
not received all of its parts yet). Do I have to submit as many dummy-
jobs as there are parts outstanding so that the job may begin running
with the operations that were already uploaded ? Or can I just set the
total nrOfParts to partsReceived ? The blog posts were very
informative, although I knew them already ;)

Some other (partly related) question: When using mutate() of other
services besides BulkMutateJobService, are these mutate-calls "atomic"
too in the sense that either all of them succeed or fail ?

Cheers,
rainer

AdWords API Advisor

unread,
Nov 24, 2009, 4:28:36 PM11/24/09
to AdWords API Forum
Hi Rainer,

It is not currently possible to cancel a job, even if it hasn't
started running yet. If you want to remove that job you must send the
correct number or parts, you can't skip parts, and each part must
contain at least one operation.

Best,
- Eric

rz

unread,
Nov 25, 2009, 3:49:51 AM11/25/09
to AdWords API Forum
Hi Eric,

Thanks for the clarification !

To come back to my other question :
When using the "mutate()" call of other services besides
BulkMutateJobService, e.g. "AdGroupAdService.mutate()", and there are
errors (PolicyViolation or DatabaseError or QuotaCheckError or ...)
can we assume that none of the operations in this call have been
performed/persisted ?

Cheers, rainer

AdWords API Advisor

unread,
Nov 25, 2009, 4:38:38 PM11/25/09
to AdWords API Forum
Hi Rainer,

When using the other campaign management services (CampaignService,
AdGroupService, etc), if there are any errors in the request then none
of the operations will be committed.

Best,
- Eric

rz

unread,
Nov 26, 2009, 4:53:11 AM11/26/09
to AdWords API Forum
Hi Eric !

Thanks again for clarification, this particular info should make it
into the docs =)

Cheers,
rainer
Reply all
Reply to author
Forward
0 new messages