Where are zones stored? Invalid characters discovered.

General Discussion

Where are zones stored? Invalid characters discovered.

Postby Maxburn » Sat Nov 11, 2017 11:41 am

Where are the zones stored on disk? I was setting up a new Pi3 and hit the discover button for the zones, I saw my zones but zone 10 had a 1 and what looked like a box, tried to edit it and got this error. Now the page just shows this when I go there, so it knows it's invalid and won't show it. What file do I edit to fix this?

Code: Select all
ValueError
ValueError: invalid literal for int() with base 10: '1\x03'

Traceback (most recent call last)
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1836, in __call__
return self.wsgi_app(environ, start_response)
File "/opt/alarmdecoder-webapp/ad2web/app.py", line 128, in __call__
return self.app(environ, start_response)
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1820, in wsgi_app
response = self.make_response(self.handle_exception(e))
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1403, in handle_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1817, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1477, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1381, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1475, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1461, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/usr/local/lib/python2.7/dist-packages/flask_login.py", line 792, in decorated_view
return func(*args, **kwargs)
File "/opt/alarmdecoder-webapp/ad2web/decorators.py", line 16, in decorated_function
return f(*args, **kwargs)
File "/opt/alarmdecoder-webapp/ad2web/zones/views.py", line 28, in index
return render_template('zones/index.html', zones=zones, active="zones", ssl=use_ssl, panel_mode=panel_mode)
File "/usr/local/lib/python2.7/dist-packages/flask/templating.py", line 128, in render_template
context, ctx.app)
File "/usr/local/lib/python2.7/dist-packages/flask/templating.py", line 110, in _render
rv = template.render(context)
File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 989, in render
return self.environment.handle_exception(exc_info, True)
File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 754, in handle_exception
reraise(exc_type, exc_value, tb)
File "/opt/alarmdecoder-webapp/ad2web/templates/zones/index.html", line 3, in top-level template code
{% extends 'settings/layout.html' %}
File "/opt/alarmdecoder-webapp/ad2web/templates/settings/layout.html", line 19, in top-level template code
{% set tabs = [
File "/opt/alarmdecoder-webapp/ad2web/templates/layouts/base.html", line 104, in top-level template code
{% block container %}
File "/opt/alarmdecoder-webapp/ad2web/templates/layouts/base.html", line 125, in block "container"
{% block body %}
File "/opt/alarmdecoder-webapp/ad2web/templates/zones/index.html", line 30, in block "body"
<td><a href="{{ url_for('zones.edit', id=zone.zone_id) }}">{{ zone.zone_id }}</a></td>
File "/usr/local/lib/python2.7/dist-packages/flask/helpers.py", line 305, in url_for
force_external=external)
File "/usr/local/lib/python2.7/dist-packages/werkzeug/routing.py", line 1756, in build
rv = self._partial_build(endpoint, values, method, append_unknown)
File "/usr/local/lib/python2.7/dist-packages/werkzeug/routing.py", line 1671, in _partial_build
append_unknown)
File "/usr/local/lib/python2.7/dist-packages/werkzeug/routing.py", line 1679, in _partial_build
rv = rule.build(values, append_unknown)
File "/usr/local/lib/python2.7/dist-packages/werkzeug/routing.py", line 798, in build
add(self._converters[data].to_url(values[data]))
File "/usr/local/lib/python2.7/dist-packages/werkzeug/routing.py", line 1016, in to_url
value = self.num_convert(value)
ValueError: invalid literal for int() with base 10: '1\x03'
The debugger caught an exception in your WSGI application. You can now look at the traceback which led to the error.
To switch between the interactive traceback and the plaintext one, you can click on the "Traceback" headline. From the text traceback you can also create a paste of it.

Brought to you by DON'T PANIC, your friendly Werkzeug powered traceback interpreter.
Maxburn
Senior Nut
Senior Nut
 
Posts: 55
Joined: Sat Feb 28, 2015 4:57 pm

Re: Where are zones stored? Invalid characters discovered.

Postby kevin » Sat Nov 11, 2017 11:45 am

You can modify the zones tabler in the /opt/alarmdecoder-webapp/instance/db.sqlite file

Shut off the webapp (sudo /etc/init.d/gunicorn stop)

copy above db.sqlite file to your local computer, and modify the zones table with http://sqlitebrowser.org/

Re-upload the db.sqlite file to the proper place

restart gunicorn (sudo /etc/init.d/gunicorn start)
Not an employee of the company. Just here to help and keep things clean.
kevin
Platinum Nut
Platinum Nut
 
Posts: 994
Joined: Fri Aug 16, 2013 10:10 am

Re: Where are zones stored? Invalid characters discovered.

Postby Maxburn » Sat Nov 11, 2017 11:49 am

Sorry, I posted a duplicate, the board gave me errors after submitting I didn't realize it went through.
Maxburn
Senior Nut
Senior Nut
 
Posts: 55
Joined: Sat Feb 28, 2015 4:57 pm

Re: Where are zones stored? Invalid characters discovered.

Postby Maxburn » Sat Nov 11, 2017 12:09 pm

Never mind, found it under systemctl.

sudo: /etc/init.d/gunicorn: command not found
I don't have gunicorn in that directory.

Are you writing the PID somewhere so I can kill that?
Last edited by Maxburn on Sat Nov 11, 2017 12:12 pm, edited 1 time in total.
Maxburn
Senior Nut
Senior Nut
 
Posts: 55
Joined: Sat Feb 28, 2015 4:57 pm

Re: Where are zones stored? Invalid characters discovered.

Postby kevin » Sat Nov 11, 2017 12:12 pm

Oh, you can also try "sudo service gunicorn stop" or you can find the PID in the "ps aux" output and kill -9 it
Not an employee of the company. Just here to help and keep things clean.
kevin
Platinum Nut
Platinum Nut
 
Posts: 994
Joined: Fri Aug 16, 2013 10:10 am

Re: Where are zones stored? Invalid characters discovered.

Postby Maxburn » Mon Nov 13, 2017 3:58 am

Fixed it, wasn't that bad. What I saw in the editor looked like a 1 followed by a heart symbol instead of a zero. Also it was missing a zone. Maybe time to sanitize some db inputs on discovery? An error and retry option would have been nice here. Or perhaps allow the web page to display invalid values but not allow them to be entered, seems like that does check from what I got out of that error message.

Still from what I saw a year or two ago when I first got it, this is much better. Thanks.
Maxburn
Senior Nut
Senior Nut
 
Posts: 55
Joined: Sat Feb 28, 2015 4:57 pm


Return to General

Who is online

Users browsing this forum: No registered users and 42 guests

cron