Erreur de Timezone dans la lecture / écriture de station_control
Closed this issue · 1 comments
armgilles commented
2021-04-07T08:08:50.090167+00:00 app[web.1]: In station_controle !
2021-04-07T08:08:50.505007+00:00 app[web.1]: Exception on / [GET]
2021-04-07T08:08:50.505019+00:00 app[web.1]: Traceback (most recent call last):
2021-04-07T08:08:50.505020+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/pandas/core/arrays/datetimes.py", line 2054, in objects_to_datetime64ns
2021-04-07T08:08:50.505020+00:00 app[web.1]: values, tz_parsed = conversion.datetime_to_datetime64(data)
2021-04-07T08:08:50.505040+00:00 app[web.1]: File "pandas/_libs/tslibs/conversion.pyx", line 335, in pandas._libs.tslibs.conversion.datetime_to_datetime64
2021-04-07T08:08:50.505040+00:00 app[web.1]: ValueError: Array must be all same time zone
2021-04-07T08:08:50.505041+00:00 app[web.1]:
2021-04-07T08:08:50.505041+00:00 app[web.1]: During handling of the above exception, another exception occurred:
2021-04-07T08:08:50.505042+00:00 app[web.1]:
2021-04-07T08:08:50.505042+00:00 app[web.1]: Traceback (most recent call last):
2021-04-07T08:08:50.505043+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/flask/app.py", line 2447, in wsgi_app
2021-04-07T08:08:50.505043+00:00 app[web.1]: response = self.full_dispatch_request()
2021-04-07T08:08:50.505044+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/flask/app.py", line 1952, in full_dispatch_request
2021-04-07T08:08:50.505044+00:00 app[web.1]: rv = self.handle_user_exception(e)
2021-04-07T08:08:50.505044+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/flask/app.py", line 1821, in handle_user_exception
2021-04-07T08:08:50.505045+00:00 app[web.1]: reraise(exc_type, exc_value, tb)
2021-04-07T08:08:50.505045+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise
2021-04-07T08:08:50.505045+00:00 app[web.1]: raise value
2021-04-07T08:08:50.505046+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/flask/app.py", line 1950, in full_dispatch_request
2021-04-07T08:08:50.505046+00:00 app[web.1]: rv = self.dispatch_request()
2021-04-07T08:08:50.505047+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/flask/app.py", line 1936, in dispatch_request
2021-04-07T08:08:50.505047+00:00 app[web.1]: return self.view_functions[rule.endpoint](**req.view_args)
2021-04-07T08:08:50.505047+00:00 app[web.1]: File "/app/vcub_watcher/app.py", line 83, in station_controle
2021-04-07T08:08:50.505048+00:00 app[web.1]: app.layout = station_controler.station_controler()
2021-04-07T08:08:50.505048+00:00 app[web.1]: File "/app/vcub_watcher/apps/station_controler.py", line 237, in station_controler
2021-04-07T08:08:50.505049+00:00 app[web.1]: station_control = read_station_control_from_s3()
2021-04-07T08:08:50.505049+00:00 app[web.1]: File "/app/vcub_watcher/utils_station_control.py", line 94, in read_station_control_from_s3
2021-04-07T08:08:50.505049+00:00 app[web.1]: pd.to_datetime(station_control['last_date_anomaly'])
2021-04-07T08:08:50.505058+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/pandas/core/tools/datetimes.py", line 799, in to_datetime
2021-04-07T08:08:50.505059+00:00 app[web.1]: cache_array = _maybe_cache(arg, format, cache, convert_listlike)
2021-04-07T08:08:50.505059+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/pandas/core/tools/datetimes.py", line 170, in _maybe_cache
2021-04-07T08:08:50.505060+00:00 app[web.1]: cache_dates = convert_listlike(unique_dates, format)
2021-04-07T08:08:50.505061+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/pandas/core/tools/datetimes.py", line 459, in _convert_listlike_datetimes
2021-04-07T08:08:50.505062+00:00 app[web.1]: result, tz_parsed = objects_to_datetime64ns(
2021-04-07T08:08:50.505062+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/pandas/core/arrays/datetimes.py", line 2059, in objects_to_datetime64ns
2021-04-07T08:08:50.505062+00:00 app[web.1]: raise e
2021-04-07T08:08:50.505063+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/pandas/core/arrays/datetimes.py", line 2044, in objects_to_datetime64ns
2021-04-07T08:08:50.505063+00:00 app[web.1]: result, tz_parsed = tslib.array_to_datetime(
2021-04-07T08:08:50.505063+00:00 app[web.1]: File "pandas/_libs/tslib.pyx", line 352, in pandas._libs.tslib.array_to_datetime
2021-04-07T08:08:50.505064+00:00 app[web.1]: File "pandas/_libs/tslib.pyx", line 435, in pandas._libs.tslib.array_to_datetime
2021-04-07T08:08:50.505064+00:00 app[web.1]: ValueError: Tz-aware datetime.datetime cannot be converted to datetime64 unless utc=True
2021-04-07T08:08:50.506574+00:00 app[web.1]: 10.12.198.80 - - [07/Apr/2021:08:08:50 +0000] "GET / HTTP/1.1" 500 290 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36"
2021-04-07T08:08:50.506846+00:00 heroku[router]: at=info method=GET path="/" host=vcubwatcher.herokuapp.com request_id=821413d1-dd4e-41cc-b5ac-680251d7ef8b fwd="31.36.90.167" dyno=web.1 connect=1ms service=494ms status=500 bytes=504 protocol=https
Et aussi durant le bach toutes les 10 minutes :
2021-04-07T08:12:45.678831+00:00 app[api]: Starting process with command `python vcub_watcher/detect_anomaly.py` by user scheduler@addons.heroku.com
2021-04-07T08:13:00.358455+00:00 heroku[scheduler.9626]: Starting process with command `python vcub_watcher/detect_anomaly.py`
2021-04-07T08:13:00.980086+00:00 heroku[scheduler.9626]: State changed from starting to up
2021-04-07T08:13:14.357693+00:00 heroku[scheduler.9626]: Process exited with status 1
2021-04-07T08:13:14.409938+00:00 heroku[scheduler.9626]: State changed from up to complete
2021-04-07T08:13:14.145041+00:00 app[scheduler.9626]: Traceback (most recent call last):
2021-04-07T08:13:14.145063+00:00 app[scheduler.9626]: File "/app/.heroku/python/lib/python3.8/site-packages/pandas/core/arrays/datetimes.py", line 2054, in objects_to_datetime64ns
2021-04-07T08:13:14.145733+00:00 app[scheduler.9626]: values, tz_parsed = conversion.datetime_to_datetime64(data)
2021-04-07T08:13:14.145738+00:00 app[scheduler.9626]: File "pandas/_libs/tslibs/conversion.pyx", line 335, in pandas._libs.tslibs.conversion.datetime_to_datetime64
2021-04-07T08:13:14.145897+00:00 app[scheduler.9626]: ValueError: Array must be all same time zone
2021-04-07T08:13:14.145900+00:00 app[scheduler.9626]:
2021-04-07T08:13:14.145901+00:00 app[scheduler.9626]: During handling of the above exception, another exception occurred:
2021-04-07T08:13:14.145902+00:00 app[scheduler.9626]:
2021-04-07T08:13:14.145903+00:00 app[scheduler.9626]: Traceback (most recent call last):
2021-04-07T08:13:14.145920+00:00 app[scheduler.9626]: File "vcub_watcher/detect_anomaly.py", line 48, in <module>
2021-04-07T08:13:14.146037+00:00 app[scheduler.9626]: station_control = read_station_control_from_s3()
2021-04-07T08:13:14.146057+00:00 app[scheduler.9626]: File "/app/vcub_watcher/utils_station_control.py", line 94, in read_station_control_from_s3
2021-04-07T08:13:14.146175+00:00 app[scheduler.9626]: pd.to_datetime(station_control['last_date_anomaly'])
2021-04-07T08:13:14.146195+00:00 app[scheduler.9626]: File "/app/.heroku/python/lib/python3.8/site-packages/pandas/core/tools/datetimes.py", line 799, in to_datetime
2021-04-07T08:13:14.146528+00:00 app[scheduler.9626]: cache_array = _maybe_cache(arg, format, cache, convert_listlike)
2021-04-07T08:13:14.146549+00:00 app[scheduler.9626]: File "/app/.heroku/python/lib/python3.8/site-packages/pandas/core/tools/datetimes.py", line 170, in _maybe_cache
2021-04-07T08:13:14.146673+00:00 app[scheduler.9626]: cache_dates = convert_listlike(unique_dates, format)
2021-04-07T08:13:14.146695+00:00 app[scheduler.9626]: File "/app/.heroku/python/lib/python3.8/site-packages/pandas/core/tools/datetimes.py", line 459, in _convert_listlike_datetimes
2021-04-07T08:13:14.146885+00:00 app[scheduler.9626]: result, tz_parsed = objects_to_datetime64ns(
2021-04-07T08:13:14.146907+00:00 app[scheduler.9626]: File "/app/.heroku/python/lib/python3.8/site-packages/pandas/core/arrays/datetimes.py", line 2059, in objects_to_datetime64ns
2021-04-07T08:13:14.147490+00:00 app[scheduler.9626]: raise e
2021-04-07T08:13:14.147493+00:00 app[scheduler.9626]: File "/app/.heroku/python/lib/python3.8/site-packages/pandas/core/arrays/datetimes.py", line 2044, in objects_to_datetime64ns
2021-04-07T08:13:14.148098+00:00 app[scheduler.9626]: result, tz_parsed = tslib.array_to_datetime(
2021-04-07T08:13:14.148118+00:00 app[scheduler.9626]: File "pandas/_libs/tslib.pyx", line 352, in pandas._libs.tslib.array_to_datetime
2021-04-07T08:13:14.148230+00:00 app[scheduler.9626]: File "pandas/_libs/tslib.pyx", line 435, in pandas._libs.tslib.array_to_datetime
2021-04-07T08:13:14.148328+00:00 app[scheduler.9626]: ValueError: Tz-aware datetime.datetime cannot be converted to datetime64 unless utc=True
armgilles commented
Wrong repo for this