8000 Integration not working after upgrading to 2023.4.5 · Issue #37 · snicker/zwift_hass · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Integration not working after upgrading to 2023.4.5 #37

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

Closed
dberwig opened this issue Apr 18, 2023 · 17 comments · Fixed by #38
Closed

Integration not working after upgrading to 2023.4.5 #37

dberwig opened this issue Apr 18, 2023 · 17 comments · Fixed by #38

Comments

@dberwig
Copy link
dberwig commented Apr 18, 2023

I had everything working fine until upgrading to 2023.4.5.

Log details:
Logger: custom_components.zwift.sensor
Source: custom_components/zwift/sensor.py:341
Integration: zwift (documentation)
First occurred: 12:55:48 AM (1 occurrences)
Last logged: 12:55:48 AM

Could not create Zwift sensor named 'Zwift'!
Traceback (most recent call last):
File "/config/custom_components/zwift/sensor.py", line 124, in async_setup_platform
await zwift_data._connect()
File "/config/custom_components/zwift/sensor.py", line 341, in _connect
from zwift import Client as ZwiftClient
File "/usr/local/lib/python3.10/site-packages/zwift/init.py", line 4, in
from .client import Client
File "/usr/local/lib/python3.10/site-packages/zwift/client.py", line 5, in
from .world import World
File "/usr/local/lib/python3.10/site-packages/zwift/world.py", line 2, in
from . import zwift_messages_pb2
File "/usr/local/lib/python3.10/site-packages/zwift/zwift_messages_pb2.py", line 35, in
_descriptor.FieldDescriptor(
File "/usr/local/lib/python3.10/site-packages/google/protobuf/descriptor.py", line 561, in new
_message.Message._CheckCalledFromGeneratedFile()
TypeError: Descriptors cannot not be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:

  1. Downgrade the protobuf package to 3.20.x or lower.
  2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates

@gabbiani
Copy link

Ditto. Can confirm same experience and logs.

@ewaucq
Copy link
ewaucq commented Apr 19, 2023

Same here: same error.
Integration broken since yesterday when I upgraded CORE

image

@ehrepli
Copy link
ehrepli commented Apr 19, 2023

I can confirm the same issue over here. Restored to a pre core 2023.4.5 update backup and it works correctly.

@snicker
Copy link
Owner
snicker commented Apr 20, 2023

thanks all, I'm looking into this tonight

@snicker
Copy link
Owner
snicker commented Apr 20, 2023

looks like the root cause is:

  1. a newer version of protobuf was released
  2. the zwift-client library did not pin to a specific version of protobuf
  3. the compiled data structure for zwift in the library is not compatible with the new version of protobuf

this issue is being tracked in the upstream library:
jsmits/zwift-client#377

in the meantime I've implemented one of the recommended workarounds in this integration and will release the new version shortly!

@snicker
Copy link
Owner
snicker commented Apr 20, 2023

released here https://github.com/snicker/zwift_hass/releases/tag/v3.3.1

@ewaucq
Copy link
ewaucq commented Apr 20, 2023

I confirm v3.3.1 fixed the issue
image

Thanks very much 👍

@dberwig
Copy link
Author
dberwig commented Apr 20, 2023

I can also confirm it is working again with v3.3.1.
Thanks a lot for such a quick fix! 👍

@gabbiani
Copy link

Fixed. Thank you so much.

@danka621
Copy link

I have only been using v.3.3.1 but this issue occurred for me some days ago. I am using 2023.4.5.

@domeq
Copy link
domeq commented Sep 4, 2023

This is still a problem for me even when running v3.3.1 and 2023.8.4.

This is all I'm getting when starting Home Assistant:

homeassistant    | 2023-09-04 08:36:13.521 ERROR (MainThread) [custom_components.zwift.sensor] Could not create Zwift sensor named 'Zwift'!
homeassistant    |   File "/config/custom_components/zwift/sensor.py", line 124, in async_setup_platform
homeassistant    |     await zwift_data._connect()
homeassistant    |   File "/config/custom_components/zwift/sensor.py", line 343, in _connect
homeassistant    |     from zwift import Client as ZwiftClient
homeassistant    |   File "/usr/local/lib/python3.11/site-packages/zwift/__init__.py", line 4, in <module>
homeassistant    |   File "/usr/local/lib/python3.11/site-packages/zwift/client.py", line 5, in <module>
homeassistant    |   File "/usr/local/lib/python3.11/site-packages/zwift/world.py", line 2, in <module>
homeassistant    |     from . import zwift_messages_pb2
homeassistant    |   File "/usr/local/lib/python3.11/site-packages/zwift/zwift_messages_pb2.py", line 35, in <module>

Any tips how to fix this? I tried reinstalling, removing component etc.

@snicker
Copy link
Owner
snicker commented Sep 17, 2023

Re-opening as it seems there are still some outstanding issues for only some users, will continue investigating.

@snicker
Copy link
Owner
snicker commented Sep 17, 2023

I'm not sure exactly what is causing this issue for everyone, but I want to thank @clyra for recompiling the messages in #40 - I'll work on adding this directly into this library and monkey patching the upstream library.

it does not seem that the upstream library will be updated, and I'm not interested in dealing with forking it at the moment unless it was to port it to asynchronous behavior. Will update with results.

@snicker
Copy link
Owner
snicker commented Sep 17, 2023

fixed in 3.3.2 (https://github.com/snicker/zwift_hass/releases/tag/v3.3.2)

Please report back if there are still issues! thanks @clyra for the files again. made this a bit easier.

@domeq
Copy link
domeq commented Sep 17, 2023

Getting a different error after updating to v3.3.2 and restarting HA:

homeassistant  | 2023-09-17 08:10:13.512 ERROR (MainThread) [custom_components.zwift.sensor] Could not create Zwift sensor named 'Zwift'!
homeassistant  |   File "/config/custom_components/zwift/sensor.py", line 124, in async_setup_platform
homeassistant  |     await zwift_data._connect()
homeassistant  |   File "/config/custom_components/zwift/sensor.py", line 344, in _connect
homeassistant  |     from zwift_patch import zwift_messages_pb2 as new_pb2
homeassistant  | ModuleNotFoundError: No module named 'zwift_patch'

@snicker
Copy link
Owner
snicker commented Sep 17, 2023

@domeq fixed in https://github.com/snicker/zwift_hass/releases/tag/v3.3.3

sorry about that, rushed 3.3.2 out without testing in HA

@domeq
Copy link
domeq commented Sep 17, 2023

Hell yeah! I can confirm it's working now! Thank you so much!

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.

7 participants
0