Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weather plot broken? #37

Closed
astrobokonon opened this issue Jul 11, 2019 · 7 comments
Closed

Weather plot broken? #37

astrobokonon opened this issue Jul 11, 2019 · 7 comments
Assignees
Labels
bug Something isn't working High Priority Flag issues that should get more immediate attention
Projects

Comments

@astrobokonon
Copy link
Member

Seems like the weather plot/section is broken in some way, it's not displaying the table and it doesn't seem to be updating automatically anymore. Need to fix that before the shutdown is over!

@astrobokonon astrobokonon added bug Something isn't working High Priority Flag issues that should get more immediate attention labels Jul 11, 2019
@astrobokonon astrobokonon self-assigned this Jul 11, 2019
@astrobokonon astrobokonon added this to To do in MrFreeze via automation Jul 11, 2019
@astrobokonon astrobokonon moved this from To do to In progress in MrFreeze Jul 11, 2019
@astrobokonon
Copy link
Member Author

Noticed that the instruments plot is busted too; that one is probably because everything is warm and there's no recent data to plot, but it should be fixed to at least show the plot so you can see it's empty.

@astrobokonon astrobokonon added this to To do in NightWatch via automation Jul 12, 2019
@astrobokonon astrobokonon removed this from In progress in MrFreeze Jul 12, 2019
@astrobokonon
Copy link
Member Author

astrobokonon commented Jul 16, 2019

Seems like this is the problem; there are a few of them, some of which are probably related to finding no data within the query window:

2019-07-16 20:34:43,509 ERROR Traceback (most recent call last):
File "/opt/conda/lib/python3.7/site-packages/tornado/gen.py", line 501, in callback
result_list.append(f.result())
File "/opt/conda/lib/python3.7/site-packages/tornado/gen.py", line 742, in run
yielded = self.gen.send(value)
File "/opt/conda/lib/python3.7/site-packages/bokeh/server/session.py", line 70, in _needs_document_lock_wrapper
result = yield yield_for_all_futures(func(self, *args, **kwargs))
File "/opt/conda/lib/python3.7/site-packages/bokeh/server/session.py", line 191, in with_document_locked
return func(*args, **kwargs)
File "/opt/conda/lib/python3.7/site-packages/bokeh/document/document.py", line 1127, in wrapper
return doc._with_self_as_curdoc(invoke)
File "/opt/conda/lib/python3.7/site-packages/bokeh/document/document.py", line 1113, in _with_self_as_curdoc
return f()
File "/opt/conda/lib/python3.7/site-packages/bokeh/document/document.py", line 1126, in invoke
return f(*args, **kwargs)
File "/home/lig/Codes/NightShift/nightshift/bokeh/dct/dctWeather.py", line 189, in grabNew
nf = dataGatherer(m, qdata, timeFilter=lastTimedt)
File "/home/lig/Codes/NightShift/nightshift/bokeh/dct/dctWeather.py", line 70, in dataGatherer
r2ipydt = r2.index.to_pydatetime()
AttributeError: 'dict' object has no attribute 'index'

2019-07-16 20:34:46,395 INFO 200 GET /dctweather/autoload.js?bokeh-autoload-element=1119&bokeh-app-path=/dctweather&bokeh-absolute-url=http://dctsleeperservice:5000/dctweather&resources=none (192.168.168.194) 177.41ms
2019-07-16 20:34:46,402 ERROR Uncaught exception GET /dctweathertable/autoload.js?bokeh-autoload-element=1120&bokeh-app-path=/dctweathertable&bokeh-absolute-url=http://dctsleeperservice:5000/dctweathertable&resources=none (192.168.168.194)
HTTPServerRequest(protocol='http', host='dctsleeperservice:5000', method='GET', uri='/dctweathertable/autoload.js?bokeh-autoload-element=1120&bokeh-app-path=/dctweathertable&bokeh-absolute-url=http://dctsleeperservice:5000/dctweathertable&resources=none', version='HTTP/1.1', remote_ip='192.168.168.194')
Traceback (most recent call last):
File "/opt/conda/lib/python3.7/site-packages/tornado/web.py", line 1699, in _execute
result = await result
File "/opt/conda/lib/python3.7/site-packages/tornado/gen.py", line 736, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File "/opt/conda/lib/python3.7/site-packages/bokeh/server/views/autoload_js_handler.py", line 60, in get
session = yield self.get_session()
File "/opt/conda/lib/python3.7/site-packages/tornado/gen.py", line 729, in run
value = future.result()
File "/opt/conda/lib/python3.7/site-packages/tornado/gen.py", line 736, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File "/opt/conda/lib/python3.7/site-packages/bokeh/server/views/session_handler.py", line 77, in get_session
session = yield self.application_context.create_session_if_needed(session_id, self.request)
File "/opt/conda/lib/python3.7/site-packages/tornado/gen.py", line 729, in run
value = future.result()
File "/opt/conda/lib/python3.7/site-packages/tornado/gen.py", line 742, in run
yielded = self.gen.send(value)
File "/opt/conda/lib/python3.7/site-packages/bokeh/server/contexts.py", line 215, in create_session_if_needed
self._application.initialize_document(doc)
File "/opt/conda/lib/python3.7/site-packages/bokeh/application/application.py", line 178, in initialize_document
h.modify_document(doc)
File "/opt/conda/lib/python3.7/site-packages/bokeh/application/handlers/function.py", line 133, in modify_document
self._func(doc)
File "/home/lig/Codes/NightShift/nightshift/bokeh/dct/dctWeatherTable.py", line 86, in makeTable
cds = filterAndJudge(r)
File "/home/lig/Codes/NightShift/nightshift/bokeh/dct/dctWeatherTable.py", line 44, in filterAndJudge
compTime=now, nullVal=-1, fstr="%.1f")
File "/home/lig/Codes/NightShift/nightshift/bokeh/plotting/helpers.py", line 182, in getLast
val = getattr(p1, fieldname)[lastIdx]
File "/opt/conda/lib/python3.7/site-packages/pandas/core/generic.py", line 5067, in getattr
return object.getattribute(self, name)
AttributeError: 'DataFrame' object has no attribute 'MountTemp'

2019-07-16 20:34:46,402 ERROR 500 GET /dctweathertable/autoload.js?bokeh-autoload-element=1120&bokeh-app-path=/dctweathertable&bokeh-absolute-url=http://dctsleeperservice:5000/dctweathertable&resources=none (192.168.168.194) 6.41ms
2019-07-16 20:34:46,560 INFO 200 GET /dctwind/autoload.js?bokeh-autoload-element=1121&bokeh-app-path=/dctwind&bokeh-absolute-url=http://dctsleeperservice:5000/dctwind&resources=none (192.168.168.194) 157.39ms
2019-07-16 20:34:46,572 INFO 200 GET /dctwindtable/autoload.js?bokeh-autoload-element=1122&bokeh-app-path=/dctwindtable&bokeh-absolute-url=http://dctsleeperservice:5000/dctwindtable&resources=none (192.168.168.194) 169.13ms
2019-07-16 20:34:46,579 INFO 200 GET /facsum_tcs/autoload.js?bokeh-autoload-element=1124&bokeh-app-path=/facsum_tcs&bokeh-absolute-url=http://dctsleeperservice:5000/facsum_tcs&resources=none (192.168.168.194) 175.60ms
2019-07-16 20:34:46,579 ERROR Uncaught exception GET /lmitemps/autoload.js?bokeh-autoload-element=1123&bokeh-app-path=/lmitemps&bokeh-absolute-url=http://dctsleeperservice:5000/lmitemps&resources=none (192.168.168.194)
HTTPServerRequest(protocol='http', host='dctsleeperservice:5000', method='GET', uri='/lmitemps/autoload.js?bokeh-autoload-element=1123&bokeh-app-path=/lmitemps&bokeh-absolute-url=http://dctsleeperservice:5000/lmitemps&resources=none', version='HTTP/1.1', remote_ip='192.168.168.194')
Traceback (most recent call last):
File "/opt/conda/lib/python3.7/site-packages/tornado/web.py", line 1699, in _execute
result = await result
File "/opt/conda/lib/python3.7/site-packages/tornado/gen.py", line 736, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File "/opt/conda/lib/python3.7/site-packages/bokeh/server/views/autoload_js_handler.py", line 60, in get
session = yield self.get_session()
File "/opt/conda/lib/python3.7/site-packages/tornado/gen.py", line 729, in run
value = future.result()
File "/opt/conda/lib/python3.7/site-packages/tornado/gen.py", line 736, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File "/opt/conda/lib/python3.7/site-packages/bokeh/server/views/session_handler.py", line 77, in get_session
session = yield self.application_context.create_session_if_needed(session_id, self.request)
File "/opt/conda/lib/python3.7/site-packages/tornado/gen.py", line 729, in run
value = future.result()
File "/opt/conda/lib/python3.7/site-packages/tornado/gen.py", line 742, in run
yielded = self.gen.send(value)
File "/opt/conda/lib/python3.7/site-packages/bokeh/server/contexts.py", line 215, in create_session_if_needed
self._application.initialize_document(doc)
File "/opt/conda/lib/python3.7/site-packages/bokeh/application/application.py", line 178, in initialize_document
h.modify_document(doc)
File "/opt/conda/lib/python3.7/site-packages/bokeh/application/handlers/function.py", line 133, in modify_document
self._func(doc)
File "/home/lig/Codes/NightShift/nightshift/bokeh/dct/instrumentTelem.py", line 113, in make_plot
r = dataGatherer(m, qdata)
File "/home/lig/Codes/NightShift/nightshift/bokeh/dct/instrumentTelem.py", line 37, in dataGatherer
r = pdata['q_insttemps']['deveny']
KeyError: 'deveny'

2019-07-16 20:34:46,580 ERROR 500 GET /lmitemps/autoload.js?bokeh-autoload-element=1123&bokeh-app-path=/lmitemps&bokeh-absolute-url=http://dctsleeperservice:5000/lmitemps&resources=none (192.168.168.194) 176.73ms
2019-07-16 20:34:46,587 ERROR Uncaught exception GET /dctweathertable/autoload.js?bokeh-autoload-element=1120&bokeh-app-path=/dctweathertable&bokeh-absolute-url=http://dctsleeperservice:5000/dctweathertable&resources=none (192.168.168.194)
HTTPServerRequest(protocol='http', host='dctsleeperservice:5000', method='GET', uri='/dctweathertable/autoload.js?bokeh-autoload-element=1120&bokeh-app-path=/dctweathertable&bokeh-absolute-url=http://dctsleeperservice:5000/dctweathertable&resources=none', version='HTTP/1.1', remote_ip='192.168.168.194')
Traceback (most recent call last):
File "/opt/conda/lib/python3.7/site-packages/tornado/web.py", line 1699, in _execute
result = await result
File "/opt/conda/lib/python3.7/site-packages/tornado/gen.py", line 736, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File "/opt/conda/lib/python3.7/site-packages/bokeh/server/views/autoload_js_handler.py", line 60, in get
session = yield self.get_session()
File "/opt/conda/lib/python3.7/site-packages/tornado/gen.py", line 729, in run
value = future.result()
File "/opt/conda/lib/python3.7/site-packages/tornado/gen.py", line 736, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File "/opt/conda/lib/python3.7/site-packages/bokeh/server/views/session_handler.py", line 77, in get_session
session = yield self.application_context.create_session_if_needed(session_id, self.request)
File "/opt/conda/lib/python3.7/site-packages/tornado/gen.py", line 729, in run
value = future.result()
File "/opt/conda/lib/python3.7/site-packages/tornado/gen.py", line 742, in run
yielded = self.gen.send(value)
File "/opt/conda/lib/python3.7/site-packages/bokeh/server/contexts.py", line 215, in create_session_if_needed
self._application.initialize_document(doc)
File "/opt/conda/lib/python3.7/site-packages/bokeh/application/application.py", line 178, in initialize_document
h.modify_document(doc)
File "/opt/conda/lib/python3.7/site-packages/bokeh/application/handlers/function.py", line 133, in modify_document
self._func(doc)
File "/home/lig/Codes/NightShift/nightshift/bokeh/dct/dctWeatherTable.py", line 86, in makeTable
cds = filterAndJudge(r)
File "/home/lig/Codes/NightShift/nightshift/bokeh/dct/dctWeatherTable.py", line 44, in filterAndJudge
compTime=now, nullVal=-1, fstr="%.1f")
File "/home/lig/Codes/NightShift/nightshift/bokeh/plotting/helpers.py", line 182, in getLast
val = getattr(p1, fieldname)[lastIdx]
File "/opt/conda/lib/python3.7/site-packages/pandas/core/generic.py", line 5067, in getattr
return object.getattribute(self, name)
AttributeError: 'DataFrame' object has no attribute 'MountTemp'

2019-07-16 20:34:46,587 ERROR 500 GET /dctweathertable/autoload.js?bokeh-autoload-element=1120&bokeh-app-path=/dctweathertable&bokeh-absolute-url=http://dctsleeperservice:5000/dctweathertable&resources=none (192.168.168.194) 6.63ms
2019-07-16 20:34:46,594 INFO 200 GET /facsum_lpi/autoload.js?bokeh-autoload-element=1125&bokeh-app-path=/facsum_lpi&bokeh-absolute-url=http://dctsleeperservice:5000/facsum_lpi&resources=none (192.168.168.194) 6.35ms
2019-07-16 20:34:46,639 ERROR Uncaught exception GET /lmitemps/autoload.js?bokeh-autoload-element=1123&bokeh-app-path=/lmitemps&bokeh-absolute-url=http://dctsleeperservice:5000/lmitemps&resources=none (192.168.168.194)
HTTPServerRequest(protocol='http', host='dctsleeperservice:5000', method='GET', uri='/lmitemps/autoload.js?bokeh-autoload-element=1123&bokeh-app-path=/lmitemps&bokeh-absolute-url=http://dctsleeperservice:5000/lmitemps&resources=none', version='HTTP/1.1', remote_ip='192.168.168.194')
Traceback (most recent call last):
File "/opt/conda/lib/python3.7/site-packages/tornado/web.py", line 1699, in _execute
result = await result
File "/opt/conda/lib/python3.7/site-packages/tornado/gen.py", line 736, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File "/opt/conda/lib/python3.7/site-packages/bokeh/server/views/autoload_js_handler.py", line 60, in get
session = yield self.get_session()
File "/opt/conda/lib/python3.7/site-packages/tornado/gen.py", line 729, in run
value = future.result()
File "/opt/conda/lib/python3.7/site-packages/tornado/gen.py", line 736, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File "/opt/conda/lib/python3.7/site-packages/bokeh/server/views/session_handler.py", line 77, in get_session
session = yield self.application_context.create_session_if_needed(session_id, self.request)
File "/opt/conda/lib/python3.7/site-packages/tornado/gen.py", line 729, in run
value = future.result()
File "/opt/conda/lib/python3.7/site-packages/tornado/gen.py", line 742, in run
yielded = self.gen.send(value)
File "/opt/conda/lib/python3.7/site-packages/bokeh/server/contexts.py", line 215, in create_session_if_needed
self._application.initialize_document(doc)
File "/opt/conda/lib/python3.7/site-packages/bokeh/application/application.py", line 178, in initialize_document
h.modify_document(doc)
File "/opt/conda/lib/python3.7/site-packages/bokeh/application/handlers/function.py", line 133, in modify_document
self._func(doc)
File "/home/lig/Codes/NightShift/nightshift/bokeh/dct/instrumentTelem.py", line 113, in make_plot
r = dataGatherer(m, qdata)
File "/home/lig/Codes/NightShift/nightshift/bokeh/dct/instrumentTelem.py", line 37, in dataGatherer
r = pdata['q_insttemps']['deveny']
KeyError: 'deveny'
2019-07-16 20:34:46,640 ERROR 500 GET /lmitemps/autoload.js?bokeh-autoload-element=1123&bokeh-app-path=/lmitemps&bokeh-absolute-url=http://dctsleeperservice:5000/lmitemps&resources=none (192.168.168.194) 1.50ms

@astrobokonon
Copy link
Member Author

To properly fix this, I need to make sure that the dict that gets filled with the query results (qdata) always has the expected keys in it. That's the only way to not have the downstream queries in the dataGatherer functions not completely blow up, though I might not be able to avoid that without re-doing those as well; the .index.to_pydatetime() lines will likely still fail unless I store a blank DataFrame I'm guessing.

@astrobokonon
Copy link
Member Author

Even though I fixed the weather plot failure, it's still not automatically updating the time range if you leave it open for a while. I wonder if I'm having a failure related to the MountTemp that I haven't noticed yet?

@astrobokonon
Copy link
Member Author

This one has to be worked on, when the site is closed all the queries start failing and bokeh ends up in a sort of crash loop, continually gaining memory and getting out of hand. Needs to be fixed so this can be 99.99999% hands off on the backend!

@astrobokonon
Copy link
Member Author

A side note - bokeh 2.0.1 fixes at least the memory leak portion of this, but the crash/exceptions still occur because the dataGather functions fail when they try to pick things out of the (empty) dataframes returned from queries in which no data was found. Interesting, and it gives me a little more buffer time to sort this out properly during the pandemic at least.

@astrobokonon
Copy link
Member Author

I "fixed" the problem by putting in a definitely old/obvious date and a NaN for each column in the dataframe returned by a given query. But it's up to the consumer to actually check to make sure if a dataframe that has data that's just a single NaN point with a date of my birthday makes sense or not. I'm closing this because I'm mainly tired of this issue being open and I think it's at least better, now.

NightWatch automation moved this from To do to Done May 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working High Priority Flag issues that should get more immediate attention
Projects
NightWatch
  
Done
Development

No branches or pull requests

1 participant