[GH-ISSUE #1116] Timeout on topic subscription (self hosted behind Traefik) #787

Closed
opened 2026-05-07 00:27:33 +02:00 by BreizhHardware · 2 comments

Originally created by @maxjcohen on GitHub (May 23, 2024).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/1116

Hi, and thanks for developing Ntfy, it's just great.

🐞 Describe the bug
I've recently moved my Ntfy instance behind Traefik for automating TLS stuff, adjusted the configuration for Ntfy, and notifications seem to work just as before on the web app. However, when subscribing to the server on the Android app, I get a timeout.

💻 Components impacted
Android app.

💡 Screenshots and/or logs
My configuration

      - NTFY_AUTH_FILE=/var/lib/auth/auth.db
      - NTFY_AUTH_DEFAULT_ACCESS=read-only
      - NTFY_CACHE_FILE=/var/cache/ntfy/cache.db
      - NTFY_BASE_URL=https://{{ domain }}
      - NTFY_BEHIND_PROXY=true
      - NTFY_UPSTREAM_BASE_URL=https://ntfy.sh

The Android app's logs

This is a log of the ntfy Android app. The log shows up to 1,000 entries.

Device info:
--
ntfy: 1.16.0 (fdroid)
OS: 4.9.292-ga72d58f85040
Android: 12 (SDK 32)
Model: sargo
Product: sargo

--
Settings:                    
{
  "autoDeleteSeconds": 2592000,
  "autoDownloadMaxSize": 1048576,
  "broadcastEnabled": true,
  "connectionProtocol": "jsonhttp",
  "darkMode": -1,
  "defaultBaseUrl": "",
  "lastSharedTopics": [],
  "minPriority": 1,
  "mutedUntil": 0,
  "recordLogs": true
}

Logs
--

1716303690986 2024-05-21 17:01:30.986 D NtfyLog Enabled log recording
1716303696744 2024-05-21 17:01:36.744 D NtfyMainActivity Create io.heckel.ntfy.ui.MainActivity@102528
1716303696747 2024-05-21 17:01:36.747 D NtfyMainActivity Poll worker version matches: choosing KEEP as existing work policy
1716303696747 2024-05-21 17:01:36.747 D NtfyMainActivity Poll worker: Scheduling period work every 60 minutes
1716303696747 2024-05-21 17:01:36.747 D NtfyMainActivity ServiceStartWorker version matches: choosing KEEP as existing work policy
1716303696747 2024-05-21 17:01:36.747 D NtfyMainActivity ServiceStartWorker: Scheduling period work every 180 minutes
1716303696748 2024-05-21 17:01:36.748 D NtfyMainActivity Delete worker version matches: choosing KEEP as existing work policy
1716303696748 2024-05-21 17:01:36.748 D NtfyMainActivity Delete worker: Scheduling period work every 480 minutes
1716303696751 2024-05-21 17:01:36.751 D NtfyMainActivity Battery: ignoring optimizations = true (we want this to be true); instant subscriptions = false; remind time reached = true; banner = false
1716303696780 2024-05-21 17:01:36.780 D NtfySubscriberMgr Enqueuing work to refresh subscriber service
1716303696782 2024-05-21 17:01:36.782 D NtfyMainActivity Battery: ignoring optimizations = true (we want this to be true); instant subscriptions = false; remind time reached = true; banner = false
1716303696787 2024-05-21 17:01:36.787 D NtfyMainActivity Checking global and subscription-specific 'muted until' timestamp
1716303707155 2024-05-21 17:01:47.155 D NtfyApiService Checking anonymous read against https://<MYSERVER>/<TOPIC>
1716303722159 2024-05-21 17:02:02.159 W NtfyAddFragment Connection to topic failed: timeout
Exception:
java.io.InterruptedIOException: timeout
	at okhttp3.internal.connection.RealCall.timeoutExit(RealCall.kt:398)
	at okhttp3.internal.connection.RealCall.callDone(RealCall.kt:360)
	at okhttp3.internal.connection.RealCall.noMoreExchanges$okhttp(RealCall.kt:325)
	at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:209)
	at okhttp3.internal.connection.RealCall.execute(RealCall.kt:154)
	at io.heckel.ntfy.msg.ApiService.checkAuth(ApiService.kt:156)
	at io.heckel.ntfy.ui.AddFragment$checkReadAndMaybeShowLogin$1.invokeSuspend(AddFragment.kt:209)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
	at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:749)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
Caused by: java.io.IOException: Canceled
	at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:72)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
	at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201)
	... 11 more

1716303726092 2024-05-21 17:02:06.092 D NtfyMainActivity Checking global and subscription-specific 'muted until' timestamp
1716303727717 2024-05-21 17:02:07.717 D NtfySettingsActivity Create io.heckel.ntfy.ui.SettingsActivity@a09e9e4

🔮 Additional context

What works

  1. From my phone, open the web app on my domain name, which though Traefik redirects to the Ntfy server. Things work.
  2. From my phone, and from the Android app, connect directly to the Ntfy server (bypassing Traefik, using a different port opened by Docker). Things work (but only on insecure http connection, since Traefik handles certificates).

What does not work
From my phone, and from the Android app, connect to the Ntfy server through Traefik. I get a timeout error.

Thanks.

Originally created by @maxjcohen on GitHub (May 23, 2024). Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/1116 Hi, and thanks for developing Ntfy, it's just great. :lady_beetle: **Describe the bug** I've recently moved my Ntfy instance behind Traefik for automating TLS stuff, adjusted the configuration for Ntfy, and notifications seem to work just as before on the web app. However, when subscribing to the server on the Android app, I get a timeout. :computer: **Components impacted** Android app. :bulb: **Screenshots and/or logs** *My configuration* ```yaml - NTFY_AUTH_FILE=/var/lib/auth/auth.db - NTFY_AUTH_DEFAULT_ACCESS=read-only - NTFY_CACHE_FILE=/var/cache/ntfy/cache.db - NTFY_BASE_URL=https://{{ domain }} - NTFY_BEHIND_PROXY=true - NTFY_UPSTREAM_BASE_URL=https://ntfy.sh ``` *The Android app's logs* ``` This is a log of the ntfy Android app. The log shows up to 1,000 entries. Device info: -- ntfy: 1.16.0 (fdroid) OS: 4.9.292-ga72d58f85040 Android: 12 (SDK 32) Model: sargo Product: sargo -- Settings: { "autoDeleteSeconds": 2592000, "autoDownloadMaxSize": 1048576, "broadcastEnabled": true, "connectionProtocol": "jsonhttp", "darkMode": -1, "defaultBaseUrl": "", "lastSharedTopics": [], "minPriority": 1, "mutedUntil": 0, "recordLogs": true } Logs -- 1716303690986 2024-05-21 17:01:30.986 D NtfyLog Enabled log recording 1716303696744 2024-05-21 17:01:36.744 D NtfyMainActivity Create io.heckel.ntfy.ui.MainActivity@102528 1716303696747 2024-05-21 17:01:36.747 D NtfyMainActivity Poll worker version matches: choosing KEEP as existing work policy 1716303696747 2024-05-21 17:01:36.747 D NtfyMainActivity Poll worker: Scheduling period work every 60 minutes 1716303696747 2024-05-21 17:01:36.747 D NtfyMainActivity ServiceStartWorker version matches: choosing KEEP as existing work policy 1716303696747 2024-05-21 17:01:36.747 D NtfyMainActivity ServiceStartWorker: Scheduling period work every 180 minutes 1716303696748 2024-05-21 17:01:36.748 D NtfyMainActivity Delete worker version matches: choosing KEEP as existing work policy 1716303696748 2024-05-21 17:01:36.748 D NtfyMainActivity Delete worker: Scheduling period work every 480 minutes 1716303696751 2024-05-21 17:01:36.751 D NtfyMainActivity Battery: ignoring optimizations = true (we want this to be true); instant subscriptions = false; remind time reached = true; banner = false 1716303696780 2024-05-21 17:01:36.780 D NtfySubscriberMgr Enqueuing work to refresh subscriber service 1716303696782 2024-05-21 17:01:36.782 D NtfyMainActivity Battery: ignoring optimizations = true (we want this to be true); instant subscriptions = false; remind time reached = true; banner = false 1716303696787 2024-05-21 17:01:36.787 D NtfyMainActivity Checking global and subscription-specific 'muted until' timestamp 1716303707155 2024-05-21 17:01:47.155 D NtfyApiService Checking anonymous read against https://<MYSERVER>/<TOPIC> 1716303722159 2024-05-21 17:02:02.159 W NtfyAddFragment Connection to topic failed: timeout Exception: java.io.InterruptedIOException: timeout at okhttp3.internal.connection.RealCall.timeoutExit(RealCall.kt:398) at okhttp3.internal.connection.RealCall.callDone(RealCall.kt:360) at okhttp3.internal.connection.RealCall.noMoreExchanges$okhttp(RealCall.kt:325) at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:209) at okhttp3.internal.connection.RealCall.execute(RealCall.kt:154) at io.heckel.ntfy.msg.ApiService.checkAuth(ApiService.kt:156) at io.heckel.ntfy.ui.AddFragment$checkReadAndMaybeShowLogin$1.invokeSuspend(AddFragment.kt:209) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42) at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:749) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664) Caused by: java.io.IOException: Canceled at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:72) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201) ... 11 more 1716303726092 2024-05-21 17:02:06.092 D NtfyMainActivity Checking global and subscription-specific 'muted until' timestamp 1716303727717 2024-05-21 17:02:07.717 D NtfySettingsActivity Create io.heckel.ntfy.ui.SettingsActivity@a09e9e4 ``` :crystal_ball: **Additional context** *What works* 1. From my phone, open the web app on my domain name, which though Traefik redirects to the Ntfy server. Things work. 2. From my phone, and from the Android app, connect directly to the Ntfy server (bypassing Traefik, using a different port opened by Docker). Things work (but only on insecure http connection, since Traefik handles certificates). *What does not work* From my phone, and from the Android app, connect to the Ntfy server through Traefik. I get a `timeout` error. Thanks.
BreizhHardware 2026-05-07 00:27:33 +02:00
  • closed this issue
  • added the
    🪲 bug
    label
Author
Owner

@wunter8 commented on GitHub (May 23, 2024):

Have you tried changing the connection type in the Android app? Settings > Advanced > Connection protocol

Switch it to the other and see if that fixes things

<!-- gh-comment-id:2127681236 --> @wunter8 commented on GitHub (May 23, 2024): Have you tried changing the connection type in the Android app? Settings > Advanced > Connection protocol Switch it to the other and see if that fixes things
Author
Owner

@maxjcohen commented on GitHub (May 25, 2024):

Somehow this did not immediately solve the issue, but after rebooting my phone subscribing and notifications work as expected. I'll close this for now, thanks for the advice.

<!-- gh-comment-id:2131318211 --> @maxjcohen commented on GitHub (May 25, 2024): Somehow this did not immediately solve the issue, but after rebooting my phone subscribing and notifications work as expected. I'll close this for now, thanks for the advice.
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#787
No description provided.