[traceback] In googleanalytics.py: AttributeError: 'NoneType' object has no attribute 'get'

NEW
Unassigned

Status

support.mozilla.org
Code Quality
2 years ago
2 years ago

People

(Reporter: mythmon, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: u=dev p=1)

(Reporter)

Description

2 years ago
This comes up occasionally in cron error mail. I suspect it is because some google analytics has nothing interesting to tell us and sends back None.

Traceback (most recent call last):
  File "manage.py", line 32, in <module>
    execute_from_command_line(sys.argv)
  File "/data/support/src/support.mozilla.org/kitsune/virtualenv/lib/python2.7/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
    utility.execute()
  File "/data/support/src/support.mozilla.org/kitsune/virtualenv/lib/python2.7/site-packages/django/core/management/__init__.py", line 377, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/data/support/src/support.mozilla.org/kitsune/virtualenv/lib/python2.7/site-packages/django/core/management/base.py", line 288, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/data/support/src/support.mozilla.org/kitsune/virtualenv/lib/python2.7/site-packages/django/core/management/base.py", line 338, in execute
    output = self.handle(*args, **options)
  File "/data/support/src/support.mozilla.org/kitsune/virtualenv/lib/python2.7/site-packages/cronjobs/management/commands/cron.py", line 64, in handle
    registered[script](*args)
  File "/data/support/www/support.mozilla.org/kitsune/kitsune/dashboards/cron.py", line 25, in reload_wiki_traffic_stats
    period, verbose=settings.DEBUG)
  File "/data/support/www/support.mozilla.org/kitsune/kitsune/dashboards/models.py", line 50, in reload_period_from_analytics
    *period_dates(period), verbose=verbose)
  File "/data/support/www/support.mozilla.org/kitsune/kitsune/sumo/googleanalytics.py", line 157, in pageviews_by_document
    for result in results.get('rows', []):
AttributeError: 'NoneType' object has no attribute 'get'
You need to log in before you can comment on or make changes to this bug.