mirror of
https://github.com/binwiederhier/ntfy.git
synced 2026-05-09 16:35:53 +02:00
[GH-ISSUE #1081] ntfy sub --from-config won't receive messages until self-hosted ntfy server (Docker) is restarted or stopped #759
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#759
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 @afunworm on GitHub (Apr 2, 2024).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/1081
This is the discovery I made follow some attempts for #1076.
🐞 Describe the bug
Demonstration videos below
Let's call Server the machine hosting the ntfy server through Docker.
Let's call Client the machine hosting ntfy through Docker, but is only used for the docker CLI.
Let's call the topic
clitest.On machine A, run
ntfy sub --from-config.Using any method, publish a message to
clitest. Supposedly, Client should output the receipt of the message sent to Server. However, this doesn't happen until the Docker container on Server is stopped.This won't happen when using to the official https://ntfy.sh server instead of the self-hosted ntfy server.
💻 Components impacted
ntfy CLI or ntfy Server. Both run on Ubuntu 22.04, through Docker Engine.
💡 Screenshots and/or logs
Testing with self-hosted server: https://streamable.com/7fx5f2
Testing with ntfy.sh: https://streamable.com/7s4oy7
@afunworm commented on GitHub (Apr 2, 2024):
I did some more digging and it seems like it has to do with the server. I wrote a small script to subscribe to SSE from a topic from a self-hosted server, it wouldn't work. When I switched back to ntfy.sh, it works. Here's the script.
Funny enough, just like the original post, as soon as I did the
docker compose stop, the messages got sent to the EventSource.Here is the debug log, the first line shows as soon as I run the subscription script:
With that said, it seems like the stream isn't working properly. Is there anything I can do to diagnose this?
@afunworm commented on GitHub (Apr 2, 2024):
I finally made it work, by doing 2 things. However, I still don't know why these settings affect the streaming. For anyone who runs into the same problem in the future:
default-hostor by writing your own script, usehttpinstead ofhttps.This means it could be something wrong with the SSL settings on the server. However, all my other apps run perfectly, so I can't exactly narrow down what's wrong with the setup.
In the end, NTFY is still such an amazing piece of software. I'll be supporting it for a long time.
@wunter8 commented on GitHub (Apr 4, 2024):
I was able to test this tonight. I have one container running
ntfy serve, another container runningntfy sub --from-config, and a third container runningntfy pub. Everything worked fine for me (e.g., ntfy sub ran the correct command without me needing to kill the server container first).So maybe there is a problem with nginx proxy manager? Or like you said, something with SSL/TLS?
@wunter8 commented on GitHub (Apr 14, 2024):
Did you determine the source of the problem?
@afunworm commented on GitHub (Apr 18, 2024):
I didn't. I just settled to use
httpand called it a day. If you are not able to replicate it, it feels like it's more of my responsibility. Nginx Proxy Manager shows no error either.@theatischbein commented on GitHub (Jun 11, 2024):
I had the same problem and find a solution and wanted to share this here if anyone else stumble upon this error!
My ntfy server is behind a nginx reverse proxy and was missing configurations.
I followed https://docs.ntfy.sh/config/#behind-a-proxy-tls-etc and added:
Afterwards everything works fine!
@kosli commented on GitHub (Feb 19, 2025):
thanks @theatischbein you made my day!
@binwiederhier the sample nginx conf more secure is missing the options mentioned above.
https://docs.ntfy.sh/config/#nginxapache2caddy