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

Integration wont load anymore on latest HA update 2023.6.3b #301

Closed
PV-Web opened this issue Jun 2, 2023 · 56 comments · Fixed by home-assistant/docker-base#222
Closed

Comments

@PV-Web
Copy link

PV-Web commented Jun 2, 2023

Describe the bug
Integration wont load anymore. in the notification i get this message on boot:
The following integrations and platforms could not be set up:

bosch (Show logs)
Please check your config and logs.

To Reproduce
Update to the latest version of HA 2023.6.b3

This is what the log says:
Logger: homeassistant.loader
Source: custom_components/bosch/init.py:12
Integration: bosch (documentation, issues)
First occurred: 23:25:34 (1 occurrences)
Last logged: 23:25:34

Unexpected exception importing component custom_components.bosch
Traceback (most recent call last):
File "/usr/local/lib/python3.11/enum.py", line 260, in set_name
enum_member.value = enum_class.member_type(*args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aioxmpp/xso/model.py", line 2923, in init
self.xso_class = self._create_class()
^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aioxmpp/xso/model.py", line 2933, in _create_class
self._create_name(),
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aioxmpp/xso/model.py", line 2926, in create_name
return "".join(map(str.title, self.name.split("
")))
^^^^^^^^^
AttributeError: 'XSOEnumMixin' object has no attribute 'name'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/loader.py", line 813, in get_component
ComponentProtocol, importlib.import_module(self.pkg_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1206, in _gcd_import
File "", line 1178, in _find_and_load
File "", line 1149, in _find_and_load_unlocked
File "", line 690, in _load_unlocked
File "", line 940, in exec_module
File "", line 241, in _call_with_frames_removed
File "/config/custom_components/bosch/init.py", line 12, in
from bosch_thermostat_client.const import (
File "/usr/local/lib/python3.11/site-packages/bosch_thermostat_client/init.py", line 10, in
from .gateway import gateway_chooser
File "/usr/local/lib/python3.11/site-packages/bosch_thermostat_client/gateway/init.py", line 1, in
from .ivt import IVTGateway, IVTMBLanGateway
File "/usr/local/lib/python3.11/site-packages/bosch_thermostat_client/gateway/ivt.py", line 6, in
from bosch_thermostat_client.connectors import connector_ivt_chooser
File "/usr/local/lib/python3.11/site-packages/bosch_thermostat_client/connectors/init.py", line 2, in
from .ivt import IVTXMPPConnector
File "/usr/local/lib/python3.11/site-packages/bosch_thermostat_client/connectors/ivt.py", line 2, in
import aioxmpp
File "/usr/local/lib/python3.11/site-packages/aioxmpp/init.py", line 101, in
from .errors import ( # NOQA
File "/usr/local/lib/python3.11/site-packages/aioxmpp/errors.py", line 109, in
class ErrorCondition(structs.CompatibilityMixin, xso.XSOEnumMixin, enum.Enum):
File "/usr/local/lib/python3.11/enum.py", line 557, in new
raise exc
File "/usr/local/lib/python3.11/enum.py", line 266, in set_name
raise new_exc
** Debug SCAN **
** IMPORTANT **
Go to Developer tools in Home Assistant, choose Service tab and choose bosch.debug_scan
Download file to your computer and upload it somewhere eg. https://jsonblob.com/

@pszafer
Copy link
Collaborator

pszafer commented Jun 3, 2023

It's aioxmpp bug. We're waiting for upstream to fix https://github.com/horazont/aioxmpp/issues/391

@slovdahl
Copy link
Contributor

slovdahl commented Jun 4, 2023

Looks like it's actually a Python 3.11.3 regression: https://github.com/horazont/aioxmpp/issues/391#issuecomment-1575137853. Should be fixed in Python 3.11.4 that should be released tomorrow. Hopefully HA will update to it too.

@smoki3
Copy link

smoki3 commented Jun 6, 2023

Looks like HA is already on 3.11.4. And not working for me

@slovdahl
Copy link
Contributor

slovdahl commented Jun 6, 2023

Are you sure? Python 3.11.4 has not even been released yet it seems.

https://www.python.org/downloads/

image

@pszafer
Copy link
Collaborator

pszafer commented Jun 6, 2023

Python 3.11.4 hasn't been released yet, so impossible that your HA has it.

@smoki3
Copy link

smoki3 commented Jun 6, 2023

oh sorry my fault, you are right

image

@fisch55
Copy link

fisch55 commented Jun 6, 2023

It seams that it will take longer to fix it….

@PV-Web
Copy link
Author

PV-Web commented Jun 6, 2023

Would there not be another way to temporarily fix this? until the new python is released?

@smoki3
Copy link

smoki3 commented Jun 7, 2023

3.11.4 is released now. but not for HA looks like they will release 2023.6 today without the python update.

@fisch55
Copy link

fisch55 commented Jun 7, 2023

3.11.4 is released now. but not for HA looks like they will release 2023.6 today without the python update.

Mad 😉

@slovdahl
Copy link
Contributor

slovdahl commented Jun 7, 2023

Let's hope we get a 2023.6.1 fairly soon with Python 3.11.4. 🤞

@JBakers
Copy link

JBakers commented Jun 8, 2023

Is there any other (temp) workaround maybe?
I got a couple of automations running from my Bosch entities, which all fail now (obviously)

@gmed-ed
Copy link

gmed-ed commented Jun 8, 2023

I've been running in this issue.
Temporarly i returned to previous Version by using the backup made before updating.
After that, i hat to restart my KM200 device, because not all entities've been visible instandly.
Now everything is in working state again and time to wait for the phyton update.

@andyktaylor
Copy link

I've been running in this issue. Temporarly i returned to previous Version by using the backup made before updating. After that, i hat to restart my KM200 device, because not all entities've been visible instandly. Now everything is in working state again and time to wait for the phyton update.

Yup in the same boat here, shame as the update has some pretty exciting changes, so hopefully not too long until we can move up.

@schlaufon
Copy link

I cannot confirm it's a python 3.11.x bug.
see: TypeError: value not set in new, unable to create it
2023-06-09 07:21:34.691 ERROR (MainThread) [homeassistant.setup] Setup failed for custom integration bosch:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/loader.py", line 813, in get_component
ComponentProtocol, importlib.import_module(self.pkg_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1206, in _gcd_import
File "", line 1178, in _find_and_load
File "", line 1149, in _find_and_load_unlocked
File "", line 690, in _load_unlocked
File "", line 940, in exec_module
File "", line 241, in _call_with_frames_removed
File "/config/custom_components/bosch/init.py", line 12, in
from bosch_thermostat_client.const import (
File "/usr/local/lib/python3.11/site-packages/bosch_thermostat_client/init.py", line 10, in
from .gateway import gateway_chooser
File "/usr/local/lib/python3.11/site-packages/bosch_thermostat_client/gateway/init.py", line 1, in
from .ivt import IVTGateway, IVTMBLanGateway
File "/usr/local/lib/python3.11/site-packages/bosch_thermostat_client/gateway/ivt.py", line 6, in
from bosch_thermostat_client.connectors import connector_ivt_chooser
File "/usr/local/lib/python3.11/site-packages/bosch_thermostat_client/connectors/init.py", line 2, in
from .ivt import IVTXMPPConnector
File "/usr/local/lib/python3.11/site-packages/bosch_thermostat_client/connectors/ivt.py", line 2, in
import aioxmpp
File "/usr/local/lib/python3.11/site-packages/aioxmpp/init.py", line 101, in
from .errors import ( # NOQA
File "/usr/local/lib/python3.11/site-packages/aioxmpp/errors.py", line 109, in
class ErrorCondition(structs.CompatibilityMixin, xso.XSOEnumMixin, enum.Enum):
File "/usr/local/lib/python3.11/enum.py", line 557, in new
raise exc
File "/usr/local/lib/python3.11/enum.py", line 266, in set_name
raise new_exc
TypeError: value not set in new, unable to create it
2023-06-09 07:21:34.691 ERROR (MainThread) [homeassistant.setup] Setup failed for custom integration bosch: Unable to import component: Exception importing custom_components.bosch

@schlaufon
Copy link

It just won't load!
image

@smoki3
Copy link

smoki3 commented Jun 9, 2023

@smoki3
Copy link

smoki3 commented Jun 9, 2023

It just won't load! image

It's not loading because of this bug

@gmed-ed
Copy link

gmed-ed commented Jun 9, 2023

HA Core Update 2023.6.1 is showing up as update right now.
At a glance no detailled description about phyton minor version.

@JBakers
Copy link

JBakers commented Jun 9, 2023

2023.6.1 did not fix this issue as of yet.

@Tuningmormota
Copy link

As temporary workaround the python can be updated to 3.11.4 manually ( i have done it on my HA docker image). After this integration works again. But only do it if you know what you are doing, and how to go back if something goes south.

@smoki3
Copy link

smoki3 commented Jun 9, 2023

So the update will be merged soon with 2023.6.2 it should be fixed

@frenck
Copy link

frenck commented Jun 9, 2023

So the update will be merged soon with 2023.6.2 it should be fixed

It depends on when it lands, I'm not sure if it will make into 2023.6.2 (or a patch release at all).

The linked PR to this issue is for bumping our base images, but we have more changes in the pipeline affecting those (cosign support).

Additionally, the linked PR is just the base image, which still needs to be built and shipped (which takes quite some hours). After that, I can start adjusting the Home Assistant base image, once that is tested, approved, build, and shipped I can start upgrading the Home Assistant Core itself, which also needs to be tested, approved, build, and shipped.

TL;DR: Don't hold your breath on it being shipped in .2

../Frenck

@roderik-maker
Copy link

Thanks for keeping us updated and managing expectations! @frenck

@schlaufon
Copy link

So the update will be merged soon with 2023.6.2 it should be fixed

It depends on when it lands, I'm not sure if it will make into 2023.6.2 (or a patch release at all).

@frenck

Thank you so much for caring about the issue.

May I ask, to include the recording sensors as well. Those have stopped working with a former update

Thank you soooo much in advance!

image
.

@frenck
Copy link

frenck commented Jun 9, 2023

@schlaufon I think you misunderstand the issue & solution, your request makes no sense to me. Sorry.

@schlaufon
Copy link

@schlaufon I think you misunderstand the issue & solution, your request makes no sense to me. Sorry.

@frenck

Is that so. Then take my apology.
Who -however- would you advice to contact for that recording sensor issue.
Cheers!

@pszafer
Copy link
Collaborator

pszafer commented Jun 9, 2023

@schlaufon I will work on it when I get working docker image ;)

@JBakers
Copy link

JBakers commented Jun 11, 2023

@Tuningmormota

As temporary workaround the python can be updated to 3.11.4 manually ( i have done it on my HA docker image). After this integration works again. But only do it if you know what you are doing, and how to go back if something goes south.

Any suggestion as to how? With the current hot weather here my temperature inside is not what it's supposed to be.

@Tuningmormota
Copy link

Tuningmormota commented Jun 11, 2023

@Tuningmormota

As temporary workaround the python can be updated to 3.11.4 manually ( i have done it on my HA docker image). After this integration works again. But only do it if you know what you are doing, and how to go back if something goes south.

Any suggestion as to how? With the current hot weather here my temperature inside is not what it's supposed to be.

I have done the following:

  1. Opened a console to HA docker instance. (I run it on a Pi4, and I use portainer for docker managment)
  2. I used the apk command the download what is needed to download, compile and bulid python (stackoverflow and google is recommended at this point, especially for troubelshooting if needed)
  3. donwload the official python lib
  4. extract it
  5. Start worring if it works at the end or not. (I have a backup every 30 minutes form my config folder, and weekly image of Pi SD card, so I was brave enough)
  6. run configure and make scripts and let it run for long time. (and hoping no errors will happen during the process. It run around 40 minutes on my setup)
  7. restart docker image, after that I could see the temerature values for the rooms, and automations based on away mode are working again.
  8. check all other pages of HA are looks good or not? In my case yes.

Only do if you have a good quality backup, or you dont mind to start everthying from scratch. (as HA is running, while under it you may exchange python libs which are currently in use. It very easily corrupts your HA database and config, and other thing which may different between our setups.)
I did it bacause from 2023.6.1 I went back 2023.5.4 and I could reach energy and settings pages any more. Now I running 2023.6.1 with python 3.11.4 so far working. But I can update only to HA version which will have python 3.11.4 already.

12.16.2023: Typo corrections, I should not type long thing late :-)

@gmed-ed
Copy link

gmed-ed commented Jun 11, 2023

one can see, it is possible.
Is it recomandable, i'm not sure
especially for a productive system.
Thanks for pointing the issue with upcoming updates need to have this python version, too

@JBakers
Copy link

JBakers commented Jun 12, 2023

@Tuningmormota
Thanks!

@MajorTomD
Copy link

MajorTomD commented Jun 12, 2023

Hi there!

I am following this thread because my integration has stopped working too, of course, after the 2023.6 update.
I am very new with Home Assistant and have absolutly no experience with all the details of coding, python and so on.

But I am not sure if I understand it correctly. The issue is due to the python update and there will be another update on HA, maybe not 2023.6.2, which will solve this problem?

I think this Bosch integration is a very cool one and I guess the most importend in HA for me. So I am very frustrated right now :)

Cheers
Sky

@slovdahl
Copy link
Contributor

Correct, a Python update between HA 2023.5 and 2023.6 broke this integration. A newer Python version fixes it again, and we're hoping that that Python version will be available in HA 2023.6.2 or a later patch version, but there are no guarantees. The safest course of action in your case right now might be to go back to HA 2023.5 while we wait for the fixed Python version.

@mjmeierhoefer
Copy link

Is there any feedback that a newer python version will be used by homeassistant 2023.7?
Is there no easy way to fix the code to work with 2023.6?

@pszafer
Copy link
Collaborator

pszafer commented Jun 12, 2023

You can downgrade or try this #301 (comment) or wait.

@schlaufon
Copy link

Correct, a Python update between HA 2023.5 and 2023.6 broke this integration. A newer Python version fixes it again,.....
@slovdal

Am I supposed to understand that?
An integration -which I understand worked with python 3.11.x)- is not(!) working because of a newer python version?

Sorry for my naive question here: if python is a "programming language" and it's code is changed by an update, then I understand it may consist of a different code.
Thus the integration(!) (application) must be encoded in accordance to the updated language version and not(!) vice versa, right?

How would an update of the language help with an "old" integration?

I do not see that python takes care of an "insignificant" application/integration in HA.

Please enlighten me.

ThanX.

@larsdunemark
Copy link
Contributor

Correct, a Python update between HA 2023.5 and 2023.6 broke this integration. A newer Python version fixes it again,.....
@slovdal

Am I supposed to understand that? An integration -which I understand worked with python 3.11.x)- is not(!) working because of a newer python version?

Sorry for my naive question here: if python is a "programming language" and it's code is changed by an update, then I understand it may consist of a different code. Thus the integration(!) (application) must be encoded in accordance to the updated language version and not(!) vice versa, right?

How would an update of the language help with an "old" integration?

I do not see that python takes care of an "insignificant" application/integration in HA.

Please enlighten me.

ThanX.

In this case it seems to have been an bug introduce in python 3.11.3 that changed expecting behavior. This is fixed in python 3.11.4. Since python is an interpreter it can in this case change behavior for how code behaves depending on version of python. But this is a bug and not something that should happen or be expected.

@RaHehl
Copy link

RaHehl commented Jun 12, 2023

a good description what to do for manuall upgrading python is the HA Dockerfile: https://github.com/home-assistant/docker-base/blob/master/python/3.11/Dockerfile

@frenck
Copy link

frenck commented Jun 12, 2023

It is not; I would strongly discourage doing that manually. Unless you are an very advanced sysadmin, knowing what you are doing, I would really really strongly recommended staying out of doing things like that. And even if one is... that link you send, makes no sense and is way overcomplicated for the goal.

Please note, by recommending things like that, you will get users into a state of breaking their system, as they are not familiar or knowledgable enough to handle such things.

The right answer here is: If you need this to work right now, restore a backup of Home Assistant 2023.5 or older (the one you had before upgrading to 2023.6), and wait until a fix is available.

../Frenck

@RaHehl
Copy link

RaHehl commented Jun 12, 2023

@frenck if just restoring would work: yes

But sometimes it's not the best option.

If i try to rollback to 2023.05 i get the following error:

"Error during connection setup: [<class 'decimal.ConversionSyntax'>] (retrying in 15 seconds)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/recorder/core.py", line 915, in _setup_recorder
self._setup_connection()
File "/usr/src/homeassistant/homeassistant/components/recorder/core.py", line 1394, in _setup_connection
Base.metadata.create_all(self.engine)"

And i don't want to rollback the DB, this will make me lose my energy board history of the last 3 days.

@frenck
Copy link

frenck commented Jun 12, 2023

@frenck if just restoring would work: yes

If restoring didn't work, did you file an issue?

As in, making & restoring backups is extensively tested, and should just work. If not, we should definitely learn from that. It is important to work reliably.

If i try to rollback to 2023.05 i get the following error:

Rolling back is not restoring a backup.

Your error is expected, as rolling back is not a supported/implemented thing in Home Assistant. We implement backward compatibility, not forward compatibility (like in this case, you are using a newer database format on an older HA version caused by the rollback).

@RaHehl
Copy link

RaHehl commented Jun 12, 2023

regarding newer databaser format: My schema_changes table said v41 changed 2023-04-07, v41 seems to be the latest and already 3 month old? https://github.com/home-assistant/core/blame/dev/homeassistant/components/recorder/db_schema.py (72).

due to the unchanged scheme, a rollback should have worked while retaining the db?

at least that would be my thought

In my special case, upgrading python to v3.11.4 solved my problems, with the slightest inconvenience

@gmed-ed
Copy link

gmed-ed commented Jun 12, 2023

In my case a restore back to 2023.5.6 was not a big issue.
After the restore completed i had to restart (not reset) my KM200 device and i was back in business again.

So backup/ restore is working as expected.

I got another HA Setup running at a different location without the Bosch integration so i could update to take a look for the new stuff.
For my needs i can go on for a while with 2023.05

@frenck
Copy link

frenck commented Jun 13, 2023

regarding newer databaser format: My schema_changes table said v41 changed 2023-04-07, v41 seems to be the latest and already 3 month old

@rhehl Rollbacks are not supported, and HA is not designed to work that way. It is not just the database format but also other data formats (e.g., config entries, entity registries, device registries, area registries, and even storage versions for individual integrations, and a bunch more).

For that reason, please use backup to restore.

@slovdahl
Copy link
Contributor

slovdahl commented Jun 14, 2023

Good news if you didn't already notice: the upcoming 2023.6.2 will have Python 3.11.4. Thank you very much @frenck! 🙇

@frenck
Copy link

frenck commented Jun 14, 2023

Yup! @slovdahl! You are welcome.

I try to get a release out tomorrow (or at least before the weekend).

../Frenck

@JBakers
Copy link

JBakers commented Jun 15, 2023

Confirming core update 2023.6.2 fixed this issue!

@MOST2K2
Copy link

MOST2K2 commented Jun 15, 2023

Yes its working again now! Thanks to all!

@Didel
Copy link

Didel commented Jun 15, 2023

Looks like it is fixed with 2023.6.2. However, all 'devices' added by this integration are now duplicated in my installation. E.g. , the old climate.woonkamer entity does not work anymore, but a new climate.woonkamer_2 entity is now also available that does work. Any ideas how to fix that? (using 0.22.2 of Bosch-termostat, and 2023.6.2 of HA)

Edit: I have resolved it by uninstalling the integration, and then re-adding it again.

@JBakers
Copy link

JBakers commented Jun 15, 2023

@Didel
Delete the old ones and rename the new ones exactly the same?

@pszafer
Copy link
Collaborator

pszafer commented Jun 15, 2023

Issue is fixed now, closing it.

@pszafer pszafer closed this as completed Jun 15, 2023
@11Maarten
Copy link

@frenck
Thank you very much.
It works and my CT200 seems to report better then before.

@CharlieMK
Copy link

Updated, but heating is still showing as unavailable for me. Rebooted the system and reloaded the integration to no avail. Error:

Logger: homeassistant
Source: custom_components/bosch/__init__.py:388 
Integration: Bosch thermostat ([documentation](https://github.com/bosch-thermostat/home-assistant-bosch-custom-component), [issues](https://github.com/bosch-thermostat/home-assistant-bosch-custom-component/issues)) 
First occurred: 22:43:21 (1 occurrences) 
Last logged: 22:43:21

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/config/custom_components/bosch/__init__.py", line 423, in thermostat_refresh
    await self.component_update(SWITCH, event_time)
  File "/config/custom_components/bosch/__init__.py", line 388, in component_update
    entities = self.hass.data[DOMAIN][self.uuid][component_type]
               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
KeyError: 'switch'

@gmed-ed
Copy link

gmed-ed commented Jun 16, 2023

For mee, all went good.

Try to restart your heating device or at least the Bosch Gateway.
Maybe their Cloud didn't provide proper data.
Had a similar issue after restoring old HA Version.

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.