Get this on startup before first poll
testeddoughnut opened this issue · 2 comments
2016-07-29 23:15:13,900 26833 ERROR app - Exception on /api/zones [GET]
Traceback (most recent call last):
File "/opt/hourglass/.virtualenvs/hourglass/lib/python3.4/site-packages/flask/app.py", line 1817, in wsgi_app
response = self.full_dispatch_request()
File "/opt/hourglass/.virtualenvs/hourglass/lib/python3.4/site-packages/flask/app.py", line 1477, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/opt/hourglass/.virtualenvs/hourglass/lib/python3.4/site-packages/flask/app.py", line 1381, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/opt/hourglass/.virtualenvs/hourglass/lib/python3.4/site-packages/flask/_compat.py", line 33, in reraise
raise value
File "/opt/hourglass/.virtualenvs/hourglass/lib/python3.4/site-packages/flask/app.py", line 1475, in full_dispatch_request
rv = self.dispatch_request()
File "/opt/hourglass/.virtualenvs/hourglass/lib/python3.4/site-packages/flask/app.py", line 1461, in dispatch_request
return self.view_functionsrule.endpoint
File "./hourglass/views/api/views.py", line 15, in zones
zones = Zone.query.filter(*dash_filters_list).all_dict_out_or_404()
File "./hourglass/backends/cache.py", line 19, in all_dict_out_or_404
dict_list = self.all_dict_out()
File "./hourglass/backends/cache.py", line 13, in all_dict_out
return [x.dict_out for x in self]
File "./hourglass/backends/cache.py", line 13, in
return [x.dict_out for x in self]
File "./hourglass/backends/cache.py", line 553, in dict_out
overall_health, pollers = self.pollers_health
File "./hourglass/backends/cache.py", line 536, in pollers_health
updated_at, status, message = model.last_poll_status(self.name)
File "./hourglass/backends/cache.py", line 92, in last_poll_status
return (last_run.updated_at, last_run.value, last_run_message.value)
AttributeError: 'NoneType' object has no attribute 'updated_at'
This isn't necessarily a startup error, but rather a traceback because the zones API call is being queried by the front-end before there is any data in the table.
Should still be fixed, just wanted to clarify the cause.
This should be fixed with #177. Will reopen if that is not the case.