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

50035 : Invalid Form Body when relaying through webhooks #95

Closed
Aeris1One opened this issue Jun 20, 2023 · 2 comments
Closed

50035 : Invalid Form Body when relaying through webhooks #95

Aeris1One opened this issue Jun 20, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@Aeris1One
Copy link

Aeris1One commented Jun 20, 2023

Hi,
I just bridged a room using webhooks (!discord bridge <discorroomid> then !discord set-relay <matrixroomid> --create), but when someone except the account I used to setup the bridge (which speaks, as intended, through the bot instead of through webhooks) I get back some ⚠ Your message was not bridged: 50035: Invalid Form Body as m.notice.

It looks like it is related to avatar urls which is sent in a wrong format to Discord.
Here are debug logs :

Jun 20, 2023 10:16:40 DBG Sent message checkpoint message_checkpoint={"event_id":"$kViBySkWancHtehsL_qwTWG9GTju4RjXS-7d7bKSFyI","event_type":"m.room.message","message_type":"m.text","reported_by":"BRIDGE","retry_num":0,"room_id":"!roomid:my.domain","status":"SUCCESS","step":"BRIDGE","timestamp":1687256200361}
Jun 20, 2023 10:16:40 ERR Matrix event not handled error="HTTP 400 Bad Request, {\"code\": 50035, \"errors\": {\"avatar_url\": {\"_errors\": [{\"code\": \"URL_TYPE_INVALID_URL\", \"message\": \"Not a well formed URL.\"}]}}, \"message\": \"Invalid Form Body\"}" action="send matrix message metrics" channel_id=689171405384056933 channel_receiver= event_id=$kViBySkWancHtehsL_qwTWG9GTju4RjXS-7d7bKSFyI event_type=m.room.message result="Error sending event" room_id=!roomid:my.domain sender=@myaccount:my.domain
Jun 20, 2023 10:16:40 DBG Sending request as_user_id=@discordbot:my.domain body={"typing":false} method=PUT req_id=29 url=http://matrix-nginx-proxy:12080/_matrix/client/v3/rooms/%21roomid:my.domain/typing/@discordbot:my.domain?user_id=%40discordbot%3Amy.domain
Jun 20, 2023 10:16:40 DBG Sent message checkpoint message_checkpoint={"event_id":"$kViBySkWancHtehsL_qwTWG9GTju4RjXS-7d7bKSFyI","event_type":"m.room.message","info":"HTTP 400: 50035: Invalid Form Body ({\"avatar_url\":{\"_errors\":[{\"code\":\"URL_TYPE_INVALID_URL\",\"message\":\"Not a well formed URL.\"}]}})","message_type":"m.text","reported_by":"BRIDGE","retry_num":0,"room_id":"!roomid:my.domain","status":"PERM_FAILURE","step":"REMOTE","timestamp":1687256200507}
Jun 20, 2023 10:16:40 DBG Request completed as_user_id=@discordbot:my.domain duration=12.192771 method=PUT path=/v3/rooms/!roomid:my.domain/typing/@discordbot:my.domain req_id=29 response_length=2 response_mime=application/json status_code=200
Jun 20, 2023 10:16:40 DBG Sending request as_user_id=@discordbot:my.domain body={"body":"⚠ Your message was not bridged: 50035: Invalid Form Body","msgtype":"m.notice"} method=PUT req_id=30 url=http://matrix-nginx-proxy:12080/_matrix/client/v3/rooms/%21roomid:my.domain/send/m.room.message/mautrix-go_1687256200522469625_5?user_id=%40discordbot%3Amy.domain
Jun 20, 2023 10:16:40 DBG Request completed as_user_id=@discordbot:my.domain duration=102.904117 method=PUT path=/v3/rooms/!roomid:my.domain/send/m.room.message/mautrix-go_1687256200522469625_5 req_id=30 response_length=59 response_mime=application/json status_code=200
Jun 20, 2023 10:16:40 DBG Sending request as_user_id=@discordbot:my.domain body={"error":"HTTP 400: 50035: Invalid Form Body ({\"avatar_url\":{\"_errors\":[{\"code\":\"URL_TYPE_INVALID_URL\",\"message\":\"Not a well formed URL.\"}]}})","m.relates_to":{"event_id":"$kViBySkWancHtehsL_qwTWG9GTju4RjXS-7d7bKSFyI","rel_type":"m.reference"},"message":"50035: Invalid Form Body","network":"fi.mau.discord://discord/689159304049197131/689171405384056933","reason":"m.event_not_handled","status":"FAIL_PERMANENT"} method=PUT req_id=31 url=http://matrix-nginx-proxy:12080/_matrix/client/v3/rooms/%21roomid:my.domain/send/com.beeper.message_send_status/mautrix-go_1687256200630975471_6?user_id=%40discordbot%3Amy.domain

EDIT : Isn't that fixed by 3247709 ?

@Aeris1One Aeris1One added the bug Something isn't working label Jun 20, 2023
@tulir
Copy link
Member

tulir commented Jun 20, 2023

That usually happens if homeserver -> public_address is misconfigured

@Aeris1One
Copy link
Author

Aeris1One commented Jun 20, 2023

You're right, ansible playbook was not updated to add public_address config, thanks à lot !
Do you know why even when setting http(s)://my.domain or http(s)://matrix.my.domain message are sent but with a blank avatar ?
EDIT: nevermind, was due to discord's caching

spantaleev added a commit to spantaleev/matrix-docker-ansible-deploy that referenced this issue Jan 8, 2024
cvwright pushed a commit to cvwright/matrix-docker-ansible-deploy that referenced this issue Jan 11, 2024
KarolosLykos pushed a commit to KarolosLykos/matrix-docker-ansible-deploy that referenced this issue Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants