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

2.1.6 AttributeError: 'Nodes' object has no attribute 'status_events' #283

Closed
jimboca opened this issue Jul 25, 2022 · 12 comments · Fixed by #327
Closed

2.1.6 AttributeError: 'Nodes' object has no attribute 'status_events' #283

jimboca opened this issue Jul 25, 2022 · 12 comments · Fixed by #327

Comments

@jimboca
Copy link
Collaborator

jimboca commented Jul 25, 2022

Not sure what is causing this, it runs find on my home Polisy, but not on my vacation home polisy.

2022-07-24 17:43:28,764 ConnectISY ISYHueEmu          DEBUG    ISYHueEmu:connect: ISY connect try 1
2022-07-24 17:43:28,767 ConnectISY pyisy              INFO     connection:request: ISY Request: http://polisy.lan:8080/rest/ping
2022-07-24 17:43:28,832 ConnectISY pyisy              DEBUG    connection:request: ISY Response Received
2022-07-24 17:43:28,834 ConnectISY pyisy              INFO     connection:request: ISY Request: http://polisy.lan:8080/rest/config
2022-07-24 17:43:28,891 ConnectISY pyisy              DEBUG    connection:request: ISY Response Received
2022-07-24 17:43:28,900 MQTT       udi_interface.interface INFO     interface:_message: Successfully set controller :: GV0 to 1 UOM 2
2022-07-24 17:43:29,089 ConnectISY pyisy              INFO     configuration:parse: ISY Loaded Configuration
2022-07-24 17:43:29,090 ConnectISY pyisy              INFO     connection:request: ISY Request: http://polisy.lan:8080/rest/time
2022-07-24 17:43:29,147 ConnectISY pyisy              DEBUG    connection:request: ISY Response Received
2022-07-24 17:43:29,153 ConnectISY pyisy              INFO     clock:parse: ISY Loaded Clock Information
2022-07-24 17:43:29,154 ConnectISY pyisy              INFO     connection:request: ISY Request: http://polisy.lan:8080/rest/nodes?members=false
2022-07-24 17:43:29,279 ConnectISY pyisy              DEBUG    connection:request: ISY Response Received
2022-07-24 17:43:30,271 ConnectISY pyisy              DEBUG    __init__:parse: ISY Loaded folder
2022-07-24 17:43:30,876 ConnectISY pyisy              DEBUG    __init__:parse: ISY Loaded node
2022-07-24 17:43:30,944 ConnectISY pyisy              DEBUG    __init__:parse: Skipping root group flag=12 00:0d:b9:4e:37:ec
2022-07-24 17:43:31,076 ConnectISY ISYHueEmu          ERROR    ISYHueEmu:connect: An exception of type AttributeError occured. Arguments:
("'Nodes' object has no attribute 'status_events'",)
Traceback (most recent call last):
  File "/var/polyglot/pg3/ns/00:0d:b9:4e:37:ec_4/ISYHueEmu.py", line 55, in connect
    self.isy = pyisy.ISY(self.isy_host, self.isy_port, self.isy_user, self.isy_password, False, 1.1, "")
  File "/var/polyglot/.local/lib/python3.9/site-packages/pyisy/isy.py", line 95, in __init__
    self.nodes = Nodes(self, xml=self.conn.get_nodes())
  File "/var/polyglot/.local/lib/python3.9/site-packages/pyisy/nodes/__init__.py", line 103, in __init__
    self.parse(xml)
  File "/var/polyglot/.local/lib/python3.9/site-packages/pyisy/nodes/__init__.py", line 371, in parse
    Group(
  File "/var/polyglot/.local/lib/python3.9/site-packages/pyisy/nodes/group.py", line 43, in __init__
    self._members_handlers = [
  File "/var/polyglot/.local/lib/python3.9/site-packages/pyisy/nodes/group.py", line 44, in <listcomp>
    self._nodes[m].status_events.subscribe(self.update) for m in self.members
AttributeError: 'Nodes' object has no attribute 'status_events'
@jimboca
Copy link
Collaborator Author

jimboca commented Sep 7, 2022

@shbatm Any clue what would cause this?

@shbatm
Copy link
Collaborator

shbatm commented Sep 7, 2022

I don't know what could be causing that. I know I've seen it mentioned before--here's the only reference I could find, but never dug for a solution.

Here's the other reference I remember, same user, never responded: https://forum.universal-devices.com/topic/34978-ha-error-adding-isy994/

Will take a look.

@shbatm
Copy link
Collaborator

shbatm commented Sep 26, 2022

@jimboca See #297: was the Polisy still booting when you saw this issue?

@jimboca
Copy link
Collaborator Author

jimboca commented Sep 26, 2022

I'm pretty sure it was not, but I will confirm.

@jimboca
Copy link
Collaborator Author

jimboca commented Sep 26, 2022

I just restart the node server and ISY on Polisy has been running for a long time and it died with the same error.

@shbatm
Copy link
Collaborator

shbatm commented Sep 27, 2022

Would you mind emailing me a copy of the xml from /rest/nodes and /rest/status? I'll try and load it on my mock isy and see if I can find out what's going on. (support at shbatm dot com)

@shbatm
Copy link
Collaborator

shbatm commented Sep 27, 2022

Thanks for the files. I found the problem, I'm just not sure how you managed it: you have a Folder included as a link in a Scene--as far as I was aware that was impossible. Is that a new feature? I saw the ability to add Z-Wave Nodes to Scenes, but I'm still on 5.3.4 and didn't see anything about linking folders like that.

The Water Valve Main and Housekeeper Lake scenes have member links to address 51033 which corresponds to the Site Scenes folder address.

PyISY processes Folders first, then Nodes, then Groups, so it can reference everything properly--it doesn't know how to handle a Folder as a group member.

@jimboca
Copy link
Collaborator Author

jimboca commented Sep 28, 2022

Thank you very much for figuring this out! I tried to review the code and my devices and couldn't see the issue. I have submitted a bug report to UDI and will see what they say. My guess is that it's a bug in current version where I deleted a device from the ISY that was in the scene and somehow the link was changed to the folder that contained the deleted device. I've recreated those scenes and PyISY is happy now.
But, given that this could happen, probably good to add a trap to give users a hint about the issue in the future?

@shbatm
Copy link
Collaborator

shbatm commented Sep 28, 2022

I had to add some debug log calls to figure out which group it was choking on and then go back and forth to the XML file. I'll add the calls to the next version which will at least help narrow down a problem node/group.

@shbatm
Copy link
Collaborator

shbatm commented Sep 28, 2022

My guess is that it's a bug in current version where I deleted a device from the ISY that was in the scene and somehow the link was changed to the folder that contained the deleted device.

That's along the lines of what I was thinking. I don't know the order which you created everything, but it looked like the address got reused.

@JavierRefuerzo
Copy link

@jimboca , I looked at your ticket but the image does not show anything out of the ordinary. Can you please send me a copy of the same XML sent to shbatm?

I don't believe node ID's are validated by ISY due to older firmware constraints. So, if a client (i.e. UD Mobile, AC, ect.) specified the Folder Address as a node it may be accepted. I don't think UD Mobile would do this as the types are different, but it could be another client which creates scenes.

There is an old firmware bug which which allowed both scenes and folders to have the same address, this is rare due to randomization, but will persist through backups until folder and/or scene is deleted. This is the only reference I could find resembling this situation, but does not appear the likely culprit.

@jimboca
Copy link
Collaborator Author

jimboca commented Sep 28, 2022

Thanks @JavierRefuerzo I meant to include the xml as well but must have missed it.

shbatm added a commit that referenced this issue Dec 20, 2022
@shbatm shbatm linked a pull request Dec 20, 2022 that will close this issue
@shbatm shbatm closed this as completed Dec 20, 2022
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.

3 participants