Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Snapshots to Axis camera fail after HA upgrade #122890

Closed
CygnusX2112 opened this issue Jul 31, 2024 · 13 comments
Closed

Snapshots to Axis camera fail after HA upgrade #122890

CygnusX2112 opened this issue Jul 31, 2024 · 13 comments
Assignees

Comments

@CygnusX2112
Copy link

CygnusX2112 commented Jul 31, 2024

The problem

I recently upgraded from v2024.6.4 to v2024.7.4 and it appears that snapshot functionality is no longer working to one of my Axis cameras.

What version of Home Assistant Core has the issue?

2024.7.4

What was the last working version of Home Assistant Core?

2024.6.4

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Axis

Link to integration documentation on our website

https://www.home-assistant.io/integrations/axis/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2024-07-30 23:43:43.335 ERROR (MainThread) [homeassistant] Error doing job: Exception in callback _SelectorDatagramTransport._read_ready() (None)
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/local/lib/python3.12/asyncio/selector_events.py", line 1238, in _read_ready
    self._protocol.datagram_received(data, addr)
  File "/usr/local/lib/python3.12/site-packages/axis/rtsp.py", line 211, in datagram_received
    self.callback(Signal.DATA)
  File "/usr/local/lib/python3.12/site-packages/axis/stream_manager.py", line 73, in session_callback
    self.device.event.handler(self.data)
  File "/usr/local/lib/python3.12/site-packages/axis/interfaces/event_manager.py", line 36, in handler
    event = Event.decode(data)
            ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/axis/models/event.py", line 154, in decode
    return cls._decode_from_bytes(data)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/axis/models/event.py", line 189, in _decode_from_bytes
    raw = xmltodict.parse(
          ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/xmltodict.py", line 378, in parse
    parser.Parse(xml_input, True)
xml.parsers.expat.ExpatError: unclosed token: line 3, column 626
2024-07-30 23:43:43.341 ERROR (MainThread) [homeassistant] Error doing job: Exception in callback _SelectorDatagramTransport._read_ready() (None)
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/local/lib/python3.12/asyncio/selector_events.py", line 1238, in _read_ready
    self._protocol.datagram_received(data, addr)
  File "/usr/local/lib/python3.12/site-packages/axis/rtsp.py", line 211, in datagram_received
    self.callback(Signal.DATA)
  File "/usr/local/lib/python3.12/site-packages/axis/stream_manager.py", line 73, in session_callback
    self.device.event.handler(self.data)
  File "/usr/local/lib/python3.12/site-packages/axis/interfaces/event_manager.py", line 36, in handler
    event = Event.decode(data)
            ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/axis/models/event.py", line 154, in decode
    return cls._decode_from_bytes(data)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/axis/models/event.py", line 189, in _decode_from_bytes
    raw = xmltodict.parse(
          ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/xmltodict.py", line 378, in parse
    parser.Parse(xml_input, True)
xml.parsers.expat.ExpatError: not well-formed (invalid token): line 1, column 0
2024-07-30 23:43:43.435 ERROR (MainThread) [homeassistant] Error doing job: Exception in callback _SelectorDatagramTransport._read_ready() (None)
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/local/lib/python3.12/asyncio/selector_events.py", line 1238, in _read_ready
    self._protocol.datagram_received(data, addr)
  File "/usr/local/lib/python3.12/site-packages/axis/rtsp.py", line 211, in datagram_received
    self.callback(Signal.DATA)
  File "/usr/local/lib/python3.12/site-packages/axis/stream_manager.py", line 73, in session_callback
    self.device.event.handler(self.data)
  File "/usr/local/lib/python3.12/site-packages/axis/interfaces/event_manager.py", line 36, in handler
    event = Event.decode(data)
            ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/axis/models/event.py", line 154, in decode
    return cls._decode_from_bytes(data)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/axis/models/event.py", line 189, in _decode_from_bytes
    raw = xmltodict.parse(
          ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/xmltodict.py", line 378, in parse
    parser.Parse(xml_input, True)
xml.parsers.expat.ExpatError: unclosed token: line 3, column 626
2024-07-30 23:43:43.440 ERROR (MainThread) [homeassistant] Error doing job: Exception in callback _SelectorDatagramTransport._read_ready() (None)
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/local/lib/python3.12/asyncio/selector_events.py", line 1238, in _read_ready
    self._protocol.datagram_received(data, addr)
  File "/usr/local/lib/python3.12/site-packages/axis/rtsp.py", line 211, in datagram_received
    self.callback(Signal.DATA)
  File "/usr/local/lib/python3.12/site-packages/axis/stream_manager.py", line 73, in session_callback
    self.device.event.handler(self.data)
  File "/usr/local/lib/python3.12/site-packages/axis/interfaces/event_manager.py", line 36, in handler
    event = Event.decode(data)
            ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/axis/models/event.py", line 154, in decode
    return cls._decode_from_bytes(data)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/axis/models/event.py", line 189, in _decode_from_bytes
    raw = xmltodict.parse(
          ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/xmltodict.py", line 378, in parse
    parser.Parse(xml_input, True)
xml.parsers.expat.ExpatError: not well-formed (invalid token): line 1, column 0

Additional information

Affected camera is on firmware 11.10.83. Upgrading to 11.11.73 breaks additional functionality and HA then also stops updating the status of VMD and Object Analytics profiles.

The JPG file is still created but appears to not contain any image data.

@home-assistant
Copy link

Hey there @Kane610, mind taking a look at this issue as it has been labeled with an integration (axis) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of axis can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign axis Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


axis documentation
axis source
(message by IssueLinks)

@Kane610
Copy link
Member

Kane610 commented Jul 31, 2024

Hello. There has been no changes to the integration at all. Are you sure if you where to downgrade ha that the issue would t be persistent?

Can you enable debug logging per instructions in the integration documentation and share those

@CygnusX2112
Copy link
Author

Thanks for the quick response.

I've not yet had the time to test a downgrade but will give that a try when I am able.
I'll gather debug logs at the same time.

@CygnusX2112
Copy link
Author

Before going to the trouble of downgrading HA I first downgraded the firmware on the camera. 11.10.83 appears to be the problem. Downgrade to 11.10.61 resolves the issue.

I'll pull debug logs for you in the next day or two.

@Kane610
Copy link
Member

Kane610 commented Jul 31, 2024

Which device is it?

@CygnusX2112
Copy link
Author

Device is an M2036-LE

@CygnusX2112
Copy link
Author

I've been able to consistently reproduce the issue by toggling the capture mode between 4:3 and 16:9. The snapshot works in 4:3 but not in 16:9. I tried setting a lower resolution in the stream profile but that did not seem to help. I'll work on those debug logs when I have some time to focus on it.

@Kane610
Copy link
Member

Kane610 commented Aug 1, 2024

There are other reports on that device #109029

@CygnusX2112
Copy link
Author

I'm now having trouble consistently reproducing this issue to gather debug logs.

My snapshot automatons have been working flawlessly for the last few days. Only two changes that were made. The first was to roll back the device firmware to 11.10.61 and even after this, switching capture mode to 4:3 was required to get the snapshot functionality to work. The camera was left in 16:9 over night and to my surprise, it started working again. I wont have a lot of time to experiment with this so unless you're intrigued by this and would like to keep it open, I'm leaning towards closing this and chalking it up to an issue with Axis firmware under certain conditions.

@Kane610
Copy link
Member

Kane610 commented Aug 2, 2024

Leta close it. But maybe you should report this se observations to axis for completeness sake

@Kane610 Kane610 closed this as completed Aug 2, 2024
@Kane610
Copy link
Member

Kane610 commented Aug 2, 2024

I will not have time to look it and if you have a working situation id rather focus elsewhere

@CygnusX2112
Copy link
Author

Roger, I won't consume any more of your time. Thank you for maintaining this integration.

@Kane610
Copy link
Member

Kane610 commented Aug 2, 2024

Roger, I won't consume any more of your time. Thank you for maintaining this integration.

Thanks for using it

@github-actions github-actions bot locked and limited conversation to collaborators Sep 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants