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 integration could not send any notification to room after update #72192

Closed junaid755 closed 2 years ago

junaid755 commented 2 years ago

The problem

After updating to 2022.5 from 2022.3 my Home-Assistant docker is unable to sent a text XMPP notification to a "Room". But when it's configured without "room: " in configuration.yaml file it successfully sends notification to individual recipients. here's my configuration

notify:
  - name: xmpp.local  # e.g.,  jabber
    platform: xmpp
    sender: home-assistant@chat.local
    password: homeassistant
    recipient:
      - user@chat.local
    room: home-assistant@conference.chat.local

This above configuration worked perfectly in 2022.3 with no log errors but with 2022.5 it just doesn't send any room notification and after a few seconds I see this in logs:

homeassistant_temp    | 2022-05-19 22:25:10 ERROR (Recorder) [homeassistant] Error doing job: Task was destroyed but it is pending!
homeassistant_temp    | 2022-05-19 22:25:10 ERROR (Recorder) [homeassistant] Error doing job: Task was destroyed but it is pending!
homeassistant_temp    | 2022-05-19 22:25:10 ERROR (Recorder) [homeassistant] Error doing job: Task was destroyed but it is pending!

What version of Home Assistant Core has the issue?

2022.5

What was the last working version of Home Assistant Core?

2022.3

What type of installation are you running?

Home Assistant Container

Integration causing the issue

xmpp

Link to integration documentation on our website

https://www.home-assistant.io/integrations/xmpp/

Diagnostics information

No response

Example YAML snippet

notify:
  - name: xmpp.local  # e.g.,  jabber
    platform: xmpp
    sender: home-assistant@chat.local
    password: homeassistant
    recipient:
      - user@chat.local
    room: home-assistant@conference.chat.local

Anything in the logs that might be useful for us?

homeassistant_temp    | 2022-05-19 22:22:45 WARNING (MainThread) [slixmpp.stringprep] Using slower stringprep, consider compiling the faster cython/libidn one.
homeassistant_temp    | 2022-05-19 22:22:53 ERROR (SyncWorker_6) [homeassistant] Error doing job: Task was destroyed but it is pending!
homeassistant_temp    | 2022-05-19 22:25:10 ERROR (Recorder) [homeassistant] Error doing job: Task was destroyed but it is pending!
homeassistant_temp    | 2022-05-19 22:25:10 ERROR (Recorder) [homeassistant] Error doing job: Task was destroyed but it is pending!
homeassistant_temp    | 2022-05-19 22:25:10 ERROR (Recorder) [homeassistant] Error doing job: Task was destroyed but it is pending!
homeassistant_temp    | 2022-05-19 23:43:34 ERROR (MainThread) [homeassistant] Error doing job: Task was destroyed but it is pending!

Additional information

No response

probot-home-assistant[bot] commented 2 years ago

Hey there @fabaff, @flowolf, mind taking a look at this issue as it has been labeled with an integration (xmpp) you are listed as a code owner for? Thanks! (message by CodeOwnersMention)


xmpp documentation xmpp source (message by IssueLinks)

fabaff commented 2 years ago

slixmpp was updated a while back and shipped in 2022.4.2 but beside that there were no changes which touched the room handling.

Could you please increase the log level for xmpp? Maybe we get some more details.

junaid755 commented 2 years ago

after adding log-level to "notset" in configuration.yaml

logger:
  default: notset

This is what i found when sending the room message through an automation

2022-05-20 13:51:02 DEBUG (MainThread) [slixmpp.xmlstream.xmlstream] RECV: <message xml:lang="en" to="home-assistant@chat.local/home-assistant" from="home-assistant@conference.chat.local" type="error" id="974fc54d1715400a9308a4a746ab0ab3"><origin-id xmlns="urn:xmpp:sid:0" id="974fc54d1715400a9308a4a746ab0ab3" /><error type="modify"><not-acceptable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" /><text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" xml:lang="en">Only occupants are allowed to send messages to the conference</text></error><body>Home Assistant: this is a room message</body></message>

It said something about "not-acceptable xmln" and "Only occupants are allowed to send messages to the conference"

but the home-assistant xmpp account has access to the room with Owner/moderator privileges, so I am confused..?

below is the full log when it fails to send room notification

2022-05-20 13:51:02 DEBUG (MainThread) [slixmpp.xmlstream.xmlstream] Event triggered: session_bind
2022-05-20 13:51:02 INFO (MainThread) [slixmpp.features.feature_bind.bind] JID set to: home-assistant@chat.local/home-assistant
2022-05-20 13:51:02 DEBUG (MainThread) [slixmpp.xmlstream.xmlstream] Event triggered: session_start
2022-05-20 13:51:02 DEBUG (MainThread) [slixmpp.clientxmpp] Finished processing stream features.
2022-05-20 13:51:02 DEBUG (MainThread) [slixmpp.xmlstream.xmlstream] Event triggered: stream_negotiated
2022-05-20 13:51:02 DEBUG (MainThread) [homeassistant.components.xmpp.notify] Joining room home-assistant@conference.chat.local
2022-05-20 13:51:02 DEBUG (MainThread) [slixmpp.xmlstream.xmlstream] SEND: <message type="groupchat" to="home-assistant@conference.chat.local" id="974fc54d1715400a9308a4a746ab0ab3" xml:lang="en"><origin-id xmlns="urn:xmpp:sid:0" id="974fc54d1715400a9308a4a746ab0ab3" /><body>Home Assistant: this is a room message</body></message>
2022-05-20 13:51:02 DEBUG (MainThread) [slixmpp.xmlstream.xmlstream] Event triggered: sent_presence
2022-05-20 13:51:02 DEBUG (MainThread) [slixmpp.xmlstream.xmlstream] SEND: <presence to="home-assistant@conference.chat.local/home-assistant@chat.local/home-assistant" id="ac7a8ad1ebe941faae598052f7f30c75" xml:lang="en"><x xmlns="http://jabber.org/protocol/muc"><history maxchars="9" /></x></presence>
2022-05-20 13:51:02 DEBUG (MainThread) [slixmpp.xmlstream.xmlstream] RECV: <message xml:lang="en" to="home-assistant@chat.local/home-assistant" from="home-assistant@conference.chat.local" type="error" id="974fc54d1715400a9308a4a746ab0ab3"><origin-id xmlns="urn:xmpp:sid:0" id="974fc54d1715400a9308a4a746ab0ab3" /><error type="modify"><not-acceptable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" /><text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" xml:lang="en">Only occupants are allowed to send messages to the conference</text></error><body>Home Assistant: this is a room message</body></message>
2022-05-20 13:51:02 DEBUG (MainThread) [slixmpp.xmlstream.xmlstream] Event triggered: message
2022-05-20 13:51:02 DEBUG (MainThread) [slixmpp.xmlstream.xmlstream] Event triggered: message_error
2022-05-20 13:51:02 DEBUG (MainThread) [slixmpp.xmlstream.xmlstream] Event triggered: groupchat_message_error
2022-05-20 13:51:02 DEBUG (MainThread) [slixmpp.xmlstream.xmlstream] Event triggered: muc::home-assistant@conference.chat.local::message_error

And below is when it successfully sends individual recipient message:

2022-05-20 14:11:49 INFO (MainThread) [slixmpp.features.feature_bind.bind] JID set to: home-assistant@chat.local/home-assistant
2022-05-20 14:11:49 DEBUG (MainThread) [slixmpp.xmlstream.xmlstream] Event triggered: session_start
2022-05-20 14:11:49 DEBUG (MainThread) [slixmpp.clientxmpp] Finished processing stream features.
2022-05-20 14:11:49 DEBUG (MainThread) [slixmpp.xmlstream.xmlstream] Event triggered: stream_negotiated
2022-05-20 14:11:49 DEBUG (MainThread) [homeassistant.components.xmpp.notify] Sending message to junaid@chat.local
2022-05-20 14:11:49 DEBUG (MainThread) [homeassistant.components.xmpp.notify] Sending message to notify@conference.chat.local
2022-05-20 14:11:49 DEBUG (MainThread) [slixmpp.xmlstream.xmlstream] SEND: <message type="chat" to="junaid@chat.local" id="774b0dc066a643dc994a1e83080678cc" xml:lang="en"><origin-id xmlns="urn:xmpp:sid:0" id="774b0dc066a643dc994a1e83080678cc" /><body>Home Assistant: this is individual recipient</body></message>
2022-05-20 14:11:49 DEBUG (MainThread) [slixmpp.xmlstream.xmlstream] SEND: <message type="chat" to="notify@conference.chat.local" id="d3b6e275052246baa328077154daddca" xml:lang="en"><origin-id xmlns="urn:xmpp:sid:0" id="d3b6e275052246baa328077154daddca" /><body>Home Assistant: this is individual recipient</body></message>
2022-05-20 14:11:49 DEBUG (MainThread) [slixmpp.xmlstream.xmlstream] SEND: </stream:stream>
2022-05-20 14:11:50 DEBUG (MainThread) [slixmpp.xmlstream.xmlstream] End of stream received
2022-05-20 14:11:50 DEBUG (MainThread) [slixmpp.xmlstream.xmlstream] Event triggered: killed
2022-05-20 14:11:50 INFO (MainThread) [slixmpp.xmlstream.xmlstream] connection_lost: (None,)
2022-05-20 14:11:50 DEBUG (MainThread) [slixmpp.xmlstream.xmlstream] Cancelling 0 slow send tasks

also if I downgrade this test HA container to 2022.3 with the same xmpp server, integration and automation it just works with no errors/fails