Closed Bug 1311976 Opened 8 years ago Closed 8 years ago

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

Categories

(Tree Management :: Treeherder: API, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1318474

People

(Reporter: emorley, Unassigned)

References

(Blocks 1 open bug)

Details

We should handle this case gracefully (with an HTTP 400) not HTTP 500. /treeherder.webapp.api.jobs:JobsViewSet.list File "/app/.heroku/python/lib/python2.7/site-packages/rest_framework/views.py", line 463, in dispatch File "/app/treeherder/webapp/api/utils.py", line 104, in use_jobs_model File "/app/treeherder/webapp/api/jobs.py", line 106, in list exceptions:ValueError: invalid literal for int() with base 10: '2000"&cat /etc/passwd&"' parameters count 2000"&cat /etc/passwd&" offset 2000 result_set_id 35130 return_type list https://rpm.newrelic.com/accounts/677903/applications/14179733/traced_errors/be5366dd-9481-11e6-9c7c-b82a72d22a14_0_4181?original_error_id=70d13c62-9482-11e6-9c7c-b82a72d22a14_0_4259
Alisha, would you be interested in working on this bug? Ed, is there anything crazy about this bug that would make this not a good idea for Alisha to work on? This would be her 2nd treeherder bug (technically her 3rd)
Flags: needinfo?(anejaalisha)
Yes sure. I will take up this.
Flags: needinfo?(anejaalisha)
(In reply to Joel Maher ( :jmaher) from comment #1) > Ed, is there anything crazy about this bug that would make this not a good > idea for Alisha to work on? This would be her 2nd treeherder bug > (technically her 3rd) There shouldn't be any hidden gotchas here, so sounds good :-)
I am trying to reproduce the error but I am only getting error as "Invalid offset or count value" and its already giving HTTP 400. I am using the same parameters as mentioned in the description, but obviously changing the result_set_id to that of a job in my database.
Ah looked like this was fixed as a side effect of bug 1318474 after all: https://github.com/mozilla/treeherder/commit/9f604fa323db1d1d2e859c85b2c01810f7f781b7#diff-2f4d3957c7a938969d8b2f54e9176403R292 Sorry for the false start - at least we now know we can close this bug out! :-)
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.