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

RESOLVED FIXED

Status

Tree Management
Treeherder: API
P2
normal
RESOLVED FIXED
a year ago
a year ago

People

(Reporter: emorley, Assigned: anejaalisha)

Tracking

(Blocks: 1 bug)

Details

Attachments

(1 attachment)

(Reporter)

Description

a year ago
We should handle this case gracefully (with an HTTP 400) not HTTP 500.

/treeherder.webapp.api.bug:BugJobMapViewSet.list

File "/app/.heroku/python/lib/python2.7/site-packages/rest_framework/views.py", line 463, in dispatch
File "/app/treeherder/webapp/api/bug.py", line 62, in list
 exceptions:ValueError: invalid literal for int() with base 10: 'mqrGlXvEjwOvqpNVlnLJEkGJfgGeDfRgSYRgotscshEjxTaFFsEqGyefgfbasoinbUDopNtsPbRLwraoGpZIHvLODqKyLIrMqnTvFKQmyjLoKkOBoiWYhqqcoIwvmlwjGccxnEduByaEtvbIIZOVLtxObFoOwOaeFVdKeXdmlqaUtaaGNfbpREKorHLKVKjBNSJFAAyR' 

parameters	
job_id mqrGlXvEjwOvqpNVlnLJEkGJfgGeDfRgSYRgotscshEjxTaFFsEqGyefgfbasoinbUDopNtsPbRLwraoGpZIHvLODqKyLIrMqnTvFKQmyjLoKkOBoiWYhqqcoIwvmlwjGccxnEduByaEtvbIIZOVLtxObFoOwOaeFVdKeXdmlqaUtaaGNfbpREKorHLKVKjBNSJFAAyRDiDQetmydyhPIicKwFbABoAjopXuBGcorHqnlPshLqbjDfNfgdgrHrJ

https://rpm.newrelic.com/accounts/677903/applications/14179733/traced_errors/70d13c62-9482-11e6-9c7c-b82a72d22a14_12705_17103
(Assignee)

Comment 1

a year ago
This bug is already fixed. Can we update the status as RESOLVED FIXED?
Flags: needinfo?(emorley)
(Reporter)

Comment 2

a year ago
This reproduces for me using:

$ curl -i https://treeherder.mozilla.org/api/project/mozilla-inbound/bug-job-map/?job_id=aaa
HTTP/1.1 500 Internal Server Error
Connection: keep-alive
Server: gunicorn/19.6.0
Date: Mon, 06 Feb 2017 22:01:53 GMT
Transfer-Encoding: chunked
Content-Type: text/html
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Xss-Protection: 1; mode=block
Vary: Cookie
X-Frame-Options: DENY
X-Content-Type-Options: nosniff
Via: 1.1 vegur

<h1>Server Error (500)</h1>

https://papertrailapp.com/systems/treeherder-prod/events?centered_on_id=765382009987178499&q=program%3Aapp%2Fweb.1
Feb 06 22:01:53 treeherder-prod app/web.1: ValueError: invalid literal for int() with base 10: 'aaa' 

https://rpm.newrelic.com/accounts/677903/applications/14179757/filterable_errors#/show/f06cc633-ecb7-11e6-9c7c-b82a72d22a14_0_4397/stack_trace?top_facet=transactionUiName&primary_facet=error.class&barchart=barchart&_k=lkb5ck
Flags: needinfo?(emorley)
Created attachment 8834556 [details] [review]
[treeherder] alisha17:Bug1311980-BugJobMapViewSet.list-ValueError > mozilla:master
(Reporter)

Comment 4

a year ago
Thank you for opening a PR. If this is ready for review, could you set the review flag on the attachment to "r?" and pick someone from the suggested reviewers list to review? :-)
Assignee: nobody → anejaalisha
Status: NEW → ASSIGNED
(Assignee)

Updated

a year ago
Attachment #8834556 - Flags: review?(emorley)
(Reporter)

Comment 5

a year ago
Comment on attachment 8834556 [details] [review]
[treeherder] alisha17:Bug1311980-BugJobMapViewSet.list-ValueError > mozilla:master

I've left a comment on the PR.

Many thanks for working on this :-)
Attachment #8834556 - Flags: review?(emorley) → feedback+
(Reporter)

Comment 6

a year ago
When this is ready for re-review, don't forget to add the "r?" back so this appears in the review queue :-)
(Assignee)

Updated

a year ago
Attachment #8834556 - Flags: review?(emorley)
(Reporter)

Comment 7

a year ago
Comment on attachment 8834556 [details] [review]
[treeherder] alisha17:Bug1311980-BugJobMapViewSet.list-ValueError > mozilla:master

Left a comment - almost there :-)
Attachment #8834556 - Flags: review?(emorley) → review-
(Assignee)

Updated

a year ago
Attachment #8834556 - Flags: review- → review?(emorley)
(Reporter)

Comment 8

a year ago
Comment on attachment 8834556 [details] [review]
[treeherder] alisha17:Bug1311980-BugJobMapViewSet.list-ValueError > mozilla:master

One item left:
https://github.com/mozilla/treeherder/pull/2142/files#r102752656
Attachment #8834556 - Flags: review?(emorley)
(Assignee)

Updated

a year ago
Attachment #8834556 - Flags: review?(emorley)
(Reporter)

Comment 9

a year ago
Comment on attachment 8834556 [details] [review]
[treeherder] alisha17:Bug1311980-BugJobMapViewSet.list-ValueError > mozilla:master

Many thanks!
Attachment #8834556 - Flags: review?(emorley) → review+

Comment 10

a year ago
Commit pushed to master at https://github.com/mozilla/treeherder

https://github.com/mozilla/treeherder/commit/0fb3c8b46ab1e89cbdabeba56be02e8fc8d753c8
Bug 1311980 - Gracefully handle invalid job_id in BugJobMapViewSet.list (#2142)
(Reporter)

Updated

a year ago
Status: ASSIGNED → RESOLVED
Last Resolved: a year ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.