Last Comment Bug 1282569 - handle requests that don't substitute %PRODUCT%, et. al.
: handle requests that don't substitute %PRODUCT%, et. al.
Status: RESOLVED FIXED
[lang=python][good first bug]
:
Product: Release Engineering
Classification: Other
Component: Balrog: Backend (show other bugs)
: unspecified
: Unspecified Unspecified
-- normal (vote)
: ---
Assigned To: Njira
: Ben Hearsum (:bhearsum)
:
Mentors: Ben Hearsum (:bhearsum)
Depends on: 1314274
Blocks:
  Show dependency treegraph
 
Reported: 2016-06-27 13:41 PDT by Ben Hearsum (:bhearsum)
Modified: 2016-11-02 13:14 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments

Description User image Ben Hearsum (:bhearsum) 2016-06-27 13:41:32 PDT
Apparently, we get tens of thousands of requests per day that don't substitute the URL variables. Eg:
[20/Jun/2016:01:14:50 +0000] "GET /update/4/%PRODUCT%/%VERSION%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/%MOZ_VERSION%/update.xml HTTP/1.1" 400 226 "-" "Mozilla/5.0 (Android; Mobile; rv:37.0) Gecko/37.0 Firefox/37.0"

All of them appear to be Gecko 37.0 or 38.0. Makes me wonder if we busted the updater somehow around that time. In any case, I think it might be nice to add a route that quickly returns an empty response for these. There's no reason query the rules table - we'll never find anything useful in there.
Comment 1 User image Amal Santhosh 2016-09-21 00:05:37 PDT
Hi, I'm new here :) I would like to work on this bug. Can you help my way around?
Comment 2 User image Ben Hearsum (:bhearsum) 2016-09-21 06:42:07 PDT
(In reply to Amal Santhosh from comment #1)
> Hi, I'm new here :) I would like to work on this bug. Can you help my way
> around?

Hi Amal, thanks for your interest! The best first step for a bug like this is to ensure that you can run the Docker containers and tests locally. https://wiki.mozilla.org/Balrog#Hacking some instructions on that. Once you can successfully run "bash run-tests.sh", you should be ready to hack on this.

When you're ready to hack, the first step will be to write a new test in https://github.com/mozilla/balrog/blob/master/auslib/test/web/test_client.py that simulates a request like the one from comment #0. Once you've written that, and it's failing, you can try to fix the bug. This will most likely be in https://github.com/mozilla/balrog/blob/master/auslib/web/base.py and/or https://github.com/mozilla/balrog/blob/master/auslib/web/views/client.py.
Comment 3 User image Amal Santhosh 2016-09-21 06:58:18 PDT
Thank you so much for the details. I'll try my best at this :)
Comment 4 User image Amal Santhosh 2016-09-21 10:01:24 PDT
I've been trying to follow the instructions but some error or the other crops up every time. As a first time user here I feel I don't have the experience for this particular issue and i apologize and request you to reassign the bug to someone who can do justice to it.

Thank you for the patience .
Comment 5 User image Ben Hearsum (:bhearsum) 2016-09-21 10:25:00 PDT
(In reply to Amal Santhosh from comment #4)
> I've been trying to follow the instructions but some error or the other
> crops up every time. As a first time user here I feel I don't have the
> experience for this particular issue and i apologize and request you to
> reassign the bug to someone who can do justice to it.
> 
> Thank you for the patience .

Sorry to hear that. If you still have them, could you e-mail me the errors you hit? It's something I'd like to improve in the future.
Comment 6 User image [github robot] 2016-10-26 10:13:11 PDT
Commit pushed to master at https://github.com/mozilla/balrog

https://github.com/mozilla/balrog/commit/130852f322ad8a3bfd925c3dc37aa66ae5b3859c
bug 1282569: handle requests that don't substitute %PRODUCT%, et. al. (#161). r=bhearsum
Comment 7 User image Ben Hearsum (:bhearsum) 2016-11-02 13:14:45 PDT
In production, thanks Njira!

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