Closed Bug 756285 Opened 12 years ago Closed 12 years ago

mkt.developers.tasks.fetch_icon: AttributeError: 'NoneType' object has no attribute 'file_path'

Categories

(Marketplace Graveyard :: Developer Pages, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: kumar, Unassigned)

Details

Task mkt.developers.tasks.fetch_icon with id ada8b785-c911-47ba-9bbf-1f1486d06e7f raised exception:
'AttributeError("\'NoneType\' object has no attribute \'file_path\'",)'


Task was called with args: (<Webapp: 370219: SeaVan's Undersea Adventure: Down Under>,) kwargs: {}.

The contents of the full traceback was:

Traceback (most recent call last):
 File "/data/www/addons-dev.allizom.org/zamboni/vendor/lib/python/celery/execute/trace.py", line 153, in trace_task
   R = retval = task(*args, **kwargs)
 File "/data/www/addons-dev.allizom.org/zamboni/vendor/src/nuggets/celeryutils.py", line 35, in wrapped
   return fun(*args, **kw)
 File "/data/www/addons-dev.allizom.org/zamboni/apps/amo/decorators.py", line 139, in wrapper
   return f(*args, **kw)
 File "/data/www/addons-dev.allizom.org/zamboni/apps/amo/decorators.py", line 131, in wrapper
   return f(*args, **kw)
 File "/data/www/addons-dev.allizom.org/zamboni/mkt/developers/tasks.py", line 330, in fetch_icon
   manifest = webapp.get_manifest_json()
 File "/data/www/addons-dev.allizom.org/zamboni/mkt/webapps/models.py", line 195, in get_manifest_json
   with open(self.get_latest_file().file_path, 'r') as mf:
AttributeError: 'NoneType' object has no attribute 'file_path'
Also see bug 751683
I've been poking in this area of code a bit lately.

`get_latest_file` calls `current_version` calls `update_version` calls `get_version`, which queries versions with files whose status is in VALID_STATUSES (which excludes REJECTED, DISABLED, and DELETED statuses). So if a version has a file in one of those it will return no version.

We've made some assumptions about versions/files for webapps that have left some files statuses in odd states. I have a patch I'm pushing soon to fix some of this in reviewer tools and a few other places. Perhaps that might fix this?

But it's good to be aware that `get_latest_file` isn't as simple as it sounds.
https://github.com/mozilla/zamboni/commit/a63ef7
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.