Commit b3580758 authored by Vladislav Rykov's avatar Vladislav Rykov
Browse files

fixed recent-activity when one device is empty, gitignore env, db.sql & preset update

parent 6ee038d7
[2020-06-10 19:17:46,564] INFO in views: Logged out user admin
[2020-06-10 19:18:00,168] INFO in views: Logged in user admin
[2020-06-10 19:18:19,269] INFO in views: User admin created new application - test
[2020-06-10 19:18:47,866] INFO in views: User admin added new device dev1 test for application 0513d8d9
[2020-06-10 19:19:21,955] INFO in views: User admin created alert 7d6c9e - dev1 test.a > 0 for application 0513d8d9
[2020-06-10 19:19:32,734] INFO in views: User admin deleted alert 7d6c9e for application 0513d8d9
[2020-06-10 19:20:04,752] INFO in views: User admin created automation 14f87d - IF dev1 test.a > 0 THEN dev1 test.confID_1 = 1 for application 0513d8d9
[2020-06-10 19:20:12,716] INFO in views: User admin deleted automation 14f87d for application 0513d8d9
[2020-06-10 19:20:35,490] INFO in views: User admin deleted device 1 for application 0513d8d9
[2020-06-10 19:22:26,286] INFO in views: User admin deleted config messsage AQIxAA== for application 0513d8d9 device 1
[2020-06-10 19:26:21,369] INFO in views: User admin downloaded data for application 0513d8d9 device 1
[2020-06-10 19:26:44,083] INFO in views: User admin deleted for application 0513d8d9 device 1
[2020-06-10 19:26:58,457] INFO in views: User admin deleted application - 0513d8d9
[2020-06-11 09:29:26,446] WARNING in views_admin: Administrator admin created new user lolo
[2020-06-11 09:39:23,858] WARNING in views_admin: Administrator admin created new user lolo
[2020-06-11 09:39:39,600] WARNING in views_admin: Administrator admin deleted user lolo
[2020-06-11 09:40:02,339] WARNING in views_admin: Administrator admin created new application 598bee34 for user-user
[2020-06-11 09:40:34,846] ERROR in views_admin: Administrator admin failed to add device application e38dc490 for user-user - INSERT has more expressions than target columns
LINE 5: ('asd', '1', 'asd', '\x7b226d6f64656c223a20226a736f6...
^
[2020-06-11 09:41:26,391] ERROR in views_admin: Administrator admin failed to add device application e38dc490 for user-user - INSERT has more expressions than target columns
LINE 5: ('dev1 test', '1', 'dsds', '\x7b226d6f64656c223a2022...
^
[2020-06-11 09:50:18,424] WARNING in views_admin: Administrator admin created new application 5e4932cc for user-user
[2020-06-11 09:50:36,442] WARNING in views_admin: Administrator admin added new device 1 application 5e4932cc for user-user
[2020-06-11 09:50:59,309] WARNING in views_admin: Administrator admin created alert 7d7a6d for application 5e4932cc for user-user
[2020-06-11 09:53:15,478] WARNING in views_admin: Administrator admin created alert 8b867b for application 5e4932cc for user-user
[2020-06-11 09:53:19,487] WARNING in views_admin: Administrator admin deleted alert 8b867b for application 5e4932cc for user-user
[2020-06-11 09:53:52,334] WARNING in views_admin: Administrator admin created automation 72249b for application 5e4932cc for user-user
[2020-06-11 09:54:00,999] WARNING in views_admin: Administrator admin deleted automation 72249b for application 5e4932cc for user-user
[2020-06-11 09:54:21,228] WARNING in views_admin: Administrator admin changed settings for application 5e4932cc for user-user
[2020-06-11 09:54:28,518] WARNING in views_admin: Administrator admin deleted application 5e4932cc for user-user
[2020-06-11 09:55:16,026] INFO in views: User admin created new application - test
[2020-06-11 10:01:02,029] INFO in views: User admin deleted application - 649fd3ab
[2020-06-30 10:56:32,460] INFO in views: Logged in superuser admin
[2020-06-30 10:57:05,008] INFO in views: Logged in superuser admin
[2020-06-30 12:36:13,017] ERROR in views: superuser admin failed to create alert for application 3b56f3d8 - 400 Bad Request: The browser (or proxy) sent a request that this server could not understand.
[2020-06-30 12:38:40,214] ERROR in views: superuser admin failed to create alert for application 3b56f3d8 - 400 Bad Request: The browser (or proxy) sent a request that this server could not understand.
[2020-06-30 12:40:31,061] ERROR in views: superuser admin failed to create alert for application 3b56f3d8 - 400 Bad Request: The browser (or proxy) sent a request that this server could not understand.
[2020-06-30 12:41:36,826] ERROR in views: superuser admin failed to create alert for application 3b56f3d8 - 'alert'
[2020-06-30 13:05:01,368] ERROR in views: superuser admin failed to create alert for application 3b56f3d8 - Exception: 'alert'
[2020-06-30 13:06:54,240] INFO in views: superuser admin created alert 884e51 - ddmjson.temperature > 0 for application 3b56f3d8
[2020-06-30 14:27:24,473] ERROR in app: Exception on /application/3b56f3d8/alerts [GET]
Traceback (most recent call last):
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "./app/helpers/decorators.py", line 23, in restricted_function
return f(*args, **kwargs)
File "./app/helpers/decorators.py", line 35, in protected_function
return f(*args, **kwargs)
File "./app/views.py", line 495, in application_alerts
return render_template('new/public/alerts.html', alert_list=alerts[1], app=ap[1])
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/templating.py", line 140, in render_template
ctx.app,
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/templating.py", line 120, in _render
rv = template.render(context)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/jinja2/environment.py", line 1090, in render
self.environment.handle_exception()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/jinja2/environment.py", line 832, in handle_exception
reraise(*rewrite_traceback_stack(source=source))
File "/home/pi/thso.server/env/lib/python3.7/site-packages/jinja2/_compat.py", line 28, in reraise
raise value.with_traceback(tb)
File "/home/pi/thso.server/app/app/templates/new/public/alerts.html", line 1, in top-level template code
{% extends 'logged_layout.html' %}
File "/home/pi/thso.server/app/app/templates/logged_layout.html", line 1, in top-level template code
{% extends 'general_layout.html' %}
File "/home/pi/thso.server/app/app/templates/general_layout.html", line 35, in top-level template code
{% block content %} {% endblock %}
File "/home/pi/thso.server/app/app/templates/logged_layout.html", line 196, in block "content"
{% block body %} {% endblock %}
File "/home/pi/thso.server/app/app/templates/new/public/alerts.html", line 36, in block "body"
{% for a in alert_list %}
TypeError: 'IndexError' object is not iterable
[2020-06-30 14:27:58,458] ERROR in app: Exception on /application/3b56f3d8/alerts [GET]
Traceback (most recent call last):
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "./app/helpers/decorators.py", line 23, in restricted_function
return f(*args, **kwargs)
File "./app/helpers/decorators.py", line 35, in protected_function
return f(*args, **kwargs)
File "./app/views.py", line 495, in application_alerts
return render_template('new/public/alerts.html', alert_list=alerts[1], app=ap[1])
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/templating.py", line 140, in render_template
ctx.app,
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/templating.py", line 120, in _render
rv = template.render(context)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/jinja2/environment.py", line 1090, in render
self.environment.handle_exception()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/jinja2/environment.py", line 832, in handle_exception
reraise(*rewrite_traceback_stack(source=source))
File "/home/pi/thso.server/env/lib/python3.7/site-packages/jinja2/_compat.py", line 28, in reraise
raise value.with_traceback(tb)
File "/home/pi/thso.server/app/app/templates/new/public/alerts.html", line 1, in top-level template code
{% extends 'logged_layout.html' %}
File "/home/pi/thso.server/app/app/templates/logged_layout.html", line 1, in top-level template code
{% extends 'general_layout.html' %}
File "/home/pi/thso.server/app/app/templates/general_layout.html", line 35, in top-level template code
{% block content %} {% endblock %}
File "/home/pi/thso.server/app/app/templates/logged_layout.html", line 196, in block "content"
{% block body %} {% endblock %}
File "/home/pi/thso.server/app/app/templates/new/public/alerts.html", line 36, in block "body"
{% for a in alert_list %}
TypeError: 'IndexError' object is not iterable
[2020-06-30 14:29:43,392] ERROR in app: Exception on /application/3b56f3d8/alerts [GET]
Traceback (most recent call last):
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "./app/helpers/decorators.py", line 23, in restricted_function
return f(*args, **kwargs)
File "./app/helpers/decorators.py", line 35, in protected_function
return f(*args, **kwargs)
File "./app/views.py", line 495, in application_alerts
return render_template('new/public/alerts.html', alert_list=alerts[1], app=ap[1])
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/templating.py", line 140, in render_template
ctx.app,
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/templating.py", line 120, in _render
rv = template.render(context)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/jinja2/environment.py", line 1090, in render
self.environment.handle_exception()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/jinja2/environment.py", line 832, in handle_exception
reraise(*rewrite_traceback_stack(source=source))
File "/home/pi/thso.server/env/lib/python3.7/site-packages/jinja2/_compat.py", line 28, in reraise
raise value.with_traceback(tb)
File "/home/pi/thso.server/app/app/templates/new/public/alerts.html", line 1, in top-level template code
{% extends 'logged_layout.html' %}
File "/home/pi/thso.server/app/app/templates/logged_layout.html", line 1, in top-level template code
{% extends 'general_layout.html' %}
File "/home/pi/thso.server/app/app/templates/general_layout.html", line 35, in top-level template code
{% block content %} {% endblock %}
File "/home/pi/thso.server/app/app/templates/logged_layout.html", line 196, in block "content"
{% block body %} {% endblock %}
File "/home/pi/thso.server/app/app/templates/new/public/alerts.html", line 36, in block "body"
{% for a in alert_list %}
TypeError: 'IndexError' object is not iterable
[2020-06-30 14:36:01,025] ERROR in app: Exception on /application/3b56f3d8/alerts [GET]
Traceback (most recent call last):
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "./app/helpers/decorators.py", line 23, in restricted_function
return f(*args, **kwargs)
File "./app/helpers/decorators.py", line 35, in protected_function
return f(*args, **kwargs)
File "./app/views.py", line 495, in application_alerts
return render_template('new/public/alerts.html', alert_list=alerts[1], app=ap[1])
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/templating.py", line 140, in render_template
ctx.app,
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/templating.py", line 120, in _render
rv = template.render(context)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/jinja2/environment.py", line 1090, in render
self.environment.handle_exception()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/jinja2/environment.py", line 832, in handle_exception
reraise(*rewrite_traceback_stack(source=source))
File "/home/pi/thso.server/env/lib/python3.7/site-packages/jinja2/_compat.py", line 28, in reraise
raise value.with_traceback(tb)
File "/home/pi/thso.server/app/app/templates/new/public/alerts.html", line 1, in top-level template code
{% extends 'logged_layout.html' %}
File "/home/pi/thso.server/app/app/templates/logged_layout.html", line 1, in top-level template code
{% extends 'general_layout.html' %}
File "/home/pi/thso.server/app/app/templates/general_layout.html", line 35, in top-level template code
{% block content %} {% endblock %}
File "/home/pi/thso.server/app/app/templates/logged_layout.html", line 196, in block "content"
{% block body %} {% endblock %}
File "/home/pi/thso.server/app/app/templates/new/public/alerts.html", line 36, in block "body"
{% for a in alert_list %}
TypeError: 'IndexError' object is not iterable
[2020-06-30 14:36:08,046] ERROR in app: Exception on /application/3b56f3d8/alerts [GET]
Traceback (most recent call last):
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "./app/helpers/decorators.py", line 23, in restricted_function
return f(*args, **kwargs)
File "./app/helpers/decorators.py", line 35, in protected_function
return f(*args, **kwargs)
File "./app/views.py", line 495, in application_alerts
return render_template('new/public/alerts.html', alert_list=alerts[1], app=ap[1])
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/templating.py", line 140, in render_template
ctx.app,
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/templating.py", line 120, in _render
rv = template.render(context)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/jinja2/environment.py", line 1090, in render
self.environment.handle_exception()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/jinja2/environment.py", line 832, in handle_exception
reraise(*rewrite_traceback_stack(source=source))
File "/home/pi/thso.server/env/lib/python3.7/site-packages/jinja2/_compat.py", line 28, in reraise
raise value.with_traceback(tb)
File "/home/pi/thso.server/app/app/templates/new/public/alerts.html", line 1, in top-level template code
{% extends 'logged_layout.html' %}
File "/home/pi/thso.server/app/app/templates/logged_layout.html", line 1, in top-level template code
{% extends 'general_layout.html' %}
File "/home/pi/thso.server/app/app/templates/general_layout.html", line 35, in top-level template code
{% block content %} {% endblock %}
File "/home/pi/thso.server/app/app/templates/logged_layout.html", line 196, in block "content"
{% block body %} {% endblock %}
File "/home/pi/thso.server/app/app/templates/new/public/alerts.html", line 36, in block "body"
{% for a in alert_list %}
TypeError: 'IndexError' object is not iterable
[2020-06-30 16:52:38,747] INFO in views: superuser admin deleted alert 884e51 for application 3b56f3d8
[2020-06-30 16:52:41,086] INFO in views: superuser admin deleted alert 7201c2 for application 3b56f3d8
[2020-06-30 17:02:58,029] ERROR in app: Exception on /application/3b56f3d8/device/1/download-csv [GET]
Traceback (most recent call last):
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "./app/helpers/decorators.py", line 23, in restricted_function
return f(*args, **kwargs)
File "./app/helpers/decorators.py", line 35, in protected_function
return f(*args, **kwargs)
File "./app/views.py", line 332, in application_device_download_csv
f.write(str(row[2][v]))
TypeError: memoryview: invalid slice key
[2020-06-30 17:10:07,673] ERROR in app: Exception on /recent-activity [GET]
Traceback (most recent call last):
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "./app/helpers/decorators.py", line 23, in restricted_function
return f(*args, **kwargs)
File "./app/views.py", line 366, in recent_activity
ra += '<tr><th scope="row">'+r[1]+'</th><th>'+r[2]+'</th><th>'+r[0]+'</th><th>'+str(ddm.read_data(r[3], dev[3]))+'</th></tr>'
File "./app/helpers/device_data_model.py", line 147, in read_data
return json.loads(data.decode('utf-8'))
AttributeError: 'memoryview' object has no attribute 'decode'
[2020-06-30 17:17:18,567] ERROR in app: Exception on /application/3b56f3d8/alerts [GET]
Traceback (most recent call last):
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "./app/helpers/decorators.py", line 23, in restricted_function
return f(*args, **kwargs)
File "./app/helpers/decorators.py", line 35, in protected_function
return f(*args, **kwargs)
File "./app/views.py", line 495, in application_alerts
return render_template('new/public/alerts.html', alert_list=alerts[1], app=ap[1])
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/templating.py", line 138, in render_template
ctx.app.jinja_env.get_or_select_template(template_name_or_list),
File "/home/pi/thso.server/env/lib/python3.7/site-packages/jinja2/environment.py", line 930, in get_or_select_template
return self.get_template(template_name_or_list, parent, globals)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/jinja2/environment.py", line 883, in get_template
return self._load_template(name, self.make_globals(globals))
File "/home/pi/thso.server/env/lib/python3.7/site-packages/jinja2/environment.py", line 857, in _load_template
template = self.loader.load(self, name, globals)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/jinja2/loaders.py", line 127, in load
code = environment.compile(source, name, filename)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/jinja2/environment.py", line 638, in compile
self.handle_exception(source=source_hint)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/jinja2/environment.py", line 832, in handle_exception
reraise(*rewrite_traceback_stack(source=source))
File "/home/pi/thso.server/env/lib/python3.7/site-packages/jinja2/_compat.py", line 28, in reraise
raise value.with_traceback(tb)
File "/home/pi/thso.server/app/app/templates/new/public/alerts.html", line 41, in template
<th> {{ a[5]|split('_')[1] }} </th>
jinja2.exceptions.TemplateSyntaxError: expected token 'end of print statement', got '['
[2020-06-30 17:17:44,630] ERROR in app: Exception on /application/3b56f3d8/alerts [GET]
Traceback (most recent call last):
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "./app/helpers/decorators.py", line 23, in restricted_function
return f(*args, **kwargs)
File "./app/helpers/decorators.py", line 35, in protected_function
return f(*args, **kwargs)
File "./app/views.py", line 495, in application_alerts
return render_template('new/public/alerts.html', alert_list=alerts[1], app=ap[1])
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/templating.py", line 138, in render_template
ctx.app.jinja_env.get_or_select_template(template_name_or_list),
File "/home/pi/thso.server/env/lib/python3.7/site-packages/jinja2/environment.py", line 930, in get_or_select_template
return self.get_template(template_name_or_list, parent, globals)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/jinja2/environment.py", line 883, in get_template
return self._load_template(name, self.make_globals(globals))
File "/home/pi/thso.server/env/lib/python3.7/site-packages/jinja2/environment.py", line 857, in _load_template
template = self.loader.load(self, name, globals)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/jinja2/loaders.py", line 127, in load
code = environment.compile(source, name, filename)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/jinja2/environment.py", line 638, in compile
self.handle_exception(source=source_hint)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/jinja2/environment.py", line 832, in handle_exception
reraise(*rewrite_traceback_stack(source=source))
File "/home/pi/thso.server/env/lib/python3.7/site-packages/jinja2/_compat.py", line 28, in reraise
raise value.with_traceback(tb)
File "/home/pi/thso.server/app/app/templates/new/public/alerts.html", line 41, in template
<th> {{ a[5]|split('_')[1] }} </th>
jinja2.exceptions.TemplateSyntaxError: expected token 'end of print statement', got '['
[2020-06-30 17:18:31,111] INFO in views: superuser admin created alert 8bbd83 - devmpack.lever == 1 for application 3b56f3d8
[2020-06-30 17:19:11,846] INFO in views: superuser admin created alert ddb142 - ddmjson.lever == 0 for application 3b56f3d8
[2020-06-30 17:41:15,560] ERROR in app: Exception on /administration/admin/recent-activity [GET]
Traceback (most recent call last):
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "./app/helpers/decorators.py", line 23, in restricted_function
return f(*args, **kwargs)
File "./app/views_admin.py", line 518, in administration_user_recent_activity
ra += '<tr><th scope="row">'+r[1]+'</th><th>'+r[2]+'</th><th>'+r[0]+'</th><th>'+str(ddm.read_data(r[3], dev[3]))+'</th></tr>'
File "./app/helpers/device_data_model.py", line 147, in read_data
return json.loads(data.decode('utf-8'))
AttributeError: 'memoryview' object has no attribute 'decode'
[2020-06-30 17:44:34,584] WARNING in views_admin: Administrator admin created alert 7ab5c9 for application 3b56f3d8 for admin
[2020-06-30 17:52:07,946] WARNING in views_admin: Administrator admin created alert 3235b2 for application 3b56f3d8 for admin
[2020-06-30 17:52:27,874] WARNING in views_admin: Administrator admin deleted alert 3235b2 for application 3b56f3d8 for admin
[2020-07-02 08:31:28,405] ERROR in app: Exception on /recent-activity [GET]
Traceback (most recent call last):
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "./app/helpers/decorators.py", line 23, in restricted_function
return f(*args, **kwargs)
File "./app/views.py", line 366, in recent_activity
ra += '<tr><th scope="row">'+r[1]+'</th><th>'+r[2]+'</th><th>'+r[0]+'</th><th>'+str(ddm.read_data(r[3], dev[3]))+'</th></tr>'
File "./app/helpers/device_data_model.py", line 147, in read_data
return json.loads(data.decode('utf-8'))
AttributeError: 'memoryview' object has no attribute 'decode'
[2020-07-02 08:31:37,913] ERROR in app: Exception on /recent-activity [GET]
Traceback (most recent call last):
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "./app/helpers/decorators.py", line 23, in restricted_function
return f(*args, **kwargs)
File "./app/views.py", line 366, in recent_activity
ra += '<tr><th scope="row">'+r[1]+'</th><th>'+r[2]+'</th><th>'+r[0]+'</th><th>'+str(ddm.read_data(r[3], dev[3]))+'</th></tr>'
File "./app/helpers/device_data_model.py", line 147, in read_data
return json.loads(data.decode('utf-8'))
AttributeError: 'memoryview' object has no attribute 'decode'
[2020-07-02 08:41:27,514] ERROR in app: Exception on /recent-activity [GET]
Traceback (most recent call last):
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "./app/helpers/decorators.py", line 23, in restricted_function
return f(*args, **kwargs)
File "./app/views.py", line 366, in recent_activity
ra += '<tr><th scope="row">'+r[1]+'</th><th>'+r[2]+'</th><th>'+r[0]+'</th><th>'+str(ddm.read_data(r[3], dev[3]))+'</th></tr>'
File "./app/helpers/device_data_model.py", line 147, in read_data
return json.loads(data.decode('utf-8'))
AttributeError: 'memoryview' object has no attribute 'decode'
[2020-07-02 08:46:12,330] ERROR in app: Exception on /application/3b56f3d8/device/1/download-csv [GET]
Traceback (most recent call last):
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "./app/helpers/decorators.py", line 23, in restricted_function
return f(*args, **kwargs)
File "./app/helpers/decorators.py", line 35, in protected_function
return f(*args, **kwargs)
File "./app/views.py", line 329, in application_device_download_csv
f.write(str(row[2][v]))
TypeError: memoryview: invalid slice key
[2020-07-02 08:48:37,151] ERROR in app: Exception on /application/3b56f3d8/device/1/download-csv [GET]
Traceback (most recent call last):
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "./app/helpers/decorators.py", line 23, in restricted_function
return f(*args, **kwargs)
File "./app/helpers/decorators.py", line 35, in protected_function
return f(*args, **kwargs)
File "./app/views.py", line 330, in application_device_download_csv
f.write(str(row[2][v]))
TypeError: memoryview: invalid slice key
[2020-07-02 08:49:03,582] ERROR in app: Exception on /application/3b56f3d8/device/1/download-csv [GET]
Traceback (most recent call last):
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "./app/helpers/decorators.py", line 23, in restricted_function
return f(*args, **kwargs)
File "./app/helpers/decorators.py", line 35, in protected_function
return f(*args, **kwargs)
File "./app/views.py", line 329, in application_device_download_csv
f.write(str(row[2][v]))
TypeError: memoryview: invalid slice key
[2020-07-02 08:49:49,243] ERROR in app: Exception on /application/3b56f3d8/device/1/download-csv [GET]
Traceback (most recent call last):
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "./app/helpers/decorators.py", line 23, in restricted_function
return f(*args, **kwargs)
File "./app/helpers/decorators.py", line 35, in protected_function
return f(*args, **kwargs)
File "./app/views.py", line 330, in application_device_download_csv
f.write(str(row[2][v]))
TypeError: memoryview: invalid slice key
[2020-07-02 08:53:44,833] ERROR in app: Exception on /application/3b56f3d8/device/1/download-csv [GET]
Traceback (most recent call last):
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "./app/helpers/decorators.py", line 23, in restricted_function
return f(*args, **kwargs)
File "./app/helpers/decorators.py", line 35, in protected_function
return f(*args, **kwargs)
File "./app/views.py", line 330, in application_device_download_csv
row[2] = ddm.read_data(v[3], dev[3])
IndexError: index out of range
[2020-07-02 08:57:52,129] ERROR in app: Exception on /application/3b56f3d8/device/1/download-csv [GET]
Traceback (most recent call last):
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "./app/helpers/decorators.py", line 23, in restricted_function
return f(*args, **kwargs)
File "./app/helpers/decorators.py", line 35, in protected_function
return f(*args, **kwargs)
File "./app/views.py", line 329, in application_device_download_csv
decoded = ddm.read_data(v[3], dev[3])
UnboundLocalError: local variable 'v' referenced before assignment
[2020-07-02 08:58:29,761] ERROR in app: Exception on /application/3b56f3d8/device/1/download-csv [GET]
Traceback (most recent call last):
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "./app/helpers/decorators.py", line 23, in restricted_function
return f(*args, **kwargs)
File "./app/helpers/decorators.py", line 35, in protected_function
return f(*args, **kwargs)
File "./app/views.py", line 329, in application_device_download_csv
decoded = ddm.read_data(row[3], dev[3])
IndexError: tuple index out of range
[2020-07-02 08:59:00,026] ERROR in app: Exception on /application/3b56f3d8/device/1/download-csv [GET]
Traceback (most recent call last):
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "./app/helpers/decorators.py", line 23, in restricted_function
return f(*args, **kwargs)
File "./app/helpers/decorators.py", line 35, in protected_function
return f(*args, **kwargs)
File "./app/views.py", line 329, in application_device_download_csv
decoded = ddm.read_data(row[3], dev[3])
IndexError: tuple index out of range
[2020-07-02 08:59:34,338] ERROR in app: Exception on /application/3b56f3d8/device/1/download-csv [GET]
Traceback (most recent call last):
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "./app/helpers/decorators.py", line 23, in restricted_function
return f(*args, **kwargs)
File "./app/helpers/decorators.py", line 35, in protected_function
return f(*args, **kwargs)
File "./app/views.py", line 329, in application_device_download_csv
decoded = ddm.read_data(row[2], dev[3])
File "./app/helpers/device_data_model.py", line 147, in read_data
return json.loads(data.decode('utf-8'))
AttributeError: 'memoryview' object has no attribute 'decode'
[2020-07-02 09:00:07,675] INFO in views: superuser admin downloaded data for application 3b56f3d8 device 1
[2020-07-04 00:16:20,078] ERROR in app: Exception on /recent-activity [GET]
Traceback (most recent call last):
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "./app/helpers/decorators.py", line 23, in restricted_function
return f(*args, **kwargs)
File "./app/views.py", line 364, in recent_activity
ra += '<tr><th scope="row">'+r[1]+'</th><th>'+r[2]+'</th><th>'+r[0]+'</th><th>'+str(ddm.read_data(r[3], dev[3]))+'</th></tr>'
File "./app/helpers/device_data_model.py", line 147, in read_data
return json.loads(data.decode('utf-8'))
AttributeError: 'memoryview' object has no attribute 'decode'
[2020-07-04 00:18:34,018] ERROR in app: Exception on /application/3b56f3d8 [GET]
Traceback (most recent call last):
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "./app/helpers/decorators.py", line 23, in restricted_function
return f(*args, **kwargs)
File "./app/helpers/decorators.py", line 35, in protected_function
return f(*args, **kwargs)
File "./app/views.py", line 122, in application
return render_template('views/public/application.html', app=ap, devs=devs)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/templating.py", line 140, in render_template
ctx.app,
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/templating.py", line 120, in _render
rv = template.render(context)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/jinja2/environment.py", line 1090, in render
self.environment.handle_exception()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/jinja2/environment.py", line 832, in handle_exception
reraise(*rewrite_traceback_stack(source=source))
File "/home/pi/thso.server/env/lib/python3.7/site-packages/jinja2/_compat.py", line 28, in reraise
raise value.with_traceback(tb)
File "/home/pi/thso.server/app/app/templates/views/public/application.html", line 1, in top-level template code
{% extends 'logged_layout.html' %}
File "/home/pi/thso.server/app/app/templates/logged_layout.html", line 1, in top-level template code
{% extends 'general_layout.html' %}
File "/home/pi/thso.server/app/app/templates/general_layout.html", line 35, in top-level template code
{% block content %} {% endblock %}
File "/home/pi/thso.server/app/app/templates/logged_layout.html", line 196, in block "content"
{% block body %} {% endblock %}
File "/home/pi/thso.server/app/app/templates/views/public/application.html", line 97, in block "body"
<p class="card-text">{{ app[5].encode('UTF-8') }}</p>
jinja2.exceptions.UndefinedError: 'bytes object' has no attribute 'encode'
[2020-07-04 00:18:43,044] ERROR in app: Exception on /application/3b56f3d8 [GET]
Traceback (most recent call last):
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "./app/helpers/decorators.py", line 23, in restricted_function
return f(*args, **kwargs)
File "./app/helpers/decorators.py", line 35, in protected_function
return f(*args, **kwargs)
File "./app/views.py", line 122, in application
return render_template('views/public/application.html', app=ap, devs=devs)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/templating.py", line 140, in render_template
ctx.app,
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/templating.py", line 120, in _render
rv = template.render(context)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/jinja2/environment.py", line 1090, in render
self.environment.handle_exception()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/jinja2/environment.py", line 832, in handle_exception
reraise(*rewrite_traceback_stack(source=source))
File "/home/pi/thso.server/env/lib/python3.7/site-packages/jinja2/_compat.py", line 28, in reraise
raise value.with_traceback(tb)
File "/home/pi/thso.server/app/app/templates/views/public/application.html", line 1, in top-level template code
{% extends 'logged_layout.html' %}
File "/home/pi/thso.server/app/app/templates/logged_layout.html", line 1, in top-level template code
{% extends 'general_layout.html' %}
File "/home/pi/thso.server/app/app/templates/general_layout.html", line 35, in top-level template code
{% block content %} {% endblock %}
File "/home/pi/thso.server/app/app/templates/logged_layout.html", line 196, in block "content"
{% block body %} {% endblock %}
File "/home/pi/thso.server/app/app/templates/views/public/application.html", line 97, in block "body"
<p class="card-text">{{ app[5].encode('UTF-8') }}</p>
jinja2.exceptions.UndefinedError: 'bytes object' has no attribute 'encode'
[2020-07-04 03:22:52,681] ERROR in app: Exception on /recent-activity [GET]
Traceback (most recent call last):
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "./app/helpers/decorators.py", line 23, in restricted_function
return f(*args, **kwargs)
File "./app/views.py", line 364, in recent_activity
ra += '<tr><th scope="row">'+r[1]+'</th><th>'+r[2]+'</th><th>'+r[0]+'</th><th>'+str(ddm.read_data(r[3], dev[3]))+'</th></tr>'
File "./app/helpers/device_data_model.py", line 147, in read_data
return json.loads(data.decode('utf-8'))
AttributeError: 'memoryview' object has no attribute 'decode'
[2020-07-04 03:23:51,755] INFO in views: superuser admin deleted alert ddb142 for application 3b56f3d8
[2020-07-04 03:23:56,835] INFO in views: superuser admin deleted alert 8bbd83 for application 3b56f3d8
[2020-07-04 03:23:58,716] INFO in views: superuser admin deleted alert 2d1c54 for application 3b56f3d8
[2020-07-04 03:36:38,353] ERROR in app: Exception on /application/3b56f3d8/device/1 [GET]
Traceback (most recent call last):
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "./app/helpers/decorators.py", line 23, in restricted_function
return f(*args, **kwargs)
File "./app/helpers/decorators.py", line 35, in protected_function
return f(*args, **kwargs)
File "./app/views.py", line 208, in application_device
return render_template('views/public/device.html', dev=dev[1], app=ap[1], ltup=ltup, total=cnt[1][0], table_max=MAX_PG_ENTRIES_DATA)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/templating.py", line 138, in render_template
ctx.app.jinja_env.get_or_select_template(template_name_or_list),
File "/home/pi/thso.server/env/lib/python3.7/site-packages/jinja2/environment.py", line 930, in get_or_select_template
return self.get_template(template_name_or_list, parent, globals)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/jinja2/environment.py", line 883, in get_template
return self._load_template(name, self.make_globals(globals))
File "/home/pi/thso.server/env/lib/python3.7/site-packages/jinja2/environment.py", line 857, in _load_template
template = self.loader.load(self, name, globals)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/jinja2/loaders.py", line 127, in load
code = environment.compile(source, name, filename)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/jinja2/environment.py", line 638, in compile
self.handle_exception(source=source_hint)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/jinja2/environment.py", line 832, in handle_exception
reraise(*rewrite_traceback_stack(source=source))
File "/home/pi/thso.server/env/lib/python3.7/site-packages/jinja2/_compat.py", line 28, in reraise
raise value.with_traceback(tb)
File "/home/pi/thso.server/app/app/templates/views/public/device.html", line 250, in template
devmarker.bindPopup({% dev[0] %}).openPopup();
jinja2.exceptions.TemplateSyntaxError: Encountered unknown tag 'dev'. Jinja was looking for the following tags: 'elif' or 'else' or 'endif'. The innermost block that needs to be closed is 'if'.
[2020-07-04 04:25:37,770] INFO in views: superuser admin added new device ddmgeo for application 3b56f3d8
[2020-07-04 04:43:27,669] ERROR in app: Exception on /application/3b56f3d8/device/4/geo [GET]
Traceback (most recent call last):
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "./app/helpers/decorators.py", line 23, in restricted_function
return f(*args, **kwargs)
File "./app/helpers/decorators.py", line 35, in protected_function
return f(*args, **kwargs)
File "./app/views.py", line 492, in application_device_geo
d = ddm.read_data(ld[3], dev[3])
IndexError: list index out of range
[2020-07-04 04:43:46,583] ERROR in app: Exception on /application/3b56f3d8/device/4/geo [GET]
Traceback (most recent call last):
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "./app/helpers/decorators.py", line 23, in restricted_function
return f(*args, **kwargs)
File "./app/helpers/decorators.py", line 35, in protected_function
return f(*args, **kwargs)
File "./app/views.py", line 492, in application_device_geo
d = ddm.read_data(ld[3], dev[3])
IndexError: list index out of range
[2020-07-04 04:44:19,012] ERROR in app: Exception on /application/3b56f3d8/device/4/geo [GET]
Traceback (most recent call last):
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "./app/helpers/decorators.py", line 23, in restricted_function
return f(*args, **kwargs)
File "./app/helpers/decorators.py", line 35, in protected_function
return f(*args, **kwargs)
File "./app/views.py", line 492, in application_device_geo
d = ddm.read_data(ld[3], dev[3])
IndexError: list index out of range
[2020-07-04 04:45:07,692] ERROR in app: Exception on /application/3b56f3d8/device/4/geo [GET]
Traceback (most recent call last):
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "./app/helpers/decorators.py", line 23, in restricted_function
return f(*args, **kwargs)
File "./app/helpers/decorators.py", line 35, in protected_function
return f(*args, **kwargs)
File "./app/views.py", line 492, in application_device_geo
d = ddm.read_data(ld[3], dev[3])
IndexError: list index out of range
[2020-07-04 04:46:24,506] ERROR in app: Exception on /application/3b56f3d8/device/4/geo [GET]
Traceback (most recent call last):
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "./app/helpers/decorators.py", line 23, in restricted_function
return f(*args, **kwargs)
File "./app/helpers/decorators.py", line 35, in protected_function
return f(*args, **kwargs)
File "./app/views.py", line 492, in application_device_geo
d = ddm.read_data(ld[2], dev[3])
IndexError: list index out of range
[2020-07-04 04:47:03,097] ERROR in app: Exception on /application/3b56f3d8/device/4/geo [GET]
Traceback (most recent call last):
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "./app/helpers/decorators.py", line 23, in restricted_function
return f(*args, **kwargs)
File "./app/helpers/decorators.py", line 35, in protected_function
return f(*args, **kwargs)
File "./app/views.py", line 493, in application_device_geo
d = ddm.read_data(ld[2], dev[3])
IndexError: list index out of range
[2020-07-04 04:48:55,598] ERROR in app: Exception on /application/3b56f3d8/device/4/geo [GET]
Traceback (most recent call last):
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "./app/helpers/decorators.py", line 23, in restricted_function
return f(*args, **kwargs)
File "./app/helpers/decorators.py", line 35, in protected_function
return f(*args, **kwargs)
File "./app/views.py", line 492, in application_device_geo
d = ddm.read_data(ld[2].tobytes(), dev[3])
IndexError: list index out of range
[2020-07-04 04:50:39,893] ERROR in app: Exception on /application/3b56f3d8/device/4/geo [GET]
Traceback (most recent call last):
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "./app/helpers/decorators.py", line 23, in restricted_function
return f(*args, **kwargs)
File "./app/helpers/decorators.py", line 35, in protected_function
return f(*args, **kwargs)
File "./app/views.py", line 493, in application_device_geo
d = ddm.read_data(ld[2].tobytes(), dev[3])
IndexError: list index out of range
[2020-07-04 04:51:16,907] ERROR in app: Exception on /application/3b56f3d8/device/4/geo [GET]
Traceback (most recent call last):
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1953, in full_dispatch_request
return self.finalize_request(rv)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1968, in finalize_request
response = self.make_response(rv)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 2131, in make_response
" {rv.__class__.__name__}.".format(rv=rv)
TypeError: The view function did not return a valid response. The return type must be a string, dict, tuple, Response instance, or WSGI callable, but it was a list.
[2020-07-04 14:03:59,011] ERROR in app: Exception on /administration/admin/recent-activity [GET]
Traceback (most recent call last):
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "./app/helpers/decorators.py", line 23, in restricted_function
return f(*args, **kwargs)
File "./app/views_admin.py", line 530, in administration_user_recent_activity
ra += '<tr><th scope="row">'+r[1]+'</th><th>'+r[2]+'</th><th>'+r[0]+'</th><th>'+str(ddm.read_data(r[3], dev[3]))+'</th></tr>'
File "./app/helpers/device_data_model.py", line 147, in read_data
return json.loads(data.decode('utf-8'))
AttributeError: 'memoryview' object has no attribute 'decode'
[2020-07-04 14:04:20,424] ERROR in app: Exception on /recent-activity [GET]
Traceback (most recent call last):
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "./app/helpers/decorators.py", line 23, in restricted_function
return f(*args, **kwargs)
File "./app/views.py", line 363, in recent_activity
ra += '<tr><th scope="row">'+r[1]+'</th><th>'+r[2]+'</th><th>'+r[0]+'</th><th>'+str(ddm.read_data(r[3], dev[3]))+'</th></tr>'
File "./app/helpers/device_data_model.py", line 147, in read_data
return json.loads(data.decode('utf-8'))
AttributeError: 'memoryview' object has no attribute 'decode'
[2020-07-04 14:05:01,799] ERROR in app: Exception on /administration/admin/recent-activity [GET]
Traceback (most recent call last):
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "./app/helpers/decorators.py", line 23, in restricted_function
return f(*args, **kwargs)
File "./app/views_admin.py", line 530, in administration_user_recent_activity
ra += '<tr><th scope="row">'+r[1]+'</th><th>'+r[2]+'</th><th>'+r[0]+'</th><th>'+str(ddm.read_data(r[3], dev[3]))+'</th></tr>'
File "./app/helpers/device_data_model.py", line 147, in read_data
return json.loads(data.decode('utf-8'))
AttributeError: 'memoryview' object has no attribute 'decode'
[2020-07-04 14:06:11,555] ERROR in app: Exception on /recent-activity [GET]
Traceback (most recent call last):
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "./app/helpers/decorators.py", line 23, in restricted_function
return f(*args, **kwargs)
File "./app/views.py", line 363, in recent_activity
ra += '<tr><th scope="row">'+r[1]+'</th><th>'+r[2]+'</th><th>'+r[0]+'</th><th>'+str(ddm.read_data(r[3], dev[3]))+'</th></tr>'
File "./app/helpers/device_data_model.py", line 147, in read_data
return json.loads(data.decode('utf-8'))
AttributeError: 'memoryview' object has no attribute 'decode'
[2020-07-04 14:06:28,348] ERROR in app: Exception on /recent-activity [GET]
Traceback (most recent call last):
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "./app/helpers/decorators.py", line 23, in restricted_function
return f(*args, **kwargs)
File "./app/views.py", line 363, in recent_activity
ra += '<tr><th scope="row">'+r[1]+'</th><th>'+r[2]+'</th><th>'+r[0]+'</th><th>'+str(ddm.read_data(r[3], dev[3]))+'</th></tr>'
File "./app/helpers/device_data_model.py", line 147, in read_data
return json.loads(data.decode('utf-8'))
AttributeError: 'memoryview' object has no attribute 'decode'
[2020-07-04 14:08:40,976] ERROR in app: Exception on /recent-activity [GET]
Traceback (most recent call last):
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/thso.server/env/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "./app/helpers/decorators.py", line 23, in restricted_function
return f(*args, **kwargs)
File "./app/views.py", line 364, in recent_activity
ra += '<tr><th scope="row">'+r[1]+'</th><th>'+r[2]+'</th><th>'+r[0]+'</th><th>'+str(ddm.read_data(r[3], dev[3]))+'</th></tr>'
File "./app/helpers/device_data_model.py", line 147, in read_data
return json.loads(data.decode('utf-8'))
AttributeError: 'memoryview' object has no attribute 'decode'
[2020-09-13 17:53:00,310] INFO in views: Logged in superuser admin
[2020-09-13 17:55:00,520] INFO in views: superuser admin created new application THSO 49f4d289
[2020-09-13 17:58:38,291] INFO in views: superuser admin added new device ESP32 for application 49f4d289
......@@ -159,12 +159,12 @@ def get_recent_activity(cur, username, n=5):
for d in devs[1]:
query += """
(SELECT timedate, appname, devname, data, utc, appkey, devid from
(SELECT utc, timedate, data from dev_{}_{} ORDER BY utc DESC limit 5) AS utc,
(SELECT '{}' as appname) AS appname,
(SELECT '{}' as appkey) AS appkey,
(SELECT '{}' as devid) AS devid,
(SELECT '{}' as devname) AS devname)
UNION ALL""".format(a[1],d[1], a[0],a[1], d[1],d[0])
(SELECT utc, timedate, data from dev_{}_{} ORDER BY utc DESC limit {}) AS utc,
(SELECT text '{}' as appname) AS appname,
(SELECT text '{}' as appkey) AS appkey,
(SELECT text '{}' as devid) AS devid,
(SELECT text '{}' as devname) AS devname)
UNION ALL""".format(a[1],d[1], n, a[0],a[1], d[1],d[0])
query = query[0:-9]
query += ' ORDER BY utc DESC LIMIT {}'.format(n)
......
CREATE TABLE public.notifications (
id VARCHAR(10) NOT NULL,
app_key VARCHAR(30) NOT NULL,
dev_id NUMERIC(3) NOT NULL,
name VARCHAR(50) NOT NULL,
description VARCHAR(300),
action_type VARCHAR(20) NOT NULL,
action VARCHAR (200) NOT NULL
);
CREATE TABLE public.notifications_queue (
nf_id VARCHAR(10) NOT NULL,
app_key VARCHAR(30) NOT NULL,
dev_id NUMERIC(3) NOT NULL,
fired_on TIMESTAMP(6) NOT NULL
);
ALTER TABLE ONLY public.notifications
ADD CONSTRAINT notifications_pkey PRIMARY KEY (id, app_key, dev_id);
ALTER TABLE ONLY public.notifications
ADD CONSTRAINT notifications_app_key_fkey FOREIGN KEY (app_key) REFERENCES public.applications(app_key);
ALTER TABLE ONLY public.notifications_queue
ADD CONSTRAINT notifications_queue_pkey PRIMARY KEY (nf_id, app_key, dev_id);
ALTER TABLE ONLY public.notifications_queue
ADD CONSTRAINT notifications_queue_app_key_fkey FOREIGN KEY (app_key, nf_id, dev_id) REFERENCES public.notifications(app_key, id, dev_id);
CREATE OR REPLACE FUNCTION nf_4e662f03_1_aaaaa()
RETURNS trigger AS
$BODY$
BEGIN
IF (NEW.data->>'temperature')::int > 70 THEN
INSERT INTO notifications_queue VALUES('aaaaa', '4e662f03', 1);
END IF;
RETURN NEW;
END;
$BODY$
LANGUAGE plpgsql VOLATILE
COST 100;
CREATE TRIGGER tr_4e662f03_1_aaaaa
AFTER INSERT
on dev_4e662f03_1
FOR EACH ROW
EXECUTE PROCEDURE nf_4e662f03_1_aaaaa();
......@@ -75,7 +75,8 @@ CREATE TABLE public.users (
-- last_name character varying(50),
name character varying(30) NOT NULL,
password character varying(100) NOT NULL,
role character varying(10) NOT NULL
role character varying(10) NOT NULL,
telegram_chat_id character varying(12)
);
......
......@@ -23,7 +23,7 @@ os.environ["VIRTUAL_ENV"] = base # virtual env is right above bin directory
# add the virtual environments libraries to the host python import mechanism
prev_length = len(sys.path)
for lib in "../lib/python3.5/site-packages".split(os.pathsep):
for lib in "../lib/python3.7/site-packages".split(os.pathsep):
path = os.path.realpath(os.path.join(bin_dir, lib))
site.addsitedir(path.decode("utf-8") if "" else path)
sys.path[:] = sys.path[prev_length:] + sys.path[0:prev_length]
......
No preview for this file type
home = /usr
implementation = CPython
version_info = 3.5.3.final.0
virtualenv = 20.0.18
version_info = 3.7.3.final.0
virtualenv = 20.0.20
include-system-site-packages = false
base-prefix = /usr
base-exec-prefix = /usr
......
......@@ -5,6 +5,8 @@ source env/bin/activate
sudo apt-get install -y postgresql postgresql-contrib
sudo apt-get install -y libpq-dev
sudo apt-get install -y libssl-dev
pip install -r app/requirements.txt
sudo -u postgres psql -c "CREATE USER ${USER} WITH PASSWORD 'dev';"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment