Core: XMPP component not working after upgrading to 0.87

Created on 8 Feb 2019  ·  72Comments  ·  Source: home-assistant/core

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):

notify:
  - name: thorsten
    platform: xmpp 
    host: 192.168.1.100
    port: 5222
    sender: [email protected] 
    password: xxxxxxxxxxxxxxxxxxxxxx
    recipient: [email protected]
    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:

xmpp stale

Most helpful comment

All 72 comments

same here with raspbian strech

My component (also based on slixmpp) fails with the same error since 0.87.
It only happens in my "fully configured" HA instance. In the stripped down dev instance it still works fine.
The error is not always there. After a couple of restarts it starts to work again.

@marconfus May I ask which component you use? Do you have a custom component?

Yes, it's a custom climate device for Bosch thermostats which isn't in the official codebase yet.
https://github.com/marconfus/ha-nefit-ng

It uses the same XMPP library and shows the same error. To validate this I also installed the XMPP notify component. Unfortunately I am not able to reproduce it in my dev environment and haven't found a good way to debug my prod env which is in a Hass.io installation.

Are you able to reproduce the error in a more or less empty/base venv installation of HA?

I dunno what they changed but it seems group chats don't work but direct messages do.. For example I got my xiaomi map sent but not all my notifications about lights etc... the only backtrace I have is the part I posted

Hm, the functions in the stacktrace get the exact same parameters in case it works and when it fails. Also when it works, it works all the time and when it fails it fails all the time until you restart the python process...
As the error only triggers when certain(?) other components are loaded, I guess it's some kind of internal error/racecondition in async Python or elsewhere. But I have absolutely no idea how to debug this...

I figured out that one to one works bit group chat fails

So, I modified slixmpp to use lxml instead of xml.
In stanzabase.py and xmlstream.py replace
from xml.etree import cElementTree as ET
with
from lxml import etree as ET
and added a try/catch block to stanzabase.py around the line from the stacktrace.

            try:
                parent = self.xml.find(parent_path)
            except:
                parent = None

This seems to works all the time.... (just adding the try/catch block without switching to lxml leads to other errors)

I've opened a bug report at slixmpp:
https://lab.louiz.org/poezio/slixmpp/issues/3429

I guess xmpp will be fixed in version 0.89 ?

do we have some news here ? I only get pictures sent to my xmpp client.

I don't think there is anybod working on this. I guess it's because the bug only affects a couple of users. You could try to find the combination of active components that are necessary to trigger the bug. I.e. do you see the bug in an HA installation with only the xmpp component installed? And then add your other components until the bug triggers...
I have a workaround for my component and not enough time to dig deeper. Sorry.

Could you share your workaround lease and i will add it :) would be nice ..

thanks mate

@marconfus works like a charm. I also forked your repo now :)

I get a similar error. It could be related, but I'm not sure. I'll try @marconfus workaround in the next days.
For me it occurs all the time, so it could also be a configuration problem on my side. Anyway the trace looks related.

Just started testing HA two weeks ago, so my installation is not that complex to mind. Maybe it helps, when I list it here:

  • HA 0.88.2 (started with 0.87)
  • Hassio/Docker install on a raspberry pi running raspbian
  • Addons: Zigbee2Mqtt, Mosquitto MQTT broker, Check Home Assistant configuration
  • Currently only two Xiaomi temperature sensors connected for testing purposes

My configuration contains:

notify:
  - name: jabber
    platform: xmpp
    sender: [email protected]
    password: SECRET
    recipient: [email protected]

The error I get is:

2019-02-23 21:42:36 ERROR (MainThread) [homeassistant.core] Error doing job: Fatal error on transport TCPTransport
Traceback (most recent call last):
  File "uvloop/handles/stream.pyx", line 827, in uvloop.loop.__uv_stream_on_read_impl
  File "/usr/local/lib/python3.7/site-packages/slixmpp/xmlstream/xmlstream.py", line 406, in data_received
self._spawn_event(xml)
  File "/usr/local/lib/python3.7/site-packages/slixmpp/xmlstream/xmlstream.py", line 970, in _spawn_event
stanza = self._build_stanza(xml)
  File "/usr/local/lib/python3.7/site-packages/slixmpp/xmlstream/xmlstream.py", line 951, in _build_stanza
stanza = stanza_type(self, xml)
  File "/usr/local/lib/python3.7/site-packages/slixmpp/xmlstream/stanzabase.py", line 1390, in __init__
ElementBase.__init__(self, xml, parent)
  File "/usr/local/lib/python3.7/site-packages/slixmpp/xmlstream/stanzabase.py", line 416, in __init__
if self.setup(xml):
  File "/usr/local/lib/python3.7/site-packages/slixmpp/stanza/stream_features.py", line 27, in setup
self.values = self.values
  File "/usr/local/lib/python3.7/site-packages/slixmpp/xmlstream/stanzabase.py", line 615, in _set_stanza_values
self[full_interface] = value
  File "/usr/local/lib/python3.7/site-packages/slixmpp/xmlstream/stanzabase.py", line 753, in __setitem__
lang=lang)
  File "/usr/local/lib/python3.7/site-packages/slixmpp/xmlstream/stanzabase.py", line 959, in _set_sub_text
return self._del_sub(name, lang=lang)
  File "/usr/local/lib/python3.7/site-packages/slixmpp/xmlstream/stanzabase.py", line 1040, in _del_sub
parent = self.xml.find(parent_path)
  File "/usr/local/lib/python3.7/xml/etree/ElementTree.py", line 299, in find
return ElementPath.find(self, path, namespaces)
  File "/usr/local/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

Just tried the workaround and HA is finally sending messages. Thanks a lot 👍

To test the workaround, I modified the source files in the homeassistant docker instance of my hassio install. Which works like a charm.
But: That changes are lost, if I restart HA.
When using normal docker images, I would use a custom dockerfile and make my modifications there. But the image is managed by the hassio supervisor which I don't know a lot about.

Do you have any ideas how to make changes like applying this workaround persistent on a hassio install?

You could copy the original component and install it as a custom_component. The documentation says, that that is supported:
https://developers.home-assistant.io/docs/en/creating_component_loading.html

Of course that is a terrible hack and it would be better to find the real cause of the problem...

Thanks for the fast answer. I will try this.
I hope the real cause can be found soon :-)

Adding my name to this issue. Testing use of slixmpp for Harmony component and getting same error.

I get new issue when trying to send a local file:

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 976, in _read_ready
    self._protocol.data_received(data)
  File "/home/hass/homeassistant/lib/python3.6/site-packages/slixmpp/xmlstream/xmlstream.py", line 407, in data_received
    self._spawn_event(xml)
  File "/home/hass/homeassistant/lib/python3.6/site-packages/slixmpp/xmlstream/xmlstream.py", line 971, in _spawn_event
    stanza = self._build_stanza(xml)
  File "/home/hass/homeassistant/lib/python3.6/site-packages/slixmpp/xmlstream/xmlstream.py", line 952, in _build_stanza
    stanza = stanza_type(self, xml)
  File "/home/hass/homeassistant/lib/python3.6/site-packages/slixmpp/stanza/iq.py", line 70, in __init__
    StanzaBase.__init__(self, *args, **kwargs)
  File "/home/hass/homeassistant/lib/python3.6/site-packages/slixmpp/xmlstream/stanzabase.py", line 1394, in __init__
    ElementBase.__init__(self, xml, parent)
  File "/home/hass/homeassistant/lib/python3.6/site-packages/slixmpp/xmlstream/stanzabase.py", line 427, in __init__
    reuse=False)
  File "/home/hass/homeassistant/lib/python3.6/site-packages/slixmpp/xmlstream/stanzabase.py", line 508, in init_plugin
    plugin = plugin_class(parent=self, xml=existing_xml)
  File "/home/hass/homeassistant/lib/python3.6/site-packages/slixmpp/xmlstream/stanzabase.py", line 427, in __init__
    reuse=False)
  File "/home/hass/homeassistant/lib/python3.6/site-packages/slixmpp/xmlstream/stanzabase.py", line 508, in init_plugin
    plugin = plugin_class(parent=self, xml=existing_xml)
  File "/home/hass/homeassistant/lib/python3.6/site-packages/slixmpp/plugins/xep_0004/stanza/form.py", line 35, in __init__
    ElementBase.__init__(self, *args, **kwargs)
  File "/home/hass/homeassistant/lib/python3.6/site-packages/slixmpp/xmlstream/stanzabase.py", line 427, in __init__
    reuse=False)
  File "/home/hass/homeassistant/lib/python3.6/site-packages/slixmpp/xmlstream/stanzabase.py", line 520, in init_plugin
    self.init_plugin(plugin_class.plugin_multi_attrib)
  File "/home/hass/homeassistant/lib/python3.6/site-packages/slixmpp/xmlstream/stanzabase.py", line 508, in init_plugin
    plugin = plugin_class(parent=self, xml=existing_xml)
  File "/home/hass/homeassistant/lib/python3.6/site-packages/slixmpp/xmlstream/stanzabase.py", line 417, in __init__
    if self.setup(xml):
  File "/home/hass/homeassistant/lib/python3.6/site-packages/slixmpp/xmlstream/stanzabase.py", line 112, in setup
    self.xml = ET.Element('')
  File "src/lxml/etree.pyx", line 2998, in lxml.etree.Element
  File "src/lxml/apihelpers.pxi", line 95, in lxml.etree._makeElement
  File "src/lxml/apihelpers.pxi", line 1549, in lxml.etree._getNsTag
  File "src/lxml/apihelpers.pxi", line 1584, in lxml.etree.__getNsTag
ValueError: Empty tag name

my script:

  3_send_jabber_message_with_local_image_path:
    alias: "Send Image via Jabber from local file"
    sequence:
      - service: notify.thorsten
        data:
          title: ""
          message: ""
          data:
            path: "/home/hass/.homeassistant/cam_snap_shots/front-door/record.mp4"

I am using this custom slix:

https://github.com/marconfus/slixmpp/archive/master.zip#slixmpp==1.4.2.1

Any chance of reverting the slixmpp version used by hass to the one used in 0.86.4?

@Human Would be the best I think. But you can temporairly use the "dirty" workaround described above. It works but like mentioned: httpupload won't work

I asked in slixmpp channel for this issue and apparently we use wrong XML library

Yes, in my "dirty fix" I changed the XML parser to lxml. Apparently this leeds to other errors in your scenario.

I just updated to Python 3.7.3 and issue is still present. :-( Was hoping maybe a fix through there. .

If I use my library (aioharmony) outside of Home Assistant I have no issues. If I use it within HA then I get the error.

Any chance of reverting the slixmpp version used by hass to the one used in 0.86.4?

slixmpp in 0.86.4 was 1.4.1. For my component (aioharmony) that I'm trying to get to work with XMPP I have tried both 1.4.1 and 1.4.2 in HA; both fail.
No issues outside of HA.

I am sure it is not just slixmpp version related but something global in hass. I'd like seeing a dev for this component giving a feedback here.. unfortunately the xmpp platform is underestimated and not used that often like other platforms. But I think it should be maintained like every platform

Been adding a bunch of debug info to my local copy of slixmpp but so far haven't found anything. From what I can tell it is all going and working the same.
But, I'm far from an expert when it comes to XMPP and the XML objects.

I've also been going through the release notes from 0.87 (as 0.86.4 was working and 0.87 not based on 1st posts here) but haven't been able to find anything or anything standing out that could be the explanation for it breaking.

@ehendrix23 Are you able to do a git bisect to narrow down the commit that introduced the bug?

I could .... if I knew how. :-)

@ehendrix23 Does this help? https://git-scm.com/docs/git-bisect

If I'm reading the tags right, you'd want to _start_ the bisect at the commit for tag for 0.87 ( c366fa00d8f63c4ebe8398280ed342bd4903f7c0 ) and mark it as bad then mark the commit for tag 0.86.4 ( aa29eeba04a68234a46c298fabef88d3635922f5 ) as good. Then the bisect process will cut the commits between the two in half, letting you test each one and mark the result as good or bad. After a few iterations, it'll tell you which commit specifically introduced the bug.

Just to confirm that i have the same issue (object is not an iterator), that i do prefer XMPP over other notification services, and I'm waiting for it to be resolved :). I am no programmer unfortunately so may not be of any help other than providing my logs if required.

Same issue here, not sure how the workaround works, but xmpp is the only way to send proper notifications. Please fix.

Strangely after upgrading today to --pre homeassistant 0.94.0 XMPP works like a charm... maybe a try it's worth @Glotzon

Can't confirm that homeassistant 0.94 works. The problem remains for me. I still have to use a custom component with the slixmpp package of @marconfus

Can't confirm either (Whenever I use xmpp notify I also use httpupload):

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

Thats' weird and strange.. I had similar problem with this XMPP and after just upgrading to 0.94 it was fixed. I know nothing was changed in XMPP component.. I am confused :P

Problem continues on 0.94.0

TypeError: 'NoneType' object is not an iterator

Also confirm that not resolved in 0.94. NoneType' object is not an iterator

I also get the same error after updating to 0.94.

Same here on 0.94.3.

Same stack-trace for me in 0.94.3

Still the same bug in 0.94.4

In 0.95.4, the line numbers have changed, but it's still the same error:

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 721, in _read_ready
    self._protocol.data_received(data)
  File "/home/igo/.homeassistant/deps/lib/python3.6/site-packages/slixmpp/xmlstream/xmlstream.py", line 406, in data_received
    self._spawn_event(xml)
  File "/home/igo/.homeassistant/deps/lib/python3.6/site-packages/slixmpp/xmlstream/xmlstream.py", line 970, in _spawn_event
    stanza = self._build_stanza(xml)
  File "/home/igo/.homeassistant/deps/lib/python3.6/site-packages/slixmpp/xmlstream/xmlstream.py", line 951, in _build_stanza
    stanza = stanza_type(self, xml)
  File "/home/igo/.homeassistant/deps/lib/python3.6/site-packages/slixmpp/xmlstream/stanzabase.py", line 1390, in __init__
    ElementBase.__init__(self, xml, parent)
  File "/home/igo/.homeassistant/deps/lib/python3.6/site-packages/slixmpp/xmlstream/stanzabase.py", line 416, in __init__
    if self.setup(xml):
  File "/home/igo/.homeassistant/deps/lib/python3.6/site-packages/slixmpp/stanza/stream_features.py", line 27, in setup
    self.values = self.values
  File "/home/igo/.homeassistant/deps/lib/python3.6/site-packages/slixmpp/xmlstream/stanzabase.py", line 615, in _set_stanza_values
    self[full_interface] = value
  File "/home/igo/.homeassistant/deps/lib/python3.6/site-packages/slixmpp/xmlstream/stanzabase.py", line 753, in __setitem__
    lang=lang)
  File "/home/igo/.homeassistant/deps/lib/python3.6/site-packages/slixmpp/xmlstream/stanzabase.py", line 959, in _set_sub_text
    return self._del_sub(name, lang=lang)
  File "/home/igo/.homeassistant/deps/lib/python3.6/site-packages/slixmpp/xmlstream/stanzabase.py", line 1040, 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

@fabaff Hi! I and others have implemented these small changes described here to get XMPP working again in HASS. As the XMPP maintainer, if this were turned into a PR, would you accept the change?

I'm using Hassos. Where can I find the stanzabase.py and xmlstream.py files?

@fabaff Hi! I and others have implemented these small changes described here to get XMPP working again in HASS. As the XMPP maintainer, if this were turned into a PR, would you accept the change?

The dirty hack of mine you referenced is not in the homeassistant code, so it cannot be fixed here. It's the most obscure python problem I have ever seen and unfortunately nobody has an idea how to fix it. As long as I know, nobody is even able to reproduce it 100% (i.e. create a demo ha config that triggers the bug).
If, at all, a workaround could be added to the slixmpp library -> https://github.com/poezio/slixmpp/pull/17
But this seems to lead to other errors.

@marconfus Well, it _could_ be fixed by forking slixmpp and making HASS use the fork instead of the mainline version.

Before I applied your workaround, I had 100% XMPP failure. If I get some time, I could derive a minimal example HASS configuration that causes the bug.

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

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?

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

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

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.

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

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

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.

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:

  • Works with unpatched slixmpp library (at least for me..?)
  • Allows bidirectional communications. Chat with your home automation!
  • Faster message delivery, since it establishes a permanent connection to the XMPP server, instead of logging in and out for every single message
  • Works as drop-in replacement for the original notify/jabber service for AppDaemon apps
  • Simple: below 100 lines of code

[Potential] Disadvantages:

  • Needs AppDaemon (version 4!) (no issue, if you use it anyway)
  • Only proof-of-concept implementation, lacks some features from the original notify/jabber service
  • Cannot be called as a service from Home-Assistant (only from within AppDaemon), but from Home-Assistant can be called by a custom event

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

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
.

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.

@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!

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

@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.

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

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

@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?

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?

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

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

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sh0rez picture sh0rez  ·  3Comments

moskovskiy82 picture moskovskiy82  ·  3Comments

sogeniusio picture sogeniusio  ·  3Comments

Elmardus picture Elmardus  ·  3Comments

bdraco picture bdraco  ·  3Comments