[GH-ISSUE #1073] HTTP 413: JSON body too large #751

Closed
opened 2026-05-07 00:27:10 +02:00 by BreizhHardware · 3 comments

Originally created by @davidfrickert on GitHub (Mar 27, 2024).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/1073

🐞 Describe the bug
It seems that the JSON method to send notifications to ntfy has a body size limit. Did not find any documentation on what this size is and if it's possible to increase.

💻 Components impacted
ntfy server

💡 Screenshots and/or logs
2024/03/27 17:22:35 INFO Connection closed with HTTP 413 (ntfy error 41303) (error=JSON body too large, error_code=41303, http_method=POST, http_path=/, http_status=413, tag=http, visitor_auth_limiter_limit=0.016666666666666666, visitor_auth_limiter_tokens=30, visitor_id=ip:10.42.0.229, visitor_ip=10.42.0.229, visitor_messages=14, visitor_messages_limit=17280, visitor_messages_remaining=17266, visitor_request_limiter_limit=0.2, visitor_request_limiter_tokens=60, visitor_seen=2024-03-27T17:22:35.243Z)

🔮 Additional context
Trying to get Grafana to send notifications to ntfy and sometimes Grafana will try to merge multiple related warnings in one notification, which becomes quite big. It seems that ntfy rejects these requests due to the payload size being too big.

Originally created by @davidfrickert on GitHub (Mar 27, 2024). Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/1073 :lady_beetle: **Describe the bug** It seems that the JSON method to send notifications to ntfy has a body size limit. Did not find any documentation on what this size is and if it's possible to increase. :computer: **Components impacted** ntfy server :bulb: **Screenshots and/or logs** 2024/03/27 17:22:35 INFO Connection closed with HTTP 413 (ntfy error 41303) (error=JSON body too large, error_code=41303, http_method=POST, http_path=/, http_status=413, tag=http, visitor_auth_limiter_limit=0.016666666666666666, visitor_auth_limiter_tokens=30, visitor_id=ip:10.42.0.229, visitor_ip=10.42.0.229, visitor_messages=14, visitor_messages_limit=17280, visitor_messages_remaining=17266, visitor_request_limiter_limit=0.2, visitor_request_limiter_tokens=60, visitor_seen=2024-03-27T17:22:35.243Z) :crystal_ball: **Additional context** Trying to get Grafana to send notifications to ntfy and sometimes Grafana will try to merge multiple related warnings in one notification, which becomes quite big. It seems that ntfy rejects these requests due to the payload size being too big.
BreizhHardware 2026-05-07 00:27:10 +02:00
  • closed this issue
  • added the
    🪲 bug
    label
Author
Owner

@wunter8 commented on GitHub (Mar 27, 2024):

By default, the message size limit is 4 KiB. If you're sending a JSON body and use the new templating system, the body can be 32 KiB, so long as the resulting message after applying the templating is <= 4 KiB

<!-- gh-comment-id:2023454535 --> @wunter8 commented on GitHub (Mar 27, 2024): By default, the message size limit is 4 KiB. If you're sending a JSON body and use the new templating system, the body can be 32 KiB, so long as the resulting message after applying the templating is <= 4 KiB
Author
Owner

@wunter8 commented on GitHub (Mar 27, 2024):

If you're self-hosting, the message size limit is configurable: https://docs.ntfy.sh/config/#message-limits

But see the warning!

<!-- gh-comment-id:2023465600 --> @wunter8 commented on GitHub (Mar 27, 2024): If you're self-hosting, the message size limit is configurable: https://docs.ntfy.sh/config/#message-limits But see the warning!
Author
Owner

@davidfrickert commented on GitHub (Mar 27, 2024):

@wunter8 thanks! Will test it out as I am indeed self-hosting.

<!-- gh-comment-id:2023471531 --> @davidfrickert commented on GitHub (Mar 27, 2024): @wunter8 thanks! Will test it out as I am indeed self-hosting.
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#751
No description provided.