Skip to content

Gunicorn errors related to sensor polling #84

@jplee3

Description

@jplee3

Noticing the following exception whenever I poll sensor events from my AD2USB (2.0) flooding /var/log/daemon.log:

Apr 29 14:50:19 alarmdecoder gunicorn[384]: Exception in thread Thread-472:
Apr 29 14:50:19 alarmdecoder gunicorn[384]: Traceback (most recent call last):
Apr 29 14:50:19 alarmdecoder gunicorn[384]:   File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
Apr 29 14:50:19 alarmdecoder gunicorn[384]:     self.run()
Apr 29 14:50:19 alarmdecoder gunicorn[384]:   File "/opt/alarmdecoder/alarmdecoder/devices/base_device.py", line 148, in run
Apr 29 14:50:19 alarmdecoder gunicorn[384]:     self._device.read_line(timeout=self.READ_TIMEOUT)
Apr 29 14:50:19 alarmdecoder gunicorn[384]:   File "/opt/alarmdecoder/alarmdecoder/devices/socket_device.py", line 356, in read_line
Apr 29 14:50:19 alarmdecoder gunicorn[384]:     self.on_read(data=ret)
Apr 29 14:50:19 alarmdecoder gunicorn[384]:   File "/opt/alarmdecoder/alarmdecoder/event/event.py", line 84, in fire
Apr 29 14:50:19 alarmdecoder gunicorn[384]:     func(self.obj, *args, **kwargs)
Apr 29 14:50:19 alarmdecoder gunicorn[384]:   File "/opt/alarmdecoder/alarmdecoder/decoder.py", line 1041, in _on_read
Apr 29 14:50:19 alarmdecoder gunicorn[384]:     self._handle_message(data)
Apr 29 14:50:19 alarmdecoder gunicorn[384]:   File "/opt/alarmdecoder/alarmdecoder/decoder.py", line 439, in _handle_message
Apr 29 14:50:19 alarmdecoder gunicorn[384]:     msg = self._handle_keypad_message(data)
Apr 29 14:50:19 alarmdecoder gunicorn[384]:   File "/opt/alarmdecoder/alarmdecoder/decoder.py", line 477, in _handle_keypad_message
Apr 29 14:50:19 alarmdecoder gunicorn[384]:     msg = Message(data)
Apr 29 14:50:19 alarmdecoder gunicorn[384]:   File "/opt/alarmdecoder/alarmdecoder/messages/panel_message.py", line 85, in __init__
Apr 29 14:50:19 alarmdecoder gunicorn[384]:     self._parse_message(data)
Apr 29 14:50:19 alarmdecoder gunicorn[384]:   File "/opt/alarmdecoder/alarmdecoder/messages/panel_message.py", line 121, in _parse_message
Apr 29 14:50:19 alarmdecoder gunicorn[384]:     self.system_fault = int(self.bitfield[17], 16)
Apr 29 14:50:19 alarmdecoder gunicorn[384]: ValueError: invalid literal for int() with base 16: '-'

In conjunction with this but really any event that produces noise on the AD2USB device.

!VER:00000436,V2.1f.10,TX;RX;SM;VZ;RF;ZX;PE;RE;AU
[000100010000--------],001,[f70000071001000008020000000000],"FAULT 01 FRONT  DOOR          

Also, not sure if this is a related issue I notice this randomly pop-up time to time after clicking around in the webapp within the same context of the aforementioned observations

Apr 29 14:44:53 alarmdecoder gunicorn[384]: 127.0.0.1 - - [2020-04-29 14:44:53] "GET /static/img/spinner.gif HTTP/1.1" 200 1094 0.149828
Apr 29 14:44:53 alarmdecoder gunicorn[384]: 127.0.0.1 - - [2020-04-29 14:44:53] "GET /static/img/spinner.gif HTTP/1.1" 200 1094 0.140137
Apr 29 14:44:54 alarmdecoder gunicorn[384]: Exception in thread Thread-404:
Apr 29 14:44:54 alarmdecoder gunicorn[384]: Traceback (most recent call last):
Apr 29 14:44:54 alarmdecoder gunicorn[384]:   File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
Apr 29 14:44:54 alarmdecoder gunicorn[384]:     self.run()
Apr 29 14:44:54 alarmdecoder gunicorn[384]:   File "/opt/alarmdecoder/alarmdecoder/devices/base_device.py", line 148, in run
Apr 29 14:44:54 alarmdecoder gunicorn[384]:     self._device.read_line(timeout=self.READ_TIMEOUT)
Apr 29 14:44:54 alarmdecoder gunicorn[384]:   File "/opt/alarmdecoder/alarmdecoder/devices/socket_device.py", line 323, in read_line
Apr 29 14:44:54 alarmdecoder gunicorn[384]:     read_ready, _, _ = select.select([self._device], [], [], 0.5)
Apr 29 14:44:54 alarmdecoder gunicorn[384]:   File "/usr/local/lib/python2.7/dist-packages/gevent/select.py", line 77, in select
Apr 29 14:44:54 alarmdecoder gunicorn[384]:     raise error(*ex.args)
Apr 29 14:44:54 alarmdecoder gunicorn[384]: error: (9, 'Bad file descriptor')[/code]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions