Closed Bug 1311980 Opened 8 years ago Closed 7 years ago

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

Categories

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

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: emorley, Assigned: anejaalisha)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

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
This bug is already fixed. Can we update the status as RESOLVED FIXED?
Flags: needinfo?(emorley)
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)
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
Attachment #8834556 - Flags: review?(emorley)
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+
When this is ready for re-review, don't forget to add the "r?" back so this appears in the review queue :-)
Attachment #8834556 - Flags: review?(emorley)
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-
Attachment #8834556 - Flags: review- → review?(emorley)
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)
Attachment #8834556 - Flags: review?(emorley)
Comment on attachment 8834556 [details] [review]
[treeherder] alisha17:Bug1311980-BugJobMapViewSet.list-ValueError > mozilla:master

Many thanks!
Attachment #8834556 - Flags: review?(emorley) → review+
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)
Status: ASSIGNED → RESOLVED
Closed: 7 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: