mirror of
https://github.com/binwiederhier/ntfy.git
synced 2026-05-09 08:26:00 +02:00
[GH-ISSUE #649] Error handling Matrix request internal server error: cannot publish to UnifiedPush topic without previously active subscriber #482
Labels
No labels
ai-generated
android-app
android-app
android-app
🪲 bug
build
build
dependencies
docs
enhancement
enhancement
🔥 HOT
in-progress 🏃
ios
prio:low
prio:low
pull-request
question
🔒 security
server
server
unified-push
web-app
website
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ntfy#482
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @barathrm on GitHub (Mar 3, 2023).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/649
🐞 Describe the bug
Matrix notifications no longer work. Other notifications work fine. Way I tested matrix notifications
💻 Components impacted
💡 Screenshots and/or logs
🔮 Additional context
The problem only occurs on ntfy
2.1.1and2.1.0. Rolling back to1.31.0fixes the issue.Let me know if there's anything I can do to help debug.
@binwiederhier commented on GitHub (Mar 3, 2023):
Thanks for reporting this. While I do think this may actually be a bug, the way you describe it sounds like "intended behavior", so let me clarify:
Did you subscribe to the topic before sending the message? If you have debugging enabled, you should see some
GET /up1234/(json|ws)message and something that says "registering rate visitor". Maybe post a more extensive excerpt from the logs?@S1m @karmanyaahm I do think we'll have to urgently change this logic again if it is actually causing delivery issues. Maybe the 400k Matrix messages are not all dead letters after all.
@barathrm commented on GitHub (Mar 3, 2023):
Well, I'm not sure. I never completely understood how subscribing to a topic works wrt. UP and matrix clients.
For my "regular" ntfy topics which I create and post messages to manually, I can obviously subscribe to manually in the ntfy app. The matrix topics seem to be created/subscribed to automatically in the ntfy app by the matrix clients (I assume?). Maybe there's a quirk in how matrix clients (don't) subscribe (re-subscribe?) to a topic before receiving notifications?
The way I tested this was making sure I had a ntfy user with read access to the 'up*' topic, restarting the ntfy android app, deleting all old matrix topics in the ntfy app to start clean, toggling usage of ntfy as a backend off and on in schildichat and then sending a message to the account used in schildichat. This failed when using the latest ntfy versions, but when I rolled back to an older version of ntfy, it started working.
But what prompted me to start looking into this in the first place was notifications not working anymore, for all my regular active conversations, so I assume that I was still subscribed to those at that time...? Unless ntfy requires some action from matrix clients to make sure that everything works after a ntfy restart/upgrade?
Either way, I'll try a newer version again and look for the
GETmessages and post more logs :)@barathrm commented on GitHub (Mar 3, 2023):
I forgot that I can just find the old logs in the journal 🤪
Here they are, slightly anonymized. They start after a restart of the ntfy server with trace logging enabled and end where it looks like I stopped testing sending messages. Judging from these lines it looks like my ntfy app connected via WS?
Edit: fixed log file
ntfy.log
@binwiederhier commented on GitHub (Mar 3, 2023):
I think this is the key piece of info here. The user that is subscribing does not have write access? If that is the case, the visitor cannot set itself as "rate visitor". This all sounds like gibberish to you, probably, and it doesn't need to make sense to you.
Bottom line is: This is a slight design flaw in my opinion. We have to find a way to not have this stupid rate limiting logic for selfhosters. Maybe we just make the 507-logic opt-in with a flag.
@barathrm commented on GitHub (Mar 3, 2023):
I can confirm that giving the ntfy user configured on the android phone
read-writeaccess to theup*topics, instead of justread, solves the issue for me with version2.1.1. 🙏@binwiederhier commented on GitHub (Mar 3, 2023):
We will implement a
enable-rate-visitorflag (off by default) and change the publishing logic toAnd the
maybeSetRateVisitors()logic to:@binwiederhier commented on GitHub (Mar 4, 2023):
Implemented in https://github.com/binwiederhier/ntfy/pull/655 -- Will likely be released today.