Page MenuHomePhabricator

Handle meta endpoints when the specified id doesn't exist
Closed, ResolvedPublic

Description

"/run/<int:qrun_id>/meta", "/rev/<int:rev_id>/meta", "/query/<int:query_id>/meta" endpoints throw "Internal Server Error" when the specified id doesn't exist in the database.

Here's a log for /query/<int:query_id>/meta when query_id doesn't exist in my local dev environment:

Traceback (most recent call last):
  File "/srv/venv/lib/python3.5/site-packages/flask/app.py", line 2309, in __call__
    return self.wsgi_app(environ, start_response)
  File "/srv/venv/lib/python3.5/site-packages/flask/app.py", line 2295, in wsgi_app
    response = self.handle_exception(e)
  File "/srv/venv/lib/python3.5/site-packages/flask/app.py", line 1741, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/srv/venv/lib/python3.5/site-packages/flask/_compat.py", line 35, in reraise
    raise value
  File "/srv/venv/lib/python3.5/site-packages/flask/app.py", line 2292, in wsgi_app
    response = self.full_dispatch_request()
  File "/srv/venv/lib/python3.5/site-packages/flask/app.py", line 1815, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/srv/venv/lib/python3.5/site-packages/flask/app.py", line 1718, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/srv/venv/lib/python3.5/site-packages/flask/_compat.py", line 35, in reraise
    raise value
  File "/srv/venv/lib/python3.5/site-packages/flask/app.py", line 1813, in full_dispatch_request
    rv = self.dispatch_request()
  File "/srv/venv/lib/python3.5/site-packages/flask/app.py", line 1799, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/vagrant/quarry/web/app.py", line 349, in output_query_meta
    'latest_run': query.latest_rev.latest_run,
AttributeError: 'NoneType' object has no attribute 'latest_rev'

Details

Related Gerrit Patches:

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptNov 18 2018, 12:19 PM
rafidaslam added a project: Quarry.

I'll work on this

Change 474530 had a related patch set uploaded (by Rafidaslam; owner: Rafid Aslam):
[analytics/quarry/web@master] app.py: Handle meta endpoints when the specified id doesn't exist

https://gerrit.wikimedia.org/r/474530

Framawiki renamed this task from "/run/<int:qrun_id>/meta", "/rev/<int:rev_id>/meta", "/query/<int:query_id>/meta" endpoints throw internal server error (code 500) when the id doesn't exist to Handle meta endpoints when the specified id doesn't exist.Nov 18 2018, 8:57 PM
Framawiki triaged this task as Low priority.

Change 474530 merged by jenkins-bot:
[analytics/quarry/web@master] app.py: Handle meta endpoints when the specified id doesn't exist

https://gerrit.wikimedia.org/r/474530

Framawiki closed this task as Resolved.Dec 2 2018, 9:26 AM

Mentioned in SAL (#wikimedia-cloud) [2018-12-02T09:35:52Z] <framawiki> deployed 575fc1c T209783 and 06a1f9f T205151 on quarry-web-01