Ludy87 / xplora_watch

Xplora® Watch Home Assistant Integration
MIT License
47 stars 6 forks source link

Integration fails to start #328

Closed hauard closed 5 months ago

hauard commented 7 months ago

What version of Integration has the issue?

V2.10.4

System Health details

## System Information

version | core-2023.11.1
-- | --
installation_type | Home Assistant OS
dev | false
hassio | true
docker | true
user | root
virtualenv | false
python_version | 3.11.6
os_name | Linux
os_version | 6.1.21-v8
arch | aarch64
timezone | Europe/Oslo
config_dir | /config

<details><summary>Home Assistant Community Store</summary>

GitHub API | ok
-- | --
GitHub Content | ok
GitHub Web | ok
GitHub API Calls Remaining | 4993
Installed Version | 1.33.0
Stage | running
Available Repositories | 1330
Downloaded Repositories | 12

</details>

<details><summary>Home Assistant Cloud</summary>

logged_in | false
-- | --
can_reach_cert_server | ok
can_reach_cloud_auth | ok
can_reach_cloud | ok

</details>

<details><summary>Home Assistant Supervisor</summary>

host_os | Home Assistant OS 11.1
-- | --
update_channel | stable
supervisor_version | supervisor-2023.11.0
agent_version | 1.6.0
docker_version | 24.0.6
disk_total | 219.4 GB
disk_used | 26.3 GB
healthy | true
supported | true
board | rpi4-64
supervisor_api | ok
version_api | ok
installed_addons | File editor (5.6.0), Home Assistant Google Drive Backup (0.111.1), NGINX Home Assistant SSL proxy (3.5.0), Samba share (10.0.2), Node-RED (15.0.0), Advanced SSH & Web Terminal (15.1.0), Log Viewer (0.16.0), Mosquitto broker (6.3.1), Grafana (9.1.1), InfluxDB (4.8.0), AppDaemon (0.14.0), Glances (0.20.0), ESPHome (2023.10.6), Simple Scheduler (2.11), SQLite Web (3.10.0)

</details>

<details><summary>Dashboards</summary>

dashboards | 3
-- | --
resources | 4
views | 12
mode | storage

</details>

<details><summary>Recorder</summary>

oldest_recorder_run | 3. november 2023 kl. 16:13
-- | --
current_recorder_run | 9. november 2023 kl. 04:12
estimated_db_size | 454.93 MiB
database_engine | sqlite
database_version | 3.41.2

</details>

Checklist

Describe the issue

Integration fails to start, getting "Integration loaded-"popup, but afterwards it says "Failed config, retrying." image

Reproduction steps

  1. Trying to start integration
  2. Integration fails to start, retrying on its own

Debug logs

Denne feilen stammer fra en tilpasset integrasjon.

Logger: custom_components.xplora_watch.coordinator
Source: helpers/update_coordinator.py:290
Integration: Xplora® Watch (documentation, issues)
First occurred: 9. november 2023 kl. 04:13:47 (926 occurrences)
Last logged: 13:53:23

Unexpected error fetching xplora_watch- data: invalid literal for int() with base 10: ''
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 290, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 246, in _async_update_data
    return await self.update_method()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/xplora_watch/coordinator.py", line 168, in async_update_xplora_data
    watch_entry.update(await self.data_loop(wuids, message_limit, remove_message))
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/xplora_watch/coordinator.py", line 182, in data_loop
    res_chats = await self.controller.getWatchChatsRaw(wuid, limit=message_limit, show_del_msg=remove_message)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pyxplora_api/pyxplora_api_async.py", line 390, in getWatchChatsRaw
    result = ChatsNew.from_dict(result.get("chatsNew", None))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dataclasses_json/api.py", line 70, in from_dict
    return _decode_dataclass(cls, kvs, infer_missing)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dataclasses_json/core.py", line 219, in _decode_dataclass
    init_kwargs[field.name] = _decode_generic(field_type,
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dataclasses_json/core.py", line 310, in _decode_generic
    res = _decode_generic(type_arg, value, infer_missing)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dataclasses_json/core.py", line 290, in _decode_generic
    xs = _decode_items(_get_type_arg_param(type_, 0), value, infer_missing)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dataclasses_json/core.py", line 378, in _decode_items
    return list(_decode_item(type_args, x) for x in xs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dataclasses_json/core.py", line 378, in <genexpr>
    return list(_decode_item(type_args, x) for x in xs)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dataclasses_json/core.py", line 371, in _decode_item
    return _decode_dataclass(type_arg, x, infer_missing)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dataclasses_json/core.py", line 219, in _decode_dataclass
    init_kwargs[field.name] = _decode_generic(field_type,
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dataclasses_json/core.py", line 308, in _decode_generic
    res = _decode_dataclass(type_arg, value, infer_missing)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dataclasses_json/core.py", line 219, in _decode_dataclass
    init_kwargs[field.name] = _decode_generic(field_type,
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dataclasses_json/core.py", line 312, in _decode_generic
    res = _support_extended_types(type_arg, value)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dataclasses_json/core.py", line 250, in _support_extended_types
    else field_type(field_value))
         ^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
github-actions[bot] commented 7 months ago

:wave: @hauard, it is checked whether there is a bug. Please have some patience. This action was performed automatically.

github-actions[bot] commented 7 months ago

:wave: @hauard, we found the bug, it will be fixed shortly. This action was performed automatically.

Enkil666 commented 6 months ago

Has this issue been resolved yet?

hauard commented 6 months ago

Has this issue been resolved yet?

Here it started working out of the blue, for one day, now I have the same error again.

Suspected some update made it work, but after it stopped working again, I don't think so, because I have not updated anything after it stopped working for the second time.

Soo, I dunno what "will be fixed shortly" means about the bug, but I hope to see some progress soon

hauard commented 5 months ago

Sorry, still getting what seems to be the same error, after the fix and update. Also tried to remove the integration from HACS, and adding it again, same error:

Denne feilen stammer fra en tilpasset integrasjon.

Logger: custom_components.xplora_watch.coordinator
Source: helpers/update_coordinator.py:300
Integration: Xplora® Watch (documentation, issues)
First occurred: 11:16:40 (5 occurrences)
Last logged: 11:17:56

Unexpected error fetching xplora_watch-186 data: invalid literal for int() with base 10: ''
Unexpected error fetching xplora_watch- data: invalid literal for int() with base 10: ''
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 300, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 256, in _async_update_data
    return await self.update_method()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/xplora_watch/coordinator.py", line 177, in async_update_xplora_data
    watch_entry.update(await self.data_loop(wuids, message_limit, remove_message))
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/xplora_watch/coordinator.py", line 191, in data_loop
    res_chats = await self.controller.getWatchChatsRaw(wuid, limit=message_limit, show_del_msg=remove_message)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pyxplora_api/pyxplora_api_async.py", line 411, in getWatchChatsRaw
    result = ChatsNew.from_dict(result.get("chatsNew", None))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dataclasses_json/api.py", line 70, in from_dict
    return _decode_dataclass(cls, kvs, infer_missing)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dataclasses_json/core.py", line 220, in _decode_dataclass
    init_kwargs[field.name] = _decode_generic(field_type,
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dataclasses_json/core.py", line 311, in _decode_generic
    res = _decode_generic(type_arg, value, infer_missing)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dataclasses_json/core.py", line 291, in _decode_generic
    xs = _decode_items(_get_type_arg_param(type_, 0), value, infer_missing)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dataclasses_json/core.py", line 399, in _decode_items
    return list(_decode_item(type_args, x) for x in xs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dataclasses_json/core.py", line 399, in <genexpr>
    return list(_decode_item(type_args, x) for x in xs)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dataclasses_json/core.py", line 372, in _decode_item
    return _decode_dataclass(type_arg, x, infer_missing)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dataclasses_json/core.py", line 220, in _decode_dataclass
    init_kwargs[field.name] = _decode_generic(field_type,
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dataclasses_json/core.py", line 309, in _decode_generic
    res = _decode_dataclass(type_arg, value, infer_missing)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dataclasses_json/core.py", line 220, in _decode_dataclass
    init_kwargs[field.name] = _decode_generic(field_type,
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dataclasses_json/core.py", line 313, in _decode_generic
    res = _support_extended_types(type_arg, value)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dataclasses_json/core.py", line 251, in _support_extended_types
    else field_type(field_value))
         ^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
hauard commented 5 months ago

FYI: Adding the non-admin user creates the units and chosen entities, without error, but doesn't seem update them. That issue is from Xplora securing the API I guess

Ludy87 commented 5 months ago

@hauard I found the bug, I just can't test it, I would upload a beta in the coming days. Can you then check whether the problem is solved?

hauard commented 5 months ago

@hauard I found the bug, I just can't test it, I would upload a beta in the coming days. Can you then check whether the problem is solved?

Sure, no problem! Thanks for keeping the software updated ❤️

Enkil666 commented 5 months ago

Hey Ludy87,

I downloaded the latest (?) build v2.13.2 but I'm also still getting these errors. Had it for weeks now.


Unexpected error fetching xplora_watch-20456 data: invalid literal for int() with base 10: ''
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 300, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 256, in _async_update_data
    return await self.update_method()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/xplora_watch/coordinator.py", line 177, in async_update_xplora_data
    watch_entry.update(await self.data_loop(wuids, message_limit, remove_message))
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/xplora_watch/coordinator.py", line 191, in data_loop
    res_chats = await self.controller.getWatchChatsRaw(wuid, limit=message_limit, show_del_msg=remove_message)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pyxplora_api/pyxplora_api_async.py", line 423, in getWatchChatsRaw
    result = ChatsNew.from_dict(result.get("chatsNew", None))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dataclasses_json/api.py", line 70, in from_dict
    return _decode_dataclass(cls, kvs, infer_missing)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dataclasses_json/core.py", line 220, in _decode_dataclass
    init_kwargs[field.name] = _decode_generic(field_type,
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dataclasses_json/core.py", line 311, in _decode_generic
    res = _decode_generic(type_arg, value, infer_missing)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dataclasses_json/core.py", line 291, in _decode_generic
    xs = _decode_items(_get_type_arg_param(type_, 0), value, infer_missing)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dataclasses_json/core.py", line 399, in _decode_items
    return list(_decode_item(type_args, x) for x in xs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dataclasses_json/core.py", line 399, in <genexpr>
    return list(_decode_item(type_args, x) for x in xs)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dataclasses_json/core.py", line 372, in _decode_item
    return _decode_dataclass(type_arg, x, infer_missing)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dataclasses_json/core.py", line 220, in _decode_dataclass
    init_kwargs[field.name] = _decode_generic(field_type,
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dataclasses_json/core.py", line 309, in _decode_generic
    res = _decode_dataclass(type_arg, value, infer_missing)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dataclasses_json/core.py", line 220, in _decode_dataclass
    init_kwargs[field.name] = _decode_generic(field_type,
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dataclasses_json/core.py", line 313, in _decode_generic
    res = _support_extended_types(type_arg, value)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dataclasses_json/core.py", line 251, in _support_extended_types
    else field_type(field_value))
         ^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
Ludy87 commented 5 months ago

@Enkil666 try https://github.com/Ludy87/xplora_watch/tree/v2.13.3-beta

Enkil666 commented 5 months ago

@Ludy87 Thanks for this. Unfortunately, I still can't start the integration and get the same error: "Unexpected error fetching xplora_watch-20456 data: invalid literal for int() with base 10: ''

I have removed the integration, added it again, updated to Home Assistant 2024.1.5, but still can't get it to work :(

Ludy87 commented 5 months ago

Can you make sure it's the beta version?

Enkil666 commented 5 months ago

Yes.

Screenshot 2024-01-28 at 19 16 59
Ludy87 commented 5 months ago

@Enkil666 could you test the new beta? Thanks

Enkil666 commented 5 months ago

@Ludy87 I did and that did the trick. Thanks a lot for this!