Closed Bug 1311982 Opened 9 years ago Closed 9 years ago

PerformanceDatumViewSet.list "ValueError: invalid literal for int() with base 10: ..."

Categories

(Tree Management :: Perfherder, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: emorley, Assigned: ShrutiJ)

References

Details

Attachments

(2 files)

We should handle this case gracefully (with an HTTP 400) not HTTP 500. /treeherder.webapp.api.performance_data:PerformanceDatumViewSet.list File "/app/treeherder/webapp/api/performance_data.py", line 185, in list File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/query.py", line 679, in filter File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/query.py", line 697, in _filter_or_exclude File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/sql/query.py", line 1310, in add_q File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/sql/query.py", line 1338, in _add_q File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/sql/query.py", line 1209, in build_filter File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/sql/query.py", line 1102, in build_lookup File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/lookups.py", line 105, in __init__ File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/lookups.py", line 143, in get_prep_lookup File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/fields/__init__.py", line 1875, in get_prep_lookup File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/fields/__init__.py", line 729, in get_prep_lookup File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/fields/__init__.py", line 1869, in get_prep_value exceptions:ValueError: invalid literal for int() with base 10: 'http://8948474958936717641.owasp.org' /api/project/mozilla-inbound/performance/data/ parameters job_id http://8948474958936717641.owasp.org
We should check that the job_id parameter is an integer here, and return a sensible error if it isn't: https://github.com/mozilla/treeherder/blob/master/treeherder/webapp/api/performance_data.py#L173
:wlach, I'll work on this bug.
Assignee: nobody → shrutijasoria1996
Comment on attachment 8828925 [details] [review] [treeherder] SJasoria:Bug_1311982 > mozilla:master I've made a few changes. Please take a look.
Attachment #8828925 - Flags: review?(wlachance)
Comment on attachment 8828925 [details] [review] [treeherder] SJasoria:Bug_1311982 > mozilla:master Left some comments. Please re-r? when feedback is addressed. :)
Attachment #8828925 - Flags: review?(wlachance)
Comment on attachment 8828925 [details] [review] [treeherder] SJasoria:Bug_1311982 > mozilla:master Made the changes which you had asked for in the PR. I've written a test too. I hope it's good.
Attachment #8828925 - Flags: feedback?(wlachance)
Comment on attachment 8828925 [details] [review] [treeherder] SJasoria:Bug_1311982 > mozilla:master Left some comments on github!
Attachment #8828925 - Flags: feedback?(wlachance)
Comment on attachment 8828925 [details] [review] [treeherder] SJasoria:Bug_1311982 > mozilla:master I've made the required changes. I hope it's good now.
Attachment #8828925 - Flags: review?(wlachance)
Comment on attachment 8828925 [details] [review] [treeherder] SJasoria:Bug_1311982 > mozilla:master Just needs one small change, pre-emptively r+'ing.
Attachment #8828925 - Flags: review?(wlachance) → review+
Commit pushed to master at https://github.com/mozilla/treeherder https://github.com/mozilla/treeherder/commit/5ec35f62d0f152688dcdd9ea346faed044e29dad Bug 1311982 - Handle PerformanceDatumViewSet.list error more gracefully (#2090)
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Unfortunately this actually broke production. :( Apologies, I should have asked for a unit test to make sure this also worked in the normal case. I'll do up a followup.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Status: REOPENED → RESOLVED
Closed: 9 years ago → 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: