[GH-ISSUE #1181] Android App timeout on self hosted instance #834

Closed
opened 2026-05-07 00:27:52 +02:00 by BreizhHardware · 6 comments

Originally created by @BennoLossin on GitHub (Sep 14, 2024).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/1181

🐞 Describe the bug
Cannot connect to any topic from android app (both fdroid and playstore version) to self hosted ntfy instance. The web interface works without any problems on both PC and my phone.

💻 Components impacted
Android app

💡 Screenshots and/or logs

android log
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.19.318-perf
Android: 14 (SDK 34)
Model: [REDACTED]
Product: [REDACTED]

--
Settings:                    
{
  "autoDeleteSeconds": 2592000,
  "autoDownloadMaxSize": 102400,
  "broadcastEnabled": true,
  "connectionProtocol": "jsonhttp",
  "darkMode": -1,
  "defaultBaseUrl": "https://ntfy.[REDACTED]",
  "lastSharedTopics": [],
  "minPriority": 1,
  "mutedUntil": 0,
  "recordLogs": true
}

Logs
--

1726315687939 2024-09-14 14:08:07.939 D NtfyLog Log was truncated
1726315689008 2024-09-14 14:08:09.008 D NtfySubscriberMgr Enqueuing work to refresh subscriber service
1726315689017 2024-09-14 14:08:09.017 D NtfyMainActivity Battery: ignoring optimizations = false (we want this to be true); instant subscriptions = false; remind time reached = true; banner = false
1726315694395 2024-09-14 14:08:14.395 D NtfyApiService Checking read access for user [REDACTED] against https://ntfy.[REDACTED]/[REDACTED]
1726315709404 2024-09-14 14:08:29.404 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

1726315710740 2024-09-14 14:08:30.740 D NtfyMainActivity Checking global and subscription-specific 'muted until' timestamp
1726315712440 2024-09-14 14:08:32.440 D NtfySettingsActivity Create io.heckel.ntfy.ui.SettingsActivity@d951924

There is nothing logged by the server when I try to connect using the android app, even under the trace log level.

server.yml
attachment-cache-dir: /var/lib/ntfy-sh/attachments
auth-default-access: deny-all
auth-file: /var/lib/ntfy-sh/user.db
base-url: http://ntfy.[REDACTED]
behin-proxy: true
cache-duration: 24h
cache-file: /var/lib/ntfy-sh/cache-file.db
listen-http: :2586
log-level: trace
ntfy-admin-name: [REDACTED]
nginx config for ntfy
        server {
                listen 0.0.0.0:80 ;
                listen [::0]:80 ;
                server_name ntfy.[REDACTED] ;
                location / {
                        return 301 https://$host$request_uri;
                }
        }
        server {
                listen 0.0.0.0:443 ssl ;
                listen [::0]:443 ssl ;
                server_name ntfy.[REDACTED] ;
                http2 on;
                ssl_certificate [REDACTED];
                ssl_certificate_key [REDACTED];
                ssl_trusted_certificate [REDACTED];
                location / {
                        proxy_pass http://127.0.0.1:2586;
                        proxy_http_version 1.1;
                        proxy_set_header Upgrade $http_upgrade;
                        proxy_set_header Connection $connection_upgrade;
                        client_max_body_size 0;
                        proxy_buffering off;
                        proxy_request_buffering off;
                        proxy_redirect off;
                        proxy_set_header        Host $host;
                        proxy_set_header        X-Real-IP $remote_addr;
                        proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
                        proxy_set_header        X-Forwarded-Proto $scheme;
                        proxy_set_header        X-Forwarded-Host $host;
                        proxy_set_header        X-Forwarded-Server $host;
                }
        }

🔮 Additional context

Seems to be the same issue as reported in #1116, but rebooting the phone and switching the communication method did not fix my issue.

Originally created by @BennoLossin on GitHub (Sep 14, 2024). Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/1181 :lady_beetle: **Describe the bug** Cannot connect to any topic from android app (both fdroid and playstore version) to self hosted ntfy instance. The web interface works without any problems on both PC and my phone. :computer: **Components impacted** Android app :bulb: **Screenshots and/or logs** <!-- If applicable, add screenshots or share logs help explain your problem. To get logs from the ... - ntfy server: Enable "log-level: trace" in your server.yml file - Android app: Go to "Settings" -> "Record logs", then eventually "Copy/upload logs" - web app: Press "F12" and find the "Console" window --> <details><summary>android log</summary> ```text 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.19.318-perf Android: 14 (SDK 34) Model: [REDACTED] Product: [REDACTED] -- Settings: { "autoDeleteSeconds": 2592000, "autoDownloadMaxSize": 102400, "broadcastEnabled": true, "connectionProtocol": "jsonhttp", "darkMode": -1, "defaultBaseUrl": "https://ntfy.[REDACTED]", "lastSharedTopics": [], "minPriority": 1, "mutedUntil": 0, "recordLogs": true } Logs -- 1726315687939 2024-09-14 14:08:07.939 D NtfyLog Log was truncated 1726315689008 2024-09-14 14:08:09.008 D NtfySubscriberMgr Enqueuing work to refresh subscriber service 1726315689017 2024-09-14 14:08:09.017 D NtfyMainActivity Battery: ignoring optimizations = false (we want this to be true); instant subscriptions = false; remind time reached = true; banner = false 1726315694395 2024-09-14 14:08:14.395 D NtfyApiService Checking read access for user [REDACTED] against https://ntfy.[REDACTED]/[REDACTED] 1726315709404 2024-09-14 14:08:29.404 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 1726315710740 2024-09-14 14:08:30.740 D NtfyMainActivity Checking global and subscription-specific 'muted until' timestamp 1726315712440 2024-09-14 14:08:32.440 D NtfySettingsActivity Create io.heckel.ntfy.ui.SettingsActivity@d951924 ``` </details> There is *nothing* logged by the server when I try to connect using the android app, even under the trace log level. <details><summary> server.yml </summary> ```yml attachment-cache-dir: /var/lib/ntfy-sh/attachments auth-default-access: deny-all auth-file: /var/lib/ntfy-sh/user.db base-url: http://ntfy.[REDACTED] behin-proxy: true cache-duration: 24h cache-file: /var/lib/ntfy-sh/cache-file.db listen-http: :2586 log-level: trace ntfy-admin-name: [REDACTED] ``` </details> <details><summary>nginx config for ntfy</summary> ```text server { listen 0.0.0.0:80 ; listen [::0]:80 ; server_name ntfy.[REDACTED] ; location / { return 301 https://$host$request_uri; } } server { listen 0.0.0.0:443 ssl ; listen [::0]:443 ssl ; server_name ntfy.[REDACTED] ; http2 on; ssl_certificate [REDACTED]; ssl_certificate_key [REDACTED]; ssl_trusted_certificate [REDACTED]; location / { proxy_pass http://127.0.0.1:2586; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; client_max_body_size 0; proxy_buffering off; proxy_request_buffering off; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Server $host; } } ``` </details> :crystal_ball: **Additional context** <!-- Add any other context about the problem here. --> Seems to be the same issue as reported in #1116, but rebooting the phone and switching the communication method did not fix my issue.
BreizhHardware 2026-05-07 00:27:52 +02:00
  • closed this issue
  • added the
    🪲 bug
    label
Author
Owner

@gerrix1701 commented on GitHub (Sep 15, 2024):

Same issue here after upgrading server from Ubuntu 22.04 to 24.04. Going back to 22.04 resolves the issue. Maybe related to nginx? I used same nginx config (the one suggested here: https://docs.ntfy.sh/config/#__tabbed_11_2) with both versions of nginx (1.18.0 and 1.24.0).

<!-- gh-comment-id:2351481049 --> @gerrix1701 commented on GitHub (Sep 15, 2024): Same issue here after upgrading server from Ubuntu 22.04 to 24.04. Going back to 22.04 resolves the issue. Maybe related to nginx? I used same nginx config (the one suggested here: https://docs.ntfy.sh/config/#__tabbed_11_2) with both versions of nginx (1.18.0 and 1.24.0).
Author
Owner

@BennoLossin commented on GitHub (Sep 15, 2024):

I am on nixos 24.05 with nginx version 1.26.2

<!-- gh-comment-id:2351653483 --> @BennoLossin commented on GitHub (Sep 15, 2024): I am on nixos 24.05 with nginx version 1.26.2
Author
Owner

@BennoLossin commented on GitHub (Sep 15, 2024):

I noticed that my ipv6 configuration was wrong and my server was reachable only through ipv4 (but it still had dns records for ipv6). I fixed that now and it works. @gerrix1701 maybe that is also your issue?

<!-- gh-comment-id:2351799309 --> @BennoLossin commented on GitHub (Sep 15, 2024): I noticed that my ipv6 configuration was wrong and my server was reachable only through ipv4 (but it still had dns records for ipv6). I fixed that now and it works. @gerrix1701 maybe that is also your issue?
Author
Owner

@gerrix1701 commented on GitHub (Sep 18, 2024):

I checked my configuration and it did not change when updating to Ubuntu 24.04:

  • same nginx config
  • did not change DNS records
  • firewall rules for IPv4 + IPv6
    It's really strange. The issue came with the update and went away after downgrade of the OS. Unfortunately, I couldn't find anything in the server logs. Maybe I'll try again later to upgrade again and see if I can find anything. Anyway, thanks @y86-dev !
<!-- gh-comment-id:2358908724 --> @gerrix1701 commented on GitHub (Sep 18, 2024): I checked my configuration and it did not change when updating to Ubuntu 24.04: - same nginx config - did not change DNS records - firewall rules for IPv4 + IPv6 It's really strange. The issue came with the update and went away after downgrade of the OS. Unfortunately, I couldn't find anything in the server logs. Maybe I'll try again later to upgrade again and see if I can find anything. Anyway, thanks @y86-dev !
Author
Owner

@shashank-brdj commented on GitHub (Jul 31, 2025):

I noticed that my ipv6 configuration was wrong and my server was reachable only through ipv4 (but it still had dns records for ipv6). I fixed that now and it works

Hi @BennoLossin ,
I am facing a similar issue with android app after upgrading to ubuntu 24.04

I am running ntfy behind nginx reverse proxy.
Not sure what is causing this.
Can you kindly let me know if i need to make any changes in nginx config?

server {
        listen 80;
        listen [::]:80;
        server_name url.example.com;

        return 301 https://url.example.com;
}

server {
        listen 443;
        listen [::]:443;
        server_name url.example.com;

        ssl_certificate /var/www/ssl/example_certificate.pem;
        ssl_certificate_key /var/www/ssl/example_private.key;

        auth_basic "Restricted space";
        auth_basic_user_file /etc/nginx/.htpasswd;

        location / {
                proxy_pass http://127.0.0.1:1234;
                proxy_set_header   X-Real-IP $remote_addr;
                proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header   Upgrade $http_upgrade;
                proxy_set_header   Connection "upgrade";

                proxy_connect_timeout 3m;
                proxy_send_timeout 3m;
                proxy_read_timeout 3m;
        }
}

Not sure what the issue is. android app works under wifi. So clearly an ipv6 issue, due to mobile data.
My docker compose is below

version: "2.3"

services:
  ntfy:
    image: binwiederhier/ntfy:v2.13
    container_name: ntfy-server
    command:
      - serve
    environment:
      - TZ=Asia/Kolkata
    volumes:
      - /somevolume/ntfy_data/var:/var/cache/ntfy
      - /somevolume/ntfy_data/etc:/etc/ntfy
    ports:
      - 1234:80
    restart: unless-stopped

Any help will be appreciated @binwiederhier

<!-- gh-comment-id:3139182184 --> @shashank-brdj commented on GitHub (Jul 31, 2025): > I noticed that my ipv6 configuration was wrong and my server was reachable only through ipv4 (but it still had dns records for ipv6). I fixed that now and it works Hi @BennoLossin , I am facing a similar issue with android app after upgrading to ubuntu 24.04 I am running ntfy behind nginx reverse proxy. Not sure what is causing this. Can you kindly let me know if i need to make any changes in nginx config? ``` server { listen 80; listen [::]:80; server_name url.example.com; return 301 https://url.example.com; } server { listen 443; listen [::]:443; server_name url.example.com; ssl_certificate /var/www/ssl/example_certificate.pem; ssl_certificate_key /var/www/ssl/example_private.key; auth_basic "Restricted space"; auth_basic_user_file /etc/nginx/.htpasswd; location / { proxy_pass http://127.0.0.1:1234; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_connect_timeout 3m; proxy_send_timeout 3m; proxy_read_timeout 3m; } } ``` Not sure what the issue is. android app works under wifi. So clearly an ipv6 issue, due to mobile data. My docker compose is below ``` version: "2.3" services: ntfy: image: binwiederhier/ntfy:v2.13 container_name: ntfy-server command: - serve environment: - TZ=Asia/Kolkata volumes: - /somevolume/ntfy_data/var:/var/cache/ntfy - /somevolume/ntfy_data/etc:/etc/ntfy ports: - 1234:80 restart: unless-stopped ``` Any help will be appreciated @binwiederhier
Author
Owner

@shashank-brdj commented on GitHub (Aug 3, 2025):

Figured out the issue. Nothing wrong with the app or ubuntu update.
My mobile carrier (Airtel) had done some CGNAT blocking to Cloudflare endpoint IPs.

Since i use Cloudflare for most of my HomeLab routing, the site was not loading on my mobile sim. However, they were loading on Wi-Fi. I paused Cloudflare and changed the endpoint CDN IPs and the new IP was issued.

Now everything is working again like before!
Cheers!

<!-- gh-comment-id:3148490931 --> @shashank-brdj commented on GitHub (Aug 3, 2025): Figured out the issue. Nothing wrong with the app or ubuntu update. My mobile carrier (Airtel) had done some CGNAT blocking to Cloudflare endpoint IPs. Since i use Cloudflare for most of my HomeLab routing, the site was not loading on my mobile sim. However, they were loading on Wi-Fi. I paused Cloudflare and changed the endpoint CDN IPs and the new IP was issued. Now everything is working again like before! Cheers!
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#834
No description provided.