home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
72.67k stars 30.43k forks source link

XMPP component not working after upgrading to 0.87 #20860

Closed thundergreen closed 4 years ago

thundergreen commented 5 years ago

Home Assistant release with the issue:

0.87 **Last working Home Assistant release (if known):** 0.86.4 **Operating environment (Hass.io/Docker/Windows/etc.):** venv install **Component/platform:** https://www.home-assistant.io/components/notify.xmpp/ **Description of problem:** notify XMPP not longer working after upgrading from 0.86.4 to 0.87--> See Traceback attached **Problem-relevant `configuration.yaml` entries and (fill out even if it seems unimportant):** ```yaml notify: - name: thorsten platform: xmpp host: 192.168.1.100 port: 5222 sender: home-assistant@emevth.no-ip.biz password: xxxxxxxxxxxxxxxxxxxxxx recipient: thorsten@emevth.no-ip.biz tls: true ``` **Traceback (if applicable):** ``` 2019-02-08 10:41:01 ERROR (MainThread) [homeassistant.core] Error doing job: Exception in callback _SelectorSocketTransport._read_ready() Traceback (most recent call last): File "/usr/lib/python3.6/asyncio/events.py", line 145, in _run self._callback(*self._args) File "/usr/lib/python3.6/asyncio/selector_events.py", line 732, in _read_ready self._protocol.data_received(data) File "/home/hass/homeassistant/lib/python3.6/site-packages/slixmpp/xmlstream/xmlstream.py", line 406, in data_received self._spawn_event(xml) File "/home/hass/homeassistant/lib/python3.6/site-packages/slixmpp/xmlstream/xmlstream.py", line 970, in _spawn_event stanza = self._build_stanza(xml) File "/home/hass/homeassistant/lib/python3.6/site-packages/slixmpp/xmlstream/xmlstream.py", line 951, in _build_stanza stanza = stanza_type(self, xml) File "/home/hass/homeassistant/lib/python3.6/site-packages/slixmpp/xmlstream/stanzabase.py", line 1389, in __init__ ElementBase.__init__(self, xml, parent) File "/home/hass/homeassistant/lib/python3.6/site-packages/slixmpp/xmlstream/stanzabase.py", line 415, in __init__ if self.setup(xml): File "/home/hass/homeassistant/lib/python3.6/site-packages/slixmpp/stanza/stream_features.py", line 27, in setup self.values = self.values File "/home/hass/homeassistant/lib/python3.6/site-packages/slixmpp/xmlstream/stanzabase.py", line 614, in _set_stanza_values self[full_interface] = value File "/home/hass/homeassistant/lib/python3.6/site-packages/slixmpp/xmlstream/stanzabase.py", line 752, in __setitem__ lang=lang) File "/home/hass/homeassistant/lib/python3.6/site-packages/slixmpp/xmlstream/stanzabase.py", line 958, in _set_sub_text return self._del_sub(name, lang=lang) File "/home/hass/homeassistant/lib/python3.6/site-packages/slixmpp/xmlstream/stanzabase.py", line 1039, in _del_sub parent = self.xml.find(parent_path) File "/usr/lib/python3.6/xml/etree/ElementTree.py", line 298, in find return ElementPath.find(self, path, namespaces) File "/usr/lib/python3.6/xml/etree/ElementPath.py", line 298, in find return next(iterfind(elem, path, namespaces), None) TypeError: 'NoneType' object is not an iterator ``` **Additional information:**
meisterlampe commented 5 years ago

@Human Have you already tried to derive a minimal configuration that causes the bug?

thundergreen commented 5 years ago

Back to this issue... Thats ODDDD!!! For me everything worked perfectly till upgrading to 0.99.x

TypeError: 'NoneType' object is not an iterator

You can't imagine how muc i hate this error message :P

Why it is not able to narrow tdown this issue and just fix it? :P

ok.. jokes bisides .. Would be nice if someone would seriously take car of it if not Home assistant will loose this component.And the fact that maybe not that much users use this component doesn't mean it is not that important for them.

So please: could someone seriously throw an eye on this issue please?

Human commented 5 years ago

@meisterlampe Unfortunately, no. I have seen no side effects of implementing the workaround, though.

meisterlampe commented 4 years ago

For me, in 101.3 sending XMPP messages still works with fix. But I do believe that messages get lost every now and then.

thundergreen commented 4 years ago

Hello... All of sudden xmpp started working again. Dunno the reason but i am happy about it anyway :) i am on latest dev version and can confirm it works again.

meisterlampe commented 4 years ago

Good news. Will try the upcoming 102 release without the fix/workaround in the next days

mrwsl commented 4 years ago

I updated to 102 but still got no success with xmpp messages. I tried plain text as well as messages with picture upload.

Traceback (most recent call last):
  File "/usr/lib/python3.7/asyncio/selector_events.py", line 813, in _read_ready__data_received
    self._protocol.data_received(data)
  File "/srv/homeassistant/lib/python3.7/site-packages/slixmpp/xmlstream/xmlstream.py", line 406, in data_received
    self._spawn_event(xml)
  File "/srv/homeassistant/lib/python3.7/site-packages/slixmpp/xmlstream/xmlstream.py", line 970, in _spawn_event
    stanza = self._build_stanza(xml)
  File "/srv/homeassistant/lib/python3.7/site-packages/slixmpp/xmlstream/xmlstream.py", line 951, in _build_stanza
    stanza = stanza_type(self, xml)
  File "/srv/homeassistant/lib/python3.7/site-packages/slixmpp/xmlstream/stanzabase.py", line 1390, in __init__
    ElementBase.__init__(self, xml, parent)
  File "/srv/homeassistant/lib/python3.7/site-packages/slixmpp/xmlstream/stanzabase.py", line 416, in __init__
    if self.setup(xml):
  File "/srv/homeassistant/lib/python3.7/site-packages/slixmpp/stanza/stream_features.py", line 27, in setup
    self.values = self.values
  File "/srv/homeassistant/lib/python3.7/site-packages/slixmpp/xmlstream/stanzabase.py", line 615, in _set_stanza_values
    self[full_interface] = value
  File "/srv/homeassistant/lib/python3.7/site-packages/slixmpp/xmlstream/stanzabase.py", line 753, in __setitem__
    lang=lang)
  File "/srv/homeassistant/lib/python3.7/site-packages/slixmpp/xmlstream/stanzabase.py", line 959, in _set_sub_text
    return self._del_sub(name, lang=lang)
  File "/srv/homeassistant/lib/python3.7/site-packages/slixmpp/xmlstream/stanzabase.py", line 1040, in _del_sub
    parent = self.xml.find(parent_path)
  File "/usr/lib/python3.7/xml/etree/ElementTree.py", line 299, in find
    return ElementPath.find(self, path, namespaces)
  File "/usr/lib/python3.7/xml/etree/ElementPath.py", line 307, in find
    return next(iterfind(elem, path, namespaces), None)
TypeError: 'NoneType' object is not an iterator
thundergreen commented 4 years ago

I dunno why this always appears.... for me almost each upgrade of homeassistant will break the component. Then.. all of sudden and after multiple restarts and longer times of running home assistant it works again. But i fear that some messages won't be sent from time to time. I am missing some messages.. Unfortunately nothing moves here in this threat and also on xmpp dev site nothing moves really forward. IT's a bit a pity as i thought home assistant i privacy orientated and i refuse using whatsapp telegram and co for my sensitive data sent by a notifier.

Would be really awesome not only to library issue threats but also get in contact with them and try solving this issue together.

mariohock commented 4 years ago

Here is a potential workaround:

I implemented a proof-of-concept app for Home-Assistant's AppDaemon that allows bidirectional XMPP communications. It can also work as a replacement for the notify/jabber service of Home-Assistant discussed above.

https://github.com/mariohock/Chatty

Advantages:

[Potential] Disadvantages:

meisterlampe commented 4 years ago

Very cool and thanks for sharing. Will test it in the next week. I guess we have to use such a solution. The built-in XMPP component is now broken for a whole year and we still don't know, what the root cause of the errors is.. :-D

thundergreen commented 4 years ago

Don't get this wrong .I use home Assistant XMPP component but started out of custom_component ..I pulled latest files from home Assistant repo and put it in XMPP folder inside custom_component

meisterlampe notifications@github.com schrieb am Fr., 31. Jan. 2020, 12:05:

Very cool and thanks for sharing. Will test it in the next week. I guess we have to use such a solution. The built-in XMPP component is now broken for a whole year and we still don't now, what the root cause of the errors is.. :-D

ā€” You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/home-assistant/home-assistant/issues/20860?email_source=notifications&email_token=ADFUA77A4EQ3VEIFVO3VSETRAQAXJA5CNFSM4GV2XJH2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKOKBRQ#issuecomment-580690118, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADFUA75JMUEIMORHK5BZP7LRAQAXJANCNFSM4GV2XJHQ .

meisterlampe commented 4 years ago

Now I saw your post about the custom component in the other issue ( https://github.com/home-assistant/home-assistant/issues/28611 ). Thanks for the info.

I guess I will also test the approach by @mariohock this week. I find the bi-directional communication feature interesting.

meisterlampe commented 4 years ago

@mariohock Setting up appdaemon in a docker container on my pi was really a pain. Anyway chatty itself was up and running within no time and I really like the simplicity of the code as well as that it is easy to extend. Again: Thanks for sharing!

StephenWetzel commented 4 years ago

I just upgraded to 0.103 from 0.98 and started getting this error. The work around above worked for me.

https://github.com/home-assistant/home-assistant/issues/20860#issuecomment-462454805

meisterlampe commented 4 years ago

@thundergreen Just tested your custom_component approach and it is working without any problems. The same code starts working, when beeing used in a custom component ...really weird and I guess @mariohock's race condition assumption could be correct.

thundergreen commented 4 years ago

I confirm I just enabled custom component again and it's working perfectly. We should make this. Public

thundergreen commented 4 years ago

@meisterlampe unfortunately it did not work for me ... do u use custom slixmpp out of the issue here or the original sixmpp?

thundergreen commented 4 years ago

@thundergreen Just tested your custom_component approach and it is working without any problems. The same code starts working, when beeing used in a custom component ...really weird and I guess @mariohock's race condition assumption could be correct.

Do u use the https://github.com/marconfus/slixmpp/archive/master.zip#slixmpp==1.4.2.1 or the slixmpp 1.4.2 standard?

meisterlampe commented 4 years ago

I'm using the original slixmpp from home assistant. I just copied the files to custom_components/xmpp and it seems to work. But I haven't tested it a lot. So for you it stopped working after while?

thundergreen commented 4 years ago

es directly after restarting hass it stopped working again.ill upgrade to latest beta to see if it then works again ..for 5he moment I 8se the custom slixmpp library in this post

airdrummingfool commented 4 years ago

slixmpp has been updated recently (now at 1.5.1), and now includes a fix that should take care of this problem.

stale[bot] commented 4 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment šŸ‘ This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.