v201601 Batch job service error 403

150 views
Skip to first unread message

Clément Picou

unread,
Feb 18, 2016, 10:47:37 AM2/18/16
to AdWords API Forum
Hello,
since I've migrated to v201601 I've got a 403 error when I upload entities with the batch job service.
The job add operation works but the upload doesn't. The message is "Failed to upload operations for batch job."

Thank you 
Clément

Yin Niu

unread,
Feb 18, 2016, 11:16:04 AM2/18/16
to AdWords API Forum
Hi Clément,

Are you able to access the upload URL? What type of operations do you have in your batch job? 

Thanks,
Yin, AdWords API Team. 

Jbielsa

unread,
Feb 19, 2016, 2:07:10 AM2/19/16
to AdWords API Forum
In v201601, you need to make an additional call to exchange the bulk upload URL for a resumable upload URL. The relevant change in code is this line: https://github.com/googleads/googleads-dotnet-lib/blob/master/examples/AdWords/CSharp/v201601/CampaignManagement/AddCompleteCampaignsUsingBatchJob.cs#L163

Clément Picou

unread,
Feb 22, 2016, 6:06:51 AM2/22/16
to AdWords API Forum
Thank you. My bad, I didn't read the migration guide :-(

Now I've got another problem : when I try to get the completed job, the status is always "AWAITING_FILE" for a loooooong time (and I'm just uploading 30 campaigns), as if I didn't start the upload.
Here's my code (I'm using the .NET client library)  : 
int delay = MUTATE_JOB_DELAY;
            BatchJobUtilities batchJobUploadHelper = new BatchJobUtilities(_user);
            BatchJob batchJob = null;
            try
            {
                BatchJobOperation operation = new BatchJobOperation { @operator = Operator.ADD, operand = new BatchJob() };
                var res = _batchJobService.mutate(new BatchJobOperation[] { operation });

                if (res != null && res.value.Count() > 0)
                {
                    batchJob = res.value.FirstOrDefault();
                }
                else
                {
                    logger.Error("Unable to create job in account {CustomerId}", _customerId);
                    return -1;
                }
            }
            catch
            {
                return -1;
            }

            if (batchJob != null)
            {
                string uploadUrl = batchJob.uploadUrl.url;
                string resumableUploadUrl = batchJobUploadHelper.GetResumableUploadUrl(uploadUrl);
                for (int i = 0; i < NB_MUTATE_JOB_RETRIES; i++)
                {
                    try
                    {
                        batchJobUploadHelper.Upload(resumableUploadUrl, operations);
                        return batchJob.id;
                    }
                    catch(Exception e)
                    {
                        Thread.Sleep(delay);
                        delay = (int)(delay * 1.33);
                    }
                }
                logger.Error("Unable to upload operations in account {CustomerId} after "+NB_MUTATE_JOB_RETRIES+" retries", _customerId);
                return -1;
            }
            else
            {
                logger.Error("Unable to create job in account {CustomerId}", _customerId);
                return -1;
            }

Thank you

Jbielsa

unread,
Feb 22, 2016, 6:25:03 AM2/22/16
to AdWords API Forum
Hi. 

On Feb 16. There is a question with title "BatchJobService not completing" about the AWAITING FILE STATUS and Google respond with "The engineering team is working on this issue. We will update you once the issue is fixed."

Yin Niu

unread,
Feb 23, 2016, 11:01:53 AM2/23/16
to AdWords API Forum
Hello, 

This has been fixed. Please try again. 

Clément Picou

unread,
Feb 23, 2016, 11:30:51 AM2/23/16
to AdWords API Forum
It still doesn't work, but the problem has evolved :-)

The job status is DONE but the problem is when I download the results : 
- I've got the same number of mutate results than of operations. That's ok
- Foreach mutateresult, errorlist is not null but errorlist.errors is null
- Foreach mutateresult, mutateresult.result is null
- No entity has been published

Thank you
Clément

Yin Niu

unread,
Feb 23, 2016, 12:31:40 PM2/23/16
to AdWords API Forum
Hi Clément, 

Could you please send the SOAP request and response logs? Please click Reply privately to author in the forum when responding. 

Thanet Knack Praneenararat (AdWords API Team)

unread,
Mar 17, 2016, 3:09:33 AM3/17/16
to AdWords API Forum
Hi Clement,

The issue you've reported should be fixed now.
Please let us know if you still see those issues.

Best,
Thanet, AdWords API Team
Reply all
Reply to author
Forward
0 new messages