[GH-ISSUE #1286] Is there some sort of spam protection? #912

Closed
opened 2026-05-07 00:28:41 +02:00 by BreizhHardware · 9 comments

Originally created by @lastmetroid on GitHub (Mar 4, 2025).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/1286

Hello,

I have a problem using the NTFY service, that randomly messages wont give any JSON response, mostly after rending multiple messages in a short pteriod of time, like every x seconds or so one message, randomly it happens after a while, that it stops working.

Originally created by @lastmetroid on GitHub (Mar 4, 2025). Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/1286 Hello, I have a problem using the NTFY service, that randomly messages wont give any JSON response, mostly after rending multiple messages in a short pteriod of time, like every x seconds or so one message, randomly it happens after a while, that it stops working.
BreizhHardware 2026-05-07 00:28:41 +02:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@wunter8 commented on GitHub (Mar 5, 2025):

Are you using the public ntfy.sh instance? Are you hitting the rate limits and getting a 429 HTTP error?

<!-- gh-comment-id:2699569312 --> @wunter8 commented on GitHub (Mar 5, 2025): Are you using the public ntfy.sh instance? Are you hitting the rate limits and getting a 429 HTTP error?
Author
Owner

@lastmetroid commented on GitHub (Mar 5, 2025):

Yes, it was the rate limit. I was debugging with a Tasmota ESP32 device sending messages to it, but there was no Json feedback from the server after a while. When I then used curl, I got a error json back notfying about a rate limit. Do you maybe know why this is the case? It seems the error Json is somehow different than the normal Json the server sends. Not sure if that is optimal.

<!-- gh-comment-id:2699681429 --> @lastmetroid commented on GitHub (Mar 5, 2025): Yes, it was the rate limit. I was debugging with a Tasmota ESP32 device sending messages to it, but there was no Json feedback from the server after a while. When I then used curl, I got a error json back notfying about a rate limit. Do you maybe know why this is the case? It seems the error Json is somehow different than the normal Json the server sends. Not sure if that is optimal.
Author
Owner

@wunter8 commented on GitHub (Mar 5, 2025):

You should get an error JSON body initially. If you keep sending messages and ignore the 429, your IP address will be (temporarily) banned. Then the connection would timeout, and you would get no response. Maybe that's what you saw?

<!-- gh-comment-id:2699694864 --> @wunter8 commented on GitHub (Mar 5, 2025): You should get an error JSON body initially. If you keep sending messages and ignore the 429, your IP address will be (temporarily) banned. Then the connection would timeout, and you would get no response. Maybe that's what you saw?
Author
Owner

@lastmetroid commented on GitHub (Mar 5, 2025):

Thank you for the information. That was mostly what I was seeing because of temporary IP bans. Would you be alo affected by this if you used a VPN that the IP might randomly be blocked by the NTFY server?

<!-- gh-comment-id:2701580985 --> @lastmetroid commented on GitHub (Mar 5, 2025): Thank you for the information. That was mostly what I was seeing because of temporary IP bans. Would you be alo affected by this if you used a VPN that the IP might randomly be blocked by the NTFY server?
Author
Owner

@wunter8 commented on GitHub (Mar 5, 2025):

The VPN's IP wouldn't be "randomly blocked," but if you or others using the VPN send requests to ntfy.sh and ignore 429 responses, the VPN's IP address could be blocked.

<!-- gh-comment-id:2701611531 --> @wunter8 commented on GitHub (Mar 5, 2025): The VPN's IP wouldn't be "randomly blocked," but if you or others using the VPN send requests to ntfy.sh and ignore 429 responses, the VPN's IP address could be blocked.
Author
Owner

@lastmetroid commented on GitHub (Mar 8, 2025):

@wunter8 I sometimes get a weird respons from the server in the form:

01:24:39.005 ntfy.sh status=1 response=

or

1:27:55.391 ntfy.sh status=2 response=

what are status code 1 and 2?

<!-- gh-comment-id:2707808547 --> @lastmetroid commented on GitHub (Mar 8, 2025): @wunter8 I sometimes get a weird respons from the server in the form: 01:24:39.005 ntfy.sh status=1 response= or 1:27:55.391 ntfy.sh status=2 response= what are status code 1 and 2?
Author
Owner

@wunter8 commented on GitHub (Mar 8, 2025):

Where are you seeing that? What is it in response to?

<!-- gh-comment-id:2707811910 --> @wunter8 commented on GitHub (Mar 8, 2025): Where are you seeing that? What is it in response to?
Author
Owner

@lastmetroid commented on GitHub (Mar 8, 2025):

I tried to do it on a ESP32 with Tasmota and Berry in the form:

tasmota.add_rule('SSerialReceived#Message',
def (value,trigger,data)
var wc = webclient()
wc.begin('https://ntfy.sh/MYTOPIC')
var status = wc.POST(f'{value}')
var response = wc.get_string()
print(f'ntfy.sh {status=} {response=}')
wc.close()
if status == 200
tasmota.cmd('SSerialSend2 WebQuerySent')
else
tasmota.cmd('SSerialSend2 WebQueryError')
end
end, 'SSerialReceivedRule1')

It most of the time works, but sometimes I get status code 1 or 2 back with no message from the NTFY server.

<!-- gh-comment-id:2707813416 --> @lastmetroid commented on GitHub (Mar 8, 2025): I tried to do it on a ESP32 with Tasmota and Berry in the form: tasmota.add_rule('SSerialReceived#Message', def (value,trigger,data) var wc = webclient() wc.begin('https://ntfy.sh/MYTOPIC') var status = wc.POST(f'{value}') var response = wc.get_string() print(f'ntfy.sh {status=} {response=}') wc.close() if status == 200 tasmota.cmd('SSerialSend2 WebQuerySent') else tasmota.cmd('SSerialSend2 WebQueryError') end end, 'SSerialReceivedRule1') It most of the time works, but sometimes I get status code 1 or 2 back with no message from the NTFY server.
Author
Owner

@wunter8 commented on GitHub (Mar 8, 2025):

I'm not sure what that is. I don't think ntfy ever returns 1 or 2 as an HTTP code. Is it possible that is an error/exit code from the wc.POST command?

<!-- gh-comment-id:2708296700 --> @wunter8 commented on GitHub (Mar 8, 2025): I'm not sure what that is. I don't think ntfy ever returns `1` or `2` as an HTTP code. Is it possible that is an error/exit code from the `wc.POST` command?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ntfy#912
No description provided.