Error on Zone setting page

General Discussion

Error on Zone setting page

Postby omriasta » Sun Nov 05, 2017 10:00 am

When going to the zones page in settings, (https://alarmdecoder/settings/zones/) I am getting the error below.
Alarmdecoder is installed using the preconfigured pi image. The keypad is able to interact with the panel. The error starts as soon as I scan the panel for zones. Once I do that, it completes successfully and lists all the zones but next time I try to go to the settings zone page it gives the below error. The rest of the webapp is still working fine.
What could be causing this? Also, is there any way to reset the webapp so I don't have to reimage the pi?
THANK YOU IN ADVANCE!!!
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'
omriasta
newt
newt
 
Posts: 4
Joined: Sun Nov 05, 2017 9:55 am

Re: Error on Zone setting page

Postby kevin » Sun Nov 05, 2017 10:20 am

It must be picking up some unrecognized character in the stream - maybe you should configure your zones manually

You can reset the database by sshing into the pi and doing these commands:

cd /opt/alarmdecoder-webapp
sudo rm instance/db.sqlite
python manage.py initdb
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: Error on Zone setting page

Postby omriasta » Sun Nov 05, 2017 10:51 am

So, first of all I found the sqlite.db that needs to be deleted to reset the db and was able to get back to the zones page.
I also noticed that when retrieving the zones from the panel there were 2 zones with abnormal characters in their zone id. I updated their zone_id in the sqllite db and was able to get into the zones page again. Not sure if anyone can fix the webapp to detect these characters and warn/change them so it doesn't cause the crash? Any idea why my panel would have these odd characters?
omriasta
newt
newt
 
Posts: 4
Joined: Sun Nov 05, 2017 9:55 am

Re: Error on Zone setting page

Postby kevin » Sun Nov 05, 2017 10:54 am

Sorry, the AUI protocol scanning isn't perfect so there might be an issue here and there - I could only test on the panels I had available, so there may be some things unexpected - but yes it is possible to adjust the code to filter out those characters - editing the database is a good solution to your problem currently :)
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: Error on Zone setting page

Postby yhax » Sat Jan 13, 2018 8:37 pm

Took a stab at fixing this and just created a pull request in github.
Looks like the issue has to do with the way the zone aui message is parsed. It was not accounting for double digits with 0 in them i.e zone 10, 20, 30 etc. Hopefully my change makes it in, and helps out.
yhax
newt
newt
 
Posts: 7
Joined: Sat Jan 06, 2018 11:58 am


Return to General

Who is online

Users browsing this forum: No registered users and 5 guests

cron