Last Comment Bug 1113111 - tracebacks when a platform exists in a blob but has no locales
: tracebacks when a platform exists in a blob but has no locales
Status: RESOLVED FIXED
:
Product: Release Engineering
Classification: Other
Component: Balrog: Backend (show other bugs)
: unspecified
: All All
-- normal (vote)
: ---
Assigned To: Varun Joshi (:vjoshi)
: Ben Hearsum (:bhearsum)
:
Mentors: Ben Hearsum (:bhearsum)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-12-18 06:12 PST by Ben Hearsum (:bhearsum)
Modified: 2016-03-21 07:51 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
Changes dict access to use the get method (1.01 KB, patch)
2016-02-29 08:58 PST, Varun Joshi (:vjoshi)
no flags Details | Diff | Splinter Review

Description User image Ben Hearsum (:bhearsum) 2014-12-18 06:12:10 PST
I noticed this in Sentry today:


KeyError: 'locales'

Stacktrace (most recent call last):

  File "flask/app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "flask/app.py", line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "flask/views.py", line 84, in view
    return self.dispatch_request(*args, **kwargs)
  File "flask/views.py", line 149, in dispatch_request
    return meth(*args, **kwargs)
  File "auslib/web/views/client.py", line 35, in get
    release, update_type = AUS.evaluateRules(query)
  File "auslib/AUS.py", line 86, in evaluateRules
    if not blob.shouldServeUpdate(updateQuery):
  File "auslib/blobs/apprelease.py", line 151, in shouldServeUpdate
    if updateQuery['buildID'] >= self.getBuildID(updateQuery['buildTarget'], updateQuery['locale']):
  File "auslib/blobs/apprelease.py", line 63, in getBuildID
    if locale not in self['platforms'][platform]['locales']:




All of which come from URLs like:
https://aus4.mozilla.org/update/4/Fennec/35.0/20141211142105/Android_x86-gcc3/en-US/beta/4.4.2/default/default/35.0/update.xml

Which gets a blob with a section like:
    "Android_x86-gcc3": {
      "OS_FTP": "android-x86",
      "OS_BOUNCER": "android-x86"
    }

Setting aside whether or not Android_x86-gcc3 should be getting updates, I'm not 100% sure whether we need to deal with this in Balrog, or in the submitter tools. It feels like a bit of an invalid state to have a platform with absolutely no data in it.
Comment 1 User image Ben Hearsum (:bhearsum) 2014-12-18 06:24:07 PST
Diving into this a bit more I see that all of the URLs currently triggering this Traceback are Android_x86-gcc3, en-US. This is because the release creator iterates on enUSPlatforms (https://github.com/mozilla/build-tools/blob/master/lib/python/balrog/submitter/cli.py#L67), which contains android-x86 for Fennec (https://github.com/mozilla/build-buildbot-configs/blob/master/mozilla/release-fennec-mozilla-beta.py.template#L70). We can't adjust that because it's used for things like creating en-US release build factories (https://github.com/mozilla/build-buildbotcustom/blob/63911e42bb49817f05eee964a66c1bc13c1b3457/process/release.py#L590) so the simplest solution might be to have balrog cope better in some way. Might be as simple as .get(platform, {}) ?
Comment 2 User image Nick Thomas [:nthomas] 2015-01-14 18:12:56 PST
The en-US build may not be submitting info for some reason, and locales are also planned, so this should go away when those are resolved. Still, modifying
  https://github.com/mozilla/balrog/blob/master/auslib/blobs/apprelease.py#L47
to add the get you suggest is a good idea.
Comment 3 User image Nick Thomas [:nthomas] 2015-01-14 18:14:46 PST
Or actually https://github.com/mozilla/balrog/blob/master/auslib/blobs/apprelease.py#L63
Comment 4 User image Varun Joshi (:vjoshi) 2016-02-29 08:58:26 PST
Created attachment 8724795 [details] [diff] [review]
Changes dict access to use the get method

This should get rid of the KeyError. I added a get method access for both platform and 'locales'.
Comment 5 User image Ben Hearsum (:bhearsum) 2016-02-29 13:30:16 PST
Comment on attachment 8724795 [details] [diff] [review]
Changes dict access to use the get method

Reviewed in the PR. In the future, you can post a link to the PR as a review request!
Comment 6 User image [github robot] 2016-03-01 08:19:17 PST
Commits pushed to master at https://github.com/mozilla/balrog

https://github.com/mozilla/balrog/commit/655901440b6ed7d146a2813e23739c1e7439006a
Bug 1113111 - tracebacks when a platform exists in a blob but has no locales.r=bhearsum

https://github.com/mozilla/balrog/commit/ce2b4476a30dcf2e4ded0bb269308a12e79c473b
Merge pull request #54 from nurav/master

Bug 1113111 - tracebacks when a platform exists in a blob but has no locales. r=bhearsum
Comment 7 User image Ben Hearsum (:bhearsum) 2016-03-01 08:20:18 PST
I won't be doing a push to prod just for this, so this bug will stay open until there's a push for some other reason.
Comment 8 User image Ben Hearsum (:bhearsum) 2016-03-21 07:51:40 PDT
This landed in production today. Thanks for the patch!

Note You need to log in before you can comment on or make changes to this bug.