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

Timezone offset issue? #127

Open
cyberpower678 opened this issue Jan 25, 2024 · 5 comments
Open

Timezone offset issue? #127

cyberpower678 opened this issue Jan 25, 2024 · 5 comments

Comments

@cyberpower678
Copy link
Contributor

  • Unifi Protect Backup version: Latest image
  • Unifi Protect version: Latest EA
  • Python version: Whatever is on the docker
  • Operating System: TrueNAS/Docker
  • Are you using a docker container or native?: docker

Description

There seems to be some kind of hiccup when handling time zones when downloading events. When I perform a clean install, it will fetch every event correctly, but at some point, when it fetches new events, it's retrieving footage from exactly 7 hours prior. It seems to be pulling the UTC time instead of the local time of the footage.

What I Did

Deleted the events database and downloaded footage again.

@mmolitor87
Copy link
Contributor

Add a timezone environment variable: - TZ=America/Chicago

@cyberpower678
Copy link
Contributor Author

Well I added the correct time zone to my environments, but it seems to be crashing on start. It would seem it's not handling pyunifiprotect correctly.

@cyberpower678
Copy link
Contributor Author

2024-04-27 01:29:45 [ WARNING ] unifi_protect_backup.unifi_protect_backup_core : Failed to connect to UniFi Protect, retrying in 9s...
Traceback (most recent call last):
File "/usr/lib/python3.11/site-packages/unifi_protect_backup/unifi_protect_backup_core.py", line 190, in start
await self._protect.update()
File "/usr/lib/python3.11/site-packages/pyunifiprotect/api.py", line 673, in update
self._bootstrap = await self.get_bootstrap()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/pyunifiprotect/api.py", line 1009, in get_bootstrap
return Bootstrap.from_unifi_dict(**data, api=self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/pyunifiprotect/data/base.py", line 120, in from_unifi_dict
data = cls.unifi_dict_to_dict(data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/pyunifiprotect/data/bootstrap.py", line 224, in unifi_dict_to_dict
return super().unifi_dict_to_dict(data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/pyunifiprotect/data/base.py", line 369, in unifi_dict_to_dict
data[key] = cls._clean_protect_obj_dict(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/pyunifiprotect/data/base.py", line 311, in _clean_protect_obj_dict
items[key] = cls._clean_protect_obj(value, klass, api)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/pyunifiprotect/data/base.py", line 289, in _clean_protect_obj
return klass.unifi_dict_to_dict(data=data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/pyunifiprotect/data/user.py", line 170, in unifi_dict_to_dict
return super().unifi_dict_to_dict(data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/pyunifiprotect/data/base.py", line 360, in unifi_dict_to_dict
data[key] = cls._clean_protect_obj_list(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/pyunifiprotect/data/base.py", line 300, in _clean_protect_obj_list
items[index] = cls._clean_protect_obj(item, klass, api)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/pyunifiprotect/data/base.py", line 289, in _clean_protect_obj
return klass.unifi_dict_to_dict(data=data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/pyunifiprotect/data/user.py", line 34, in unifi_dict_to_dict
data["nodes"] = [PermissionNode(n) for n in parts[1].split(",")]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/pyunifiprotect/data/user.py", line 34, in
data["nodes"] = [PermissionNode(n) for n in parts[1].split(",")]
^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/enum.py", line 712, in call
return cls.new(cls, value)
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/enum.py", line 1135, in new
raise ve_exc
ValueError: 'readlive' is not a valid PermissionNode

@cyberpower678
Copy link
Contributor Author

Nevermind, Docker image caching issue.

@ep1cman
Copy link
Owner

ep1cman commented Apr 28, 2024

is this resolved now?

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

No branches or pull requests

3 participants