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

unifi_respondd failed spontaneously #36

Open
herbetom opened this issue Feb 23, 2022 · 2 comments · May be fixed by #43
Open

unifi_respondd failed spontaneously #36

herbetom opened this issue Feb 23, 2022 · 2 comments · May be fixed by #43

Comments

@herbetom
Copy link
Contributor

I just encountered the following error with unifi_respondd. I haven't done any research. I only want to post this somewhere.

Feb 23 02:59:05 unifi python[1022]: 2022-02-23 02:59:05,854,854 INFO     [respondd_client.py:328] Using unicast method
Feb 23 02:59:05 unifi python[1022]: 2022-02-23 02:59:05,854,854 DEBUG    [respondd_client.py:332] will now sleep 48 seconds
Feb 23 02:59:53 unifi python[1022]: 2022-02-23 02:59:53,934,934 DEBUG    [controller.py:112] Controller for https://unifi.ffrn.de:443/
Feb 23 02:59:53 unifi python[1022]: 2022-02-23 02:59:53,934,934 DEBUG    [controller.py:181] login() as unifi_respondd
Feb 23 03:00:00 unifi python[1022]: Traceback (most recent call last):
Feb 23 03:00:00 unifi python[1022]:   File "/opt/unifi_respondd/venv/lib/python3.9/site-packages/pyunifi/controller.py", line 31, in wrapper
Feb 23 03:00:00 unifi python[1022]:     return func(*args, **kwargs)
Feb 23 03:00:00 unifi python[1022]:   File "/opt/unifi_respondd/venv/lib/python3.9/site-packages/pyunifi/controller.py", line 139, in _read
Feb 23 03:00:00 unifi python[1022]:     return self._jsondec(response.text)
Feb 23 03:00:00 unifi python[1022]:   File "/opt/unifi_respondd/venv/lib/python3.9/site-packages/pyunifi/controller.py", line 117, in _jsondec
Feb 23 03:00:00 unifi python[1022]:     obj = json.loads(data)
Feb 23 03:00:00 unifi python[1022]:   File "/usr/lib/python3.9/json/__init__.py", line 346, in loads
Feb 23 03:00:00 unifi python[1022]:     return _default_decoder.decode(s)
Feb 23 03:00:00 unifi python[1022]:   File "/usr/lib/python3.9/json/decoder.py", line 337, in decode
Feb 23 03:00:00 unifi python[1022]:     obj, end = self.raw_decode(s, idx=_w(s, 0).end())
Feb 23 03:00:00 unifi python[1022]:   File "/usr/lib/python3.9/json/decoder.py", line 355, in raw_decode
Feb 23 03:00:00 unifi python[1022]:     raise JSONDecodeError("Expecting value", s, err.value) from None
Feb 23 03:00:00 unifi python[1022]: json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Feb 23 03:00:00 unifi python[1022]: During handling of the above exception, another exception occurred:
Feb 23 03:00:00 unifi python[1022]: Traceback (most recent call last):
Feb 23 03:00:00 unifi python[1022]:   File "/opt/unifi_respondd/respondd.py", line 14, in <module>
Feb 23 03:00:00 unifi python[1022]:     main()
Feb 23 03:00:00 unifi python[1022]:   File "/opt/unifi_respondd/respondd.py", line 10, in main
Feb 23 03:00:00 unifi python[1022]:     extResponddClient.start()
Feb 23 03:00:00 unifi python[1022]:   File "/opt/unifi_respondd/unifi_respondd/respondd_client.py", line 359, in start
Feb 23 03:00:00 unifi python[1022]:     self._aps = unifi_client.get_infos()
Feb 23 03:00:00 unifi python[1022]:   File "/opt/unifi_respondd/unifi_respondd/unifi_client.py", line 140, in get_infos
Feb 23 03:00:00 unifi python[1022]:     c.switch_site(site["desc"])
Feb 23 03:00:00 unifi python[1022]:   File "/opt/unifi_respondd/venv/lib/python3.9/site-packages/pyunifi/controller.py", line 218, in switch_site
Feb 23 03:00:00 unifi python[1022]:     for site in self.get_sites():
Feb 23 03:00:00 unifi python[1022]:   File "/opt/unifi_respondd/venv/lib/python3.9/site-packages/pyunifi/controller.py", line 293, in get_sites
Feb 23 03:00:00 unifi python[1022]:     return self._read(self.url + "api/self/sites")
Feb 23 03:00:00 unifi python[1022]:   File "/opt/unifi_respondd/venv/lib/python3.9/site-packages/pyunifi/controller.py", line 38, in wrapper
Feb 23 03:00:00 unifi python[1022]:     raise APIError(err)
Feb 23 03:00:00 unifi python[1022]: pyunifi.controller.APIError: Expecting value: line 1 column 1 (char 0)
Feb 23 03:00:00 unifi systemd[1]: unifi_respondd.service: Main process exited, code=exited, status=1/FAILURE
Feb 23 03:00:00 unifi systemd[1]: unifi_respondd.service: Failed with result 'exit-code'.
Feb 23 03:00:00 unifi systemd[1]: unifi_respondd.service: Consumed 39min 50.074s CPU time.
@GoliathLabs
Copy link
Member

The same thing happened to us just yesterday. It seems that sometimes the API returns garbage or errors. This should be dealt with in the code so that it doesn't crash like every time Ubiquiti tampers with the API.

@GoliathLabs
Copy link
Member

This also happens sometimes when the system is restarted. @peterbaumert do you have any idea how to handle these API errors?

T0biii added a commit to T0biii/unifi_respondd that referenced this issue May 20, 2024
@T0biii T0biii linked a pull request May 20, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants