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

Add-on borken from recent HA update? #24

Open
NOTORIOUSVR opened this issue Dec 5, 2023 · 14 comments
Open

Add-on borken from recent HA update? #24

NOTORIOUSVR opened this issue Dec 5, 2023 · 14 comments

Comments

@NOTORIOUSVR
Copy link

I believe one of the recent HA updates broke this add-on. Wondering if there is any hints here that would point to what it is?

`Serve HTTPS
2023-12-05 18:42:41,783 - configManager.argumentHandler - INFO - Using Host 10.10.1.14:80
2023-12-05 18:42:41,784 - configManager.argumentHandler - INFO - Host MAC given as 000c297c1abe
2023-12-05 18:42:41,784 - configManager.argumentHandler - INFO - IP range for light discovery: 0-255
2023-12-05 18:42:41,784 - configManager.argumentHandler - INFO - Deconz IP given as 127.0.0.1
2023-12-05 18:42:41,784 - configManager.argumentHandler - INFO - Online Discovery/Remote API Enabled!
2023-12-05 18:42:41,785 - configManager.argumentHandler - INFO - Using Host 10.10.1.14:80
2023-12-05 18:42:41,785 - configManager.argumentHandler - INFO - Host MAC given as 000c297c1abe
2023-12-05 18:42:41,786 - configManager.argumentHandler - INFO - IP range for light discovery: 0-255
2023-12-05 18:42:41,786 - configManager.argumentHandler - INFO - Deconz IP given as 127.0.0.1
2023-12-05 18:42:41,786 - configManager.argumentHandler - INFO - Online Discovery/Remote API Enabled!
2023-12-05 18:42:41,787 - configManager.argumentHandler - INFO - Debug logging disabled!
2023-12-05 23:42:41,807 - configManager.configHandler - ERROR - CRITICAL! Config file was not loaded
Traceback (most recent call last):
File "/opt/hue-emulator/configManager/configHandler.py", line 114, in load_config
self.yaml_config["lights"][light] = Light(data)
File "/opt/hue-emulator/HueObjects/init.py", line 291, in init
"data": [self.getV2Api()],
File "/opt/hue-emulator/HueObjects/init.py", line 531, in getV2Api
"brightness": round(self.state["bri"] / 2.54, 2),
TypeError: unsupported operand type(s) for /: 'NoneType' and 'float'
2023-12-05 23:42:41,808 - HueObjects - INFO - Dinner Table Light light was destroyed.
CRITICAL! Config file was not loaded
Exception ignored in: <function Light.del at 0x7f688d310790>
Traceback (most recent call last):
File "/opt/hue-emulator/HueObjects/init.py", line 307, in del
ImportError: sys.meta_path is None, Python is likely shutting down
Exception ignored in: <function Light.del at 0x7f688d310790>
Traceback (most recent call last):
File "/opt/hue-emulator/HueObjects/init.py", line 307, in del
ImportError: sys.meta_path is None, Python is likely shutting down
[cmd] ./run.sh exited 1
[cont-finish.d] executing container finish scripts...
[cont-finish.d] 99-message.sh: executing...

            Oops! Something went wrong.

We are so sorry, but something went terribly wrong when
starting or running this add-on.

Be sure to check the log above, line by line, for hints.

[cont-finish.d] 99-message.sh: exited 0.
[cont-finish.d] done.`

@mariusmotea
Copy link
Member

looks like homeassistant now return None on brightness key for some reasons. I will try to fix this by ignoring brightness value if is not type int.

@vwvierhundertzwoelf
Copy link

Hi, is there any progress on this matter?
I recently got the same error and i cant start the add-on any more.

@hendriksen-mark
Copy link
Member

Hi, can you show some logs? also what version of diyhue are you running? the code is changed allot form dec 2023.

@vwvierhundertzwoelf
Copy link

I run the Addon Version 2.0.14
and Hass Core 2024.6.4

` File "/opt/hue-emulator/HueObjects/init.py", line 308, in del
ImportError: sys.meta_path is None, Python is likely shutting down
Exception ignored in: <function Light.del at 0x7fb5f0fecca0>
Traceback (most recent call last):
File "/opt/hue-emulator/HueObjects/init.py", line 308, in del
ImportError: sys.meta_path is None, Python is likely shutting down
Exception ignored in: <function Light.del at 0x7fb5f0fecca0>
Traceback (most recent call last):
File "/opt/hue-emulator/HueObjects/init.py", line 308, in del
ImportError: sys.meta_path is None, Python is likely shutting down
Exception ignored in: <function Light.del at 0x7fb5f0fecca0>
Traceback (most recent call last):
File "/opt/hue-emulator/HueObjects/init.py", line 308, in del
ImportError: sys.meta_path is None, Python is likely shutting down
Exception ignored in: <function Light.del at 0x7fb5f0fecca0>
Traceback (most recent call last):
File "/opt/hue-emulator/HueObjects/init.py", line 308, in del
ImportError: sys.meta_path is None, Python is likely shutting down
Exception ignored in: <function Light.del at 0x7fb5f0fecca0>
Traceback (most recent call last):
File "/opt/hue-emulator/HueObjects/init.py", line 308, in del
ImportError: sys.meta_path is None, Python is likely shutting down
Exception ignored in: <function Light.del at 0x7fb5f0fecca0>
Traceback (most recent call last):
File "/opt/hue-emulator/HueObjects/init.py", line 308, in del
ImportError: sys.meta_path is None, Python is likely shutting down
Exception ignored in: <function Light.del at 0x7fb5f0fecca0>
Traceback (most recent call last):
File "/opt/hue-emulator/HueObjects/init.py", line 308, in del
ImportError: sys.meta_path is None, Python is likely shutting down
Exception ignored in: <function Light.del at 0x7fb5f0fecca0>
Traceback (most recent call last):
File "/opt/hue-emulator/HueObjects/init.py", line 308, in del
ImportError: sys.meta_path is None, Python is likely shutting down
Exception ignored in: <function Light.del at 0x7fb5f0fecca0>
Traceback (most recent call last):
File "/opt/hue-emulator/HueObjects/init.py", line 308, in del
ImportError: sys.meta_path is None, Python is likely shutting down
Exception ignored in: <function Light.del at 0x7fb5f0fecca0>
Traceback (most recent call last):
File "/opt/hue-emulator/HueObjects/init.py", line 308, in del
ImportError: sys.meta_path is None, Python is likely shutting down
Exception ignored in: <function Light.del at 0x7fb5f0fecca0>
Traceback (most recent call last):
File "/opt/hue-emulator/HueObjects/init.py", line 308, in del
ImportError: sys.meta_path is None, Python is likely shutting down
Exception ignored in: <function Light.del at 0x7fb5f0fecca0>
Traceback (most recent call last):
File "/opt/hue-emulator/HueObjects/init.py", line 308, in del
ImportError: sys.meta_path is None, Python is likely shutting down
Exception ignored in: <function Light.del at 0x7fb5f0fecca0>
Traceback (most recent call last):
File "/opt/hue-emulator/HueObjects/init.py", line 308, in del
ImportError: sys.meta_path is None, Python is likely shutting down
Exception ignored in: <function Light.del at 0x7fb5f0fecca0>
Traceback (most recent call last):
File "/opt/hue-emulator/HueObjects/init.py", line 308, in del
ImportError: sys.meta_path is None, Python is likely shutting down
Exception ignored in: <function Light.del at 0x7fb5f0fecca0>
Traceback (most recent call last):
File "/opt/hue-emulator/HueObjects/init.py", line 308, in del
ImportError: sys.meta_path is None, Python is likely shutting down
Exception ignored in: <function Group.del at 0x7fb5f0fef040>
Traceback (most recent call last):
File "/opt/hue-emulator/HueObjects/init.py", line 1051, in del
ImportError: sys.meta_path is None, Python is likely shutting down
Exception ignored in: <function Group.del at 0x7fb5f0fef040>
Traceback (most recent call last):
File "/opt/hue-emulator/HueObjects/init.py", line 1051, in del
ImportError: sys.meta_path is None, Python is likely shutting down
Exception ignored in: <function Group.del at 0x7fb5f0fef040>
Traceback (most recent call last):
File "/opt/hue-emulator/HueObjects/init.py", line 1051, in del
ImportError: sys.meta_path is None, Python is likely shutting down
Exception ignored in: <function Group.del at 0x7fb5f0fef040>
Traceback (most recent call last):
File "/opt/hue-emulator/HueObjects/init.py", line 1051, in del
ImportError: sys.meta_path is None, Python is likely shutting down
Exception ignored in: <function Group.del at 0x7fb5f0fef040>
Traceback (most recent call last):
File "/opt/hue-emulator/HueObjects/init.py", line 1051, in del
ImportError: sys.meta_path is None, Python is likely shutting down
Exception ignored in: <function Group.del at 0x7fb5f0fef040>
Traceback (most recent call last):
File "/opt/hue-emulator/HueObjects/init.py", line 1051, in del
ImportError: sys.meta_path is None, Python is likely shutting down
[cmd] ./run.sh exited 1
[cont-finish.d] executing container finish scripts...
[cont-finish.d] 99-message.sh: executing...

            Oops! Something went wrong.

We are so sorry, but something went terribly wrong when
starting or running this add-on.

Be sure to check the log above, line by line, for hints.

[cont-finish.d] 99-message.sh: exited 0.
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.`

I need to figute out how to get longer logs from HA.
I found something with ha host logs --identifier but whats the identifier for diyhue?

@hendriksen-mark
Copy link
Member

i do not work allot with HA but last i used Portainer to inspect the docker container of diyhue.
to find the identifier you can do docker ps in the terminal of the host machine or on the addon page in HA you can see the identifier.

@vwvierhundertzwoelf
Copy link

Ok i used docker logs and found out, that the error came from the confighandler.py in line 175
AttributeError: 'NoneType object has no attrobute 'items'

I looked at the source code and found out, that it tries to load the scenes.yaml but its somehow empty in my case and thats why it failed to load.

I deleted scenes.yaml and now the addon is working again.

But its still weired, since i use diyhue for at least 4 years now and never had this problem. Recently i had it twice and reverted the virtual machine to a older state then it was working for a week before the failure happened again.

@vwvierhundertzwoelf
Copy link

Okay, i loaded an old checkpoint of the vm and found out that i previously had 17 scenes in the scenes.yaml, so copied the old file to the new checkpoint and the addon is still working.
So something must have deleted all the contents of the scenes.yaml fileand left it completely empty, without me doing anything.

@hendriksen-mark
Copy link
Member

Strange, was the scenes.yaml empty or gone or only {} ? good that you found the problem and was able to fix it your self.

@vwvierhundertzwoelf
Copy link

vwvierhundertzwoelf commented Jul 8, 2024

The file was completly empty.
But my original file has no brackets, it looks like this:

"1":
id_v2: xxx
name: Abend
appdata:
version: 1
data: xx
owner: xxx
type: GroupScene
picture: ""
image: null
recycle: false
lastupdated: "2022-06-30T13:08:57"
lights:
- "4"
- "5"
- "6"
lightstates:
"4":
"on": true
bri: 254
ct: 189
"5":
"on": true
bri: 254
ct: 189
"6":
"on": false
bri: 1
ct: 189
group: "3"
palette: {}
speed: 0.6269841194152832
"2":......

@hendriksen-mark
Copy link
Member

yes if it is a new file it only have {}, if there is stuff in it it is in YAML standard.
a complete empty file should not be possible.

@vwvierhundertzwoelf
Copy link

vwvierhundertzwoelf commented Jul 16, 2024

Okay the server breaks itself every few days. Three times i had a half deteted ligths.yaml, where the first about 400 lines where present but the other 1000 lines where missing. I already hat a empty groups.yaml and empty scenes yaml.
The addon is always stopped when i notice with a configHandler error in the protocols...

If i create a backup of the files like lights.yaml.bak it stays the same and does not get corrupted so i can copy it back and restart the addon.
DiyHue is the only plugin with those issues. It started like 3 weeks ago.

I really dont understand what the problem is, i also have esphome and mosquitto installed and those plugins also use a config which is completly fine....

@hendriksen-mark
Copy link
Member

i need to see some logs, without logs i cant do anything.

@vwvierhundertzwoelf
Copy link

vwvierhundertzwoelf commented Jul 20, 2024

Hi,
the problem is i only get the latest log from the container using ha addons logs c863ef44_diyhue and this always looks loke the one above.

Is there a possibility to get older logs from before the latest fail?
I mean it fails more or less every day now, and the failure mode is always the same.
One of the config files is either completely empty, or half is missing.
In the Backup folder everything is still intact.
But as i said, only the diyhue addon the rest is fine.
And i did not change the config file at least half a year before the problems started.
That must be a problem with the latest hassio version.

Thanks for your help.

`[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing...
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
/config/diyhue exists.
Your Architecture is = amd64
Serve HTTPS
2024-07-20 04:01:44,487 - configManager.argumentHandler - INFO - Using Host 192.168.2.147:80
2024-07-20 04:01:44,488 - configManager.argumentHandler - INFO - Host MAC given as 00155D2E0303
2024-07-20 04:01:44,489 - configManager.argumentHandler - INFO - IP range for light discovery: 0-255
2024-07-20 04:01:44,490 - configManager.argumentHandler - INFO - Deconz IP given as 127.0.0.1
2024-07-20 04:01:44,491 - configManager.argumentHandler - INFO - Online Discovery/Remote API Enabled!
2024-07-20 04:01:44,535 - configManager.argumentHandler - INFO - Using Host 192.168.2.147:80
2024-07-20 04:01:44,535 - configManager.argumentHandler - INFO - Host MAC given as 00155D2E0303
2024-07-20 04:01:44,536 - configManager.argumentHandler - INFO - IP range for light discovery: 0-255
2024-07-20 04:01:44,537 - configManager.argumentHandler - INFO - Deconz IP given as 127.0.0.1
2024-07-20 04:01:44,537 - configManager.argumentHandler - INFO - Online Discovery/Remote API Enabled!
2024-07-20 04:01:44,537 - configManager.argumentHandler - INFO - Debug logging enabled!
2024-07-20 03:01:44,884 - configManager.configHandler - ERROR - CRITICAL! Config file was not loaded
Traceback (most recent call last):
File "/opt/hue-emulator/configManager/configHandler.py", line 170, in load_config
self.yaml_config["groups"][group].add_light(self.yaml_config["lights"][light])
KeyError: '41'
CRITICAL! Config file was not loaded
Exception ignored in: <function Light.del at 0x7f6018651ca0>
Traceback (most recent call last):
File "/opt/hue-emulator/HueObjects/init.py", line 308, in del
ImportError: sys.meta_path is None, Python is likely shutting down
Exception ignored in: <function Light.del at 0x7f6018651ca0>
Traceback (most recent call last):
File "/opt/hue-emulator/HueObjects/init.py", line 308, in del
ImportError: sys.meta_path is None, Python is likely shutting down
Exception ignored in: <function Light.del at 0x7f6018651ca0>
Traceback (most recent call last):
File "/opt/hue-emulator/HueObjects/init.py", line 308, in del
ImportError: sys.meta_path is None, Python is likely shutting down
Exception ignored in: <function Light.del at 0x7f6018651ca0>
Traceback (most recent call last):
File "/opt/hue-emulator/HueObjects/init.py", line 308, in del
ImportError: sys.meta_path is None, Python is likely shutting down
Exception ignored in: <function Light.del at 0x7f6018651ca0>
Traceback (most recent call last):
File "/opt/hue-emulator/HueObjects/init.py", line 308, in del
ImportError: sys.meta_path is None, Python is likely shutting down
Exception ignored in: <function Light.del at 0x7f6018651ca0>
Traceback (most recent call last):
File "/opt/hue-emulator/HueObjects/init.py", line 308, in del
ImportError: sys.meta_path is None, Python is likely shutting down
Exception ignored in: <function Light.del at 0x7f6018651ca0>
Traceback (most recent call last):
File "/opt/hue-emulator/HueObjects/init.py", line 308, in del
ImportError: sys.meta_path is None, Python is likely shutting down
Exception ignored in: <function Light.del at 0x7f6018651ca0>
Traceback (most recent call last):
File "/opt/hue-emulator/HueObjects/init.py", line 308, in del
ImportError: sys.meta_path is None, Python is likely shutting down
Exception ignored in: <function Light.del at 0x7f6018651ca0>
Traceback (most recent call last):
File "/opt/hue-emulator/HueObjects/init.py", line 308, in del
ImportError: sys.meta_path is None, Python is likely shutting down
Exception ignored in: <function Light.del at 0x7f6018651ca0>
Traceback (most recent call last):
File "/opt/hue-emulator/HueObjects/init.py", line 308, in del
ImportError: sys.meta_path is None, Python is likely shutting down
Exception ignored in: <function Light.del at 0x7f6018651ca0>
Traceback (most recent call last):
File "/opt/hue-emulator/HueObjects/init.py", line 308, in del
ImportError: sys.meta_path is None, Python is likely shutting down
Exception ignored in: <function Light.del at 0x7f6018651ca0>
Traceback (most recent call last):
File "/opt/hue-emulator/HueObjects/init.py", line 308, in del
ImportError: sys.meta_path is None, Python is likely shutting down
Exception ignored in: <function Light.del at 0x7f6018651ca0>
Traceback (most recent call last):
File "/opt/hue-emulator/HueObjects/init.py", line 308, in del
ImportError: sys.meta_path is None, Python is likely shutting down
Exception ignored in: <function Group.del at 0x7f6018654040>
Traceback (most recent call last):
File "/opt/hue-emulator/HueObjects/init.py", line 1051, in del
ImportError: sys.meta_path is None, Python is likely shutting down
Exception ignored in: <function Group.del at 0x7f6018654040>
Traceback (most recent call last):
File "/opt/hue-emulator/HueObjects/init.py", line 1051, in del
ImportError: sys.meta_path is None, Python is likely shutting down
[cmd] ./run.sh exited 1
[cont-finish.d] executing container finish scripts...
[cont-finish.d] 99-message.sh: executing...

            Oops! Something went wrong.

We are so sorry, but something went terribly wrong when
starting or running this add-on.

Be sure to check the log above, line by line, for hints.

[cont-finish.d] 99-message.sh: exited 0.
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.`

@hendriksen-mark
Copy link
Member

hendriksen-mark commented Jul 20, 2024

you can use this version of portainer.
then go to home>primary>containers>diyhue>container status>logs.
you can also change the lines to a higher number so you can see the previous logs.
do not touch any other stuff because it can damage HA and diyhue.

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

4 participants