TypeError: can only concatenate str (not "NoneType") to str when receving bare jid presence from localpart@component.domain.tld
This looks like #10273 (closed) but is actually a bit different.
Traceback (most recent call last):
File "/app/lib/python3.8/site-packages/gajim/common/ged.py", line 101, in raise_event
if handler(*args, **kwargs):
File "/app/lib/python3.8/site-packages/gajim/roster_window.py", line 2381, in _nec_presence_received
self.chg_contact_status(obj.contact, obj.show, obj.status, account)
File "/app/lib/python3.8/site-packages/gajim/roster_window.py", line 2056, in chg_contact_status
name += '/' + contact.resource
Versions
- OS: debian buster
- Gajim version: 1.4.0-dev1 (flatpak devel) (also tested with Gajim 1.3.0 flatpak)
- GTK version: 3.24.25
- Python-nbxmpp version: 3.0.0-dev1
Steps to reproduce the problem
It only happens with a gateway component I am developing. Maybe the component's behavior is incorrect but still, I guess Gajim should not end up in this state.
EDIT: I think the relevant XML part is here:
<!-- Incoming mar. 23 févr. 2021 17:30:44 (nicoco@localhost) -->
<presence xmlns="jabber:client" id="a81f95450642490fa059d30cf8590aec" to="nicoco@localhost" from="buddy1@dummy.localhost/dummy_resource">
<x xmlns="vcard-temp:x:update" />
<c hash="sha-1" xmlns="http://jabber.org/protocol/caps" node="http://slixmpp.com/ver/1.7.0" ver="MDCjBdE1N+1UdfBl6JSZm1Jc9vg=" />
</presence>
<!-- Incoming mar. 23 févr. 2021 17:30:44 (nicoco@localhost) -->
<presence xmlns="jabber:client" id="3f157c4b675a4017a69275f21db7c5f5" to="nicoco@localhost" from="buddy1@dummy.localhost">
<x xmlns="vcard-temp:x:update" />
</presence>
Here's the full XML Console output. It is very messy and I am obviously trying to clean this up, but I thought it might help improve gajim anyway.
<!-- Outgoing mar. 23 févr. 2021 16:26:38 (nicoco@localhost) -->
<iq xmlns="jabber:client" to="dummy.localhost" type="get" id="984cc42c-0a3d-4c9e-aa10-3be389925a0c">
<query xmlns="jabber:iq:register" />
</iq>
<!-- Incoming mar. 23 févr. 2021 16:26:38 (nicoco@localhost) -->
<iq xmlns="jabber:client" id="984cc42c-0a3d-4c9e-aa10-3be389925a0c" type="result" to="nicoco@localhost/gajim.OVBCFW99" from="dummy.localhost">
<query xmlns="jabber:iq:register">
<instructions>Enter your legacy credentials</instructions>
<password />
<username />
</query>
</iq>
<!-- Outgoing mar. 23 févr. 2021 16:26:41 (nicoco@localhost) -->
<iq xmlns="jabber:client" to="dummy.localhost" type="set" id="e28f14bd-063c-413e-9545-74f9e9e1ec77">
<query xmlns="jabber:iq:register">
<password>sdfsdf</password>
<username>asdfsdaf</username>
</query>
</iq>
<!-- Incoming mar. 23 févr. 2021 16:26:41 (nicoco@localhost) -->
<iq xmlns="jabber:client" id="e28f14bd-063c-413e-9545-74f9e9e1ec77" type="result" to="nicoco@localhost/gajim.OVBCFW99" from="dummy.localhost" />
<!-- Incoming mar. 23 févr. 2021 16:26:41 (nicoco@localhost) -->
<presence xmlns="jabber:client" id="e69275a3973f4f87a3f288f01de5382f" type="subscribe" to="nicoco@localhost" from="dummy.localhost" />
<!-- Incoming mar. 23 févr. 2021 16:26:41 (nicoco@localhost) -->
<iq xmlns="jabber:client" id="NaX78cjc" type="set">
<query ver="4477" xmlns="jabber:iq:roster">
<item jid="buddy1@dummy.localhost" subscription="both">
<group>Dummy</group>
</item>
</query>
</iq>
<!-- Incoming mar. 23 févr. 2021 16:26:41 (nicoco@localhost) -->
<iq xmlns="jabber:client" id="Beag1LQw" type="set">
<query ver="4478" xmlns="jabber:iq:roster">
<item jid="buddy2@dummy.localhost" subscription="both">
<group>Dummy</group>
</item>
</query>
</iq>
<!-- Outgoing mar. 23 févr. 2021 16:26:41 (nicoco@localhost) -->
<iq xmlns="jabber:client" id="NaX78cjc" to="nicoco@localhost" type="result" />
<!-- Incoming mar. 23 févr. 2021 16:26:41 (nicoco@localhost) -->
<presence xmlns="jabber:client" id="ea2a143daae04054aff210a872304db0" type="unavailable" to="nicoco@localhost" from="dummy.localhost" />
<!-- Outgoing mar. 23 févr. 2021 16:26:41 (nicoco@localhost) -->
<iq xmlns="jabber:client" id="Beag1LQw" to="nicoco@localhost" type="result" />
<!-- Incoming mar. 23 févr. 2021 16:26:41 (nicoco@localhost) -->
<presence xmlns="jabber:client" id="6d76246603814ee89f0ee8a6cd2eff6c" type="unavailable" to="nicoco@localhost" from="buddy1@dummy.localhost/dummy_resource" />
<!-- Incoming mar. 23 févr. 2021 16:26:41 (nicoco@localhost) -->
<presence xmlns="jabber:client" id="eb12f40161c74878ad380c49d8d058f4" type="unavailable" to="nicoco@localhost" from="buddy2@dummy.localhost/dummy_resource" />
<!-- Incoming mar. 23 févr. 2021 16:26:41 (nicoco@localhost) -->
<presence xmlns="jabber:client" id="63ecf5e7ef794f93b29efb08c664fb39" type="unavailable" to="nicoco@localhost" from="dummy.localhost" />
<!-- Incoming mar. 23 févr. 2021 16:26:41 (nicoco@localhost) -->
<presence xmlns="jabber:client" id="56b94fd9a3be4ce5815f5122e3374992" to="nicoco@localhost" from="buddy1@dummy.localhost/dummy_resource">
<c hash="sha-1" xmlns="http://jabber.org/protocol/caps" node="http://slixmpp.com/ver/1.7.0" ver="MDCjBdE1N+1UdfBl6JSZm1Jc9vg=" />
<x xmlns="vcard-temp:x:update" />
</presence>
<!-- Incoming mar. 23 févr. 2021 16:26:41 (nicoco@localhost) -->
<presence xmlns="jabber:client" id="8550cb538791452ebb790c4d3ac95bfa" to="nicoco@localhost" from="buddy2@dummy.localhost/dummy_resource">
<c hash="sha-1" xmlns="http://jabber.org/protocol/caps" node="http://slixmpp.com/ver/1.7.0" ver="MDCjBdE1N+1UdfBl6JSZm1Jc9vg=" />
<x xmlns="vcard-temp:x:update" />
</presence>
<!-- Incoming mar. 23 févr. 2021 16:26:41 (nicoco@localhost) -->
<presence xmlns="jabber:client" id="ba6c38cbc52d487c80cbc58669681bac" to="nicoco@localhost" from="dummy.localhost">
<x xmlns="vcard-temp:x:update">
<photo />
</x>
</presence>
<!-- Incoming mar. 23 févr. 2021 16:26:41 (nicoco@localhost) -->
<presence xmlns="jabber:client" id="32b41ffb5374401fb320678d42f6765c" to="nicoco@localhost" from="buddy1@dummy.localhost">
<x xmlns="vcard-temp:x:update" />
</presence>
<!-- Incoming mar. 23 févr. 2021 16:26:41 (nicoco@localhost) -->
<presence xmlns="jabber:client" id="e338c8e0cc9a48bd963ea37440f82563" to="nicoco@localhost" from="buddy2@dummy.localhost">
<x xmlns="vcard-temp:x:update" />
</presence>
<!-- Outgoing mar. 23 févr. 2021 16:29:41 (nicoco@localhost) -->
<iq xmlns="jabber:client" to="localhost" type="get" id="32e34e0b-cc4f-4f2d-8b52-cf8ebbf9fd58">
<ping xmlns="urn:xmpp:ping" />
</iq>
<!-- Incoming mar. 23 févr. 2021 16:29:41 (nicoco@localhost) -->
<iq xmlns="jabber:client" id="32e34e0b-cc4f-4f2d-8b52-cf8ebbf9fd58" type="result" to="nicoco@localhost/gajim.OVBCFW99" from="localhost" />
<!-- Outgoing mar. 23 févr. 2021 16:32:41 (nicoco@localhost) -->
<iq xmlns="jabber:client" to="localhost" type="get" id="b8adbe05-e165-4e77-82e7-664ec3303fa6">
<ping xmlns="urn:xmpp:ping" />
</iq>
<!-- Incoming mar. 23 févr. 2021 16:32:41 (nicoco@localhost) -->
<iq xmlns="jabber:client" id="b8adbe05-e165-4e77-82e7-664ec3303fa6" type="result" to="nicoco@localhost/gajim.OVBCFW99" from="localhost" />
<!-- Incoming mar. 23 févr. 2021 16:33:58 (nicoco@localhost) -->
<iq xmlns="jabber:client" id="fa488ee5-ed5c-4372-b815-0b45770f87cd" type="error" to="nicoco@localhost/gajim.OVBCFW99" from="buddy1@dummy.localhost/dummy_resource">
<error type="cancel" xmlns="jabber:client" code="501">
<feature-not-implemented xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" />
<text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">No handlers registered for this request.</text>
</error>
</iq>
<!-- Outgoing mar. 23 févr. 2021 16:33:58 (nicoco@localhost) -->
<iq xmlns="jabber:client" to="buddy1@dummy.localhost/dummy_resource" type="get" id="fa488ee5-ed5c-4372-b815-0b45770f87cd">
<query xmlns="jabber:iq:version" />
</iq>
<!-- Outgoing mar. 23 févr. 2021 16:33:59 (nicoco@localhost) -->
<iq xmlns="jabber:client" to="buddy1@dummy.localhost/dummy_resource" type="get" id="115f6320-91d0-4941-bf1b-08dbaa5cbe82">
<time xmlns="urn:xmpp:time" />
</iq>
<!-- Incoming mar. 23 févr. 2021 16:33:59 (nicoco@localhost) -->
<iq xmlns="jabber:client" id="115f6320-91d0-4941-bf1b-08dbaa5cbe82" type="error" to="nicoco@localhost/gajim.OVBCFW99" from="buddy1@dummy.localhost/dummy_resource">
<error type="cancel" xmlns="jabber:client" code="501">
<feature-not-implemented xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" />
<text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">No handlers registered for this request.</text>
</error>
</iq>
<!-- Incoming mar. 23 févr. 2021 16:34:10 (nicoco@localhost) -->
<iq xmlns="jabber:client" id="6c0a0fc9-5e62-494d-8473-8122c0abb1e8" type="error" to="nicoco@localhost/gajim.OVBCFW99" from="buddy1@dummy.localhost/dummy_resource">
<error type="cancel" xmlns="jabber:client" code="501">
<feature-not-implemented xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" />
<text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">No handlers registered for this request.</text>
</error>
</iq>
<!-- Outgoing mar. 23 févr. 2021 16:34:10 (nicoco@localhost) -->
<iq xmlns="jabber:client" to="buddy1@dummy.localhost/dummy_resource" type="get" id="6c0a0fc9-5e62-494d-8473-8122c0abb1e8">
<query xmlns="jabber:iq:version" />
</iq>
<!-- Outgoing mar. 23 févr. 2021 16:34:10 (nicoco@localhost) -->
<iq xmlns="jabber:client" to="buddy1@dummy.localhost/dummy_resource" type="get" id="4d548b57-5f3e-428c-a987-d5e6d5f628b7">
<time xmlns="urn:xmpp:time" />
</iq>
<!-- Incoming mar. 23 févr. 2021 16:34:10 (nicoco@localhost) -->
<iq xmlns="jabber:client" id="4d548b57-5f3e-428c-a987-d5e6d5f628b7" type="error" to="nicoco@localhost/gajim.OVBCFW99" from="buddy1@dummy.localhost/dummy_resource">
<error type="cancel" xmlns="jabber:client" code="501">
<feature-not-implemented xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" />
<text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">No handlers registered for this request.</text>
</error>
</iq>
<!-- Outgoing mar. 23 févr. 2021 16:37:10 (nicoco@localhost) -->
<iq xmlns="jabber:client" to="localhost" type="get" id="71e6d970-2a95-4d04-b369-4f9cd1d61b84">
<ping xmlns="urn:xmpp:ping" />
</iq>
<!-- Incoming mar. 23 févr. 2021 16:37:10 (nicoco@localhost) -->
<iq xmlns="jabber:client" id="71e6d970-2a95-4d04-b369-4f9cd1d61b84" type="result" to="nicoco@localhost/gajim.OVBCFW99" from="localhost" />