After upgrading to 2023.10.0 I can no longer send messages to my local Matrix instance. This worked just fine before the upgrade. I’m getting the below error stating the user is not in the room, but the user is clearly in the room if I review the member list. I can see that there was a change to the Matrix integration in this release, perhaps there’s something I need to change with my setup? Anyone have similar problems or could point me in the right direction?
Unable to deliver message to room '#hassadmin:matrix.domain.name': RoomSendError: M_FORBIDDEN User @hass:matrix.domain.name not in room #hassadmin:matrix.domain.name
1 Like
I’ve got the same problem since 2023.10.0. I have removed the Home Assistant user from the matrix rooms and reinvited him. According to synapse he rejoins the rooms but the Home Assistant log says that the Message could not be delivered because the user ist not in the rooms…
1 Like
I just upgraded to 2023.10.1 (not that I expected it to fix anything). I’ve tried removing and re-adding the user as well. I tried creating a brand new room and adding the user. I even logged into the account with another PC and sent some messages in the room. No dice. I don’t know why it won’t work but I’m starting to consider downgrading to 2023.9.
Oh, I also tried upgrading the user to moderator, then admin. No luck there either.
Looks like this may be related. I’ll be trying this later.
opened 10:55AM - 22 Jul 23 UTC
closed 07:32PM - 22 Jul 23 UTC
### System Health details
## System Information
version | core-2023.7.2
-… - | --
installation_type | Home Assistant Container
dev | false
hassio | false
docker | true
user | root
virtualenv | false
python_version | 3.11.4
os_name | Linux
os_version | 4.4.302+
arch | x86_64
timezone | Europe/Berlin
config_dir | /config
<details><summary>Home Assistant Community Store</summary>
GitHub API | ok
-- | --
GitHub Content | ok
GitHub Web | ok
GitHub API Calls Remaining | 4947
Installed Version | 1.32.1
Stage | running
Available Repositories | 1274
Downloaded Repositories | 6
</details>
<details><summary>Home Assistant Cloud</summary>
logged_in | false
-- | --
can_reach_cert_server | ok
can_reach_cloud_auth | ok
can_reach_cloud | ok
</details>
<details><summary>Dashboards</summary>
dashboards | 1
-- | --
resources | 1
views | 4
mode | storage
</details>
<details><summary>Recorder</summary>
oldest_recorder_run | 27. Juni 2023 um 09:54
-- | --
current_recorder_run | 22. Juli 2023 um 12:27
estimated_db_size | 120.36 MiB
database_engine | sqlite
database_version | 3.41.2
</details>
### Checklist
- [X] I have enabled debug logging for my installation.
- [X] I have filled out the issue template to the best of my ability.
- [X] This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
- [X] This issue is not a duplicate issue of currently [previous issues](https://github.com/PaarthShah/matrix-nio-hacs/issues?q=is%3Aissue+label%3A%22Bug%22+)..
### Describe the issue
I am very thankful that you made you're work accessible to me by HACS!
I installed your custom component via HACS.
But when I call one of my notify messages I receive the no message in the matrix room and the info you see in the log.
I also tried to remove and readd the user to the matrix room by hand but still the same result. I feel that the log entries "Joined and already in room" and "not in room" are kind of contradicting, aren't they? So, I'm a bit helpless with what to do now to get it working again.
I also had a command "report" in with the old integration working once. When I call "!report" now in the room I see that the component receives it but nothing else happens ...
### Reproduction steps
1. Install the custom-component via HACS
2. Put in ./config/matrix.yaml
```
homeserver: https://mydomain.net
username: !secret matrix_handle
password: !secret matrix_password
rooms:
- "#hassi:mydomain.net"
commands:
- word: report
name: report
```
3. in ./config/configuration.yaml
```
matrix: !include matrix.yaml
notify:
- name: matrix_notify
platform: matrix
default_room: "#hassi:mydomain.net"
```
4.
Call matrix_notify in any Automization
### Debug logs
```text
homeassistant | 2023-07-22 12:28:22.720 DEBUG (MainThread) [custom_components.matrix] Successfully restored login from access token: user_id '@homeassistant:mydomain.net', device_id 'GWFCBNTGOK'
homeassistant | 2023-07-22 12:28:22.808 INFO (Update loop) [pyShelly] Error adding device, 192.168.2.17 IP-addr
homeassistant | 2023-07-22 12:28:23.274 INFO (MainThread) [custom_components.hacs] Starting recurring background task for downloaded repositories
homeassistant | 2023-07-22 12:28:23.276 INFO (MainThread) [custom_components.hacs] Stage changed: running
homeassistant | 2023-07-22 12:28:23.279 INFO (SyncWorker_2) [homeassistant.loader] Loaded dlna_dms from homeassistant.components.dlna_dms
homeassistant | 2023-07-22 12:28:23.312 INFO (SyncWorker_6) [homeassistant.loader] Loaded upnp from homeassistant.components.upnp
homeassistant | 2023-07-22 12:28:24.068 DEBUG (MainThread) [custom_components.matrix] Joined or already in room '#hassi:mydomain.net'
homeassistant | 2023-07-22 12:28:24.295 INFO (MainThread) [nio.client.base_client] New joined room !LGikxWyfCXalKdkofs:mydomain.net
homeassistant | 2023-07-22 12:28:24.295 INFO (MainThread) [nio.rooms] Room !LGikxWyfCXalKdkofs:mydomain.net handling event of type RoomCreateEvent
homeassistant | 2023-07-22 12:28:24.295 INFO (MainThread) [nio.rooms] Room !LGikxWyfCXalKdkofs:mydomain.net handling event of type RoomEncryptionEvent
homeassistant | 2023-07-22 12:28:24.295 INFO (MainThread) [nio.rooms] Room !LGikxWyfCXalKdkofs:mydomain.net handling event of type PowerLevelsEvent
homeassistant | 2023-07-22 12:28:24.295 INFO (MainThread) [nio.rooms] Room !LGikxWyfCXalKdkofs:mydomain.net handling event of type RoomJoinRulesEvent
homeassistant | 2023-07-22 12:29:13.787 INFO (MainThread) [homeassistant.components.automation.matrix_report] Matrix Report: Running automation actions
homeassistant | 2023-07-22 12:29:13.787 INFO (MainThread) [homeassistant.components.automation.matrix_report] Matrix Report: Executing step call service
homeassistant | 2023-07-22 12:29:13.841 ERROR (MainThread) [custom_components.matrix] Unable to deliver message to room '#hassi:mydomain.net': RoomSendError: M_FORBIDDEN User @homeassistant:mydomain.net not in room #hassi:mydomain.net
[...]
homeassistant | 2023-07-22 12:45:58.167 INFO (MainThread) [nio.rooms] Room !thbmTZEKVxomcoMekV:ismus.net handling event of type RoomMessageText
homeassistant | 2023-07-22 12:45:58.167 DEBUG (MainThread) [custom_components.matrix] Handling message: !report
```
### Diagnostics dump
_No response_
EDIT: Per the above link, changing the room names in my configuration from the aliases to the ones that start with ! has fixed my problem.
2 Likes
Just fyi, this fixed my integration as well - thanks so much for finding this info because I was ready to pull my hair out!
Ryan
1 Like
valvin1
(Valvin)
October 28, 2023, 2:44pm
7
thank you it solved my issue
1 Like