Skip to content

batch_job['DownloadUrl'] sometimes is null #305

Closed as not planned
Closed as not planned

Description

@sliu-walmart

We’ve been using the same pattern of accessing AdWords batch service as this example. However, since about 10 days ago after we upgraded our python googleads library to 12.2.0 from 9.0.0, we started to receive intermittent issues with these two lines.

The error message quoted below seems to indicate the batch_job[‘downloadUrl’] object is null even if the “downloadUrl” key is present in the batch_job object.

url = batch_job['downloadUrl']['url']
TypeError: 'NoneType' object has no attribute '__getitem__'

Retry the script usually eventually fixes this issue, but every day we got some jobs failing too many times even after retrying and people getting the alert messages have to manually retry the jobs. We looked up the releasing notes from version 10.0.0 but couldn’t find anything related.

Can you check what is causing this issue and what should be the best practice for us moving forward?

Activity

  1. msaniscalchi commented on Jul 18, 2018

    @msaniscalchi
    Contributor

    Hello,

    Thanks for the report! Some additional context may be helpful:

    • What Python version are you using?
    • Are you using the suds-jurko library or zeep as your SOAP client?
    • Does this happen for a specific type of operation?
    • Does this tend to happen for large jobs? How large are those you're running when this happens?
    • Do you have a trivialized example that can be used to reproduce?

    Regards,
    Mark

  2. self-assigned this
    on Jul 18, 2018
  3. sliu-walmart commented on Jul 18, 2018

    @sliu-walmart
    Author

    @msaniscalchi Thanks for looking into this. Please see below for my responses.

    • We're using Python 2.7.11.
    • We didn't manually install any SOAP client lib, but pip shows we have suds-jurko 0.6 and zeep 3.0.0 installed.
    • The error happens when we're creating either entire campaign structure or ad groups in existing campaigns.
    • The size of jobs doesn't appear to be a factor. We've seen this occurring for jobs with just ~400 entities to jobs with several thousand entities.
    • We don't have examples for easy reproduction of the issue. As I said repeated retrying eventually would go through.
  4. ravichandrasekaran commented on Dec 30, 2018

    @ravichandrasekaran

    We just starting seeing a very similar error on upgrading from API version v201802 to v201809 and upgrading our Python package from 10.0.1 to 15.0.1.

    url = batch_job['downloadUrl']['url']
    TypeError: 'NoneType' object is not subscriptable
    

    One change we made was to explicitly look for a 'DONE' batch job status, rather than relying only on the presence of the 'downloadUrl' property. It's hard to tell if that solved the problem, or if simply retrying it avoided the failure.

  5. christopherseeley commented on Mar 25, 2024

    @christopherseeley
    Member

    The AdWords API has been turned down and replaced by the Google Ads API:
    https://github.com/googleads/google-ads-python

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions