Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot send notifications through matrix #415

Open
monkeyfella opened this issue Nov 21, 2023 · 4 comments · May be fixed by #416
Open

Cannot send notifications through matrix #415

monkeyfella opened this issue Nov 21, 2023 · 4 comments · May be fixed by #416
Labels
Service: Matrix Related to the Matrix service Status: Confirmed Type: Bug Something isn't working

Comments

@monkeyfella
Copy link

monkeyfella commented Nov 21, 2023

Running watchtower, and have tried by sending notifications with the 0.8 version as well.

I have joined a room on the matrix server, because I could not get the bot to join a room it was invited to.

In watchtower I try to send with this url:
WATCHTOWER_NOTIFICATION_URL: "matrix://shoutrrr:redacted@matrix.domain.com"

I get:

level=error msg="Failed to send shoutrrr notification" error="1 error(s) sending message, with initial error: failed to send message to room '!DSfY3QSFnozlLb7Qhu:domain.com': M_UNRECOGNIZED: Unrecognized request" index=0 notify=no service=matrix

And on the matrix server the logs show:

2023-11-21T07:01:40.011417Z  WARN conduit: Not found: 
/_matrix/client/r0/rooms/%21DSfY3QSFnozlLb7Qhu:domain.com/send/m.room.message?access_token=<REDACTED>
2023-11-21T07:02:22.868338Z  WARN conduit: Not found: /_matrix/client/r0/rooms/

When trying to send with

./shoutrrr send -u matrix://shoutrrr:password@matrix.domain.com -m test

Logs show:

1 error(s) sending message, with initial error: failed to send message to room '!DSfY3QSFnozlLb7Qhu:domain.com': M_UNRECOGNIZED: Unrecognized request

and the logs on the matrix server shows:

2023-11-21T07:07:53.824758Z  WARN conduit: Not found: /_matrix/client/r0/rooms/%21DSfY3QSFnozlLb7Qhu:domain.com/send/m.room.message?access_token=<REDACTED>

I've redacted the real domain name

@piksel
Copy link
Member

piksel commented Nov 21, 2023

HellO!

Do you know what software the matrix server is using, and what version? Synapse maybe?
Also, was this a mistake during redaction:

/_matrix/client/r0/rooms/%21DSfY3QSFnozlLb7Qhu:domain.com/send/

(and not matrix.domain.com)?

Trying to rule out some red herrings...

Also, could you post the output of:

curl https://matrix.domain.com/_matrix/client/versions 

Perhaps the services just uses a too old API version?

@monkeyfella
Copy link
Author

monkeyfella commented Nov 21, 2023

Hey :)

No, I am using delegation so the domain of the server is domain.com, but it uses the .well-known/matrix/serverredirection to the domain actually running the server which is matrix.domain.com.

I am running the Conduit matrix server.(https://conduit.rs) version 0.6

I have tried with synapse and dendrite before, I was never able to get the bot to actually join the room (tried all sorts of variants of formatting) , I had to join it manually and then remove the room id/alias from the url to be able to send notifications through it.

Edit:
output of curl
{"versions":["r0.5.0","r0.6.0","v1.1","v1.2","v1.3","v1.4"],"unstable_features":{"org.matrix.e2e_cross_signing":true}}

@piksel
Copy link
Member

piksel commented Nov 21, 2023

Hm, it looks like there is a missing txnId in the URL. It's present in the v0.0.0 of the matrix server/client API spec, so I'm not sure why were not adding that. We should probably add support for newer versions as well.

Ref: https://spec.matrix.org/legacy/r0.0.0/client_server.html#put-matrix-client-r0-rooms-roomid-send-eventtype-txnid

@piksel piksel added Type: Bug Something isn't working Service: Matrix Related to the Matrix service Status: Confirmed labels Nov 21, 2023
@piksel piksel linked a pull request Nov 21, 2023 that will close this issue
@monkeyfella
Copy link
Author

monkeyfella commented Nov 21, 2023

Tried the fix just now, and got it working. Can send message with no room specified (sending to the already joined room) and to specified room with !roomID, and the bot joined the room and everything. Thanks for dealing with this quickly, 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Service: Matrix Related to the Matrix service Status: Confirmed Type: Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants