[GH-ISSUE #1261] Image download issue when not on wifi #891

Closed
opened 2026-05-07 00:28:30 +02:00 by BreizhHardware · 7 comments

Originally created by @witterally on GitHub (Jan 19, 2025).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/1261

🐞 Describe the bug

I have several notifications set up and within them an image is attached, showing on the alert itself. Typically I'm on Wi-Fi but I've noticed that if an alert comes in while on my mobile network, I'll get a "download failed" error for the image.

💻 Components impacted

Android app

💡 Screenshots and/or logs

Screenshot
Log

🔮 Additional context

Example error from log while connected to mobile network:

NtfyAttachDownload Attachment download failed
Exception:
java.net.UnknownHostException: Unable to resolve host "m.media-amazon.com": No address associated with hostname
at java.net.Inet6AddressImpl.lookupHostByName(Inet6AddressImpl.java:156)
at java.net.Inet6AddressImpl.lookupAllHostAddr(Inet6AddressImpl.java:103)
at java.net.InetAddress.getAllByName(InetAddress.java:1152)

Originally created by @witterally on GitHub (Jan 19, 2025). Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/1261 :lady_beetle: **Describe the bug** <!-- A clear and concise description of the problem. --> I have several notifications set up and within them an image is attached, showing on the alert itself. Typically I'm on Wi-Fi but I've noticed that if an alert comes in while on my mobile network, I'll get a "download failed" error for the image. :computer: **Components impacted** <!-- ntfy server, Android app, iOS app, web app --> 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 --> [Screenshot](https://i.imgur.com/NHygIFR.png) [Log](https://nopaste.net/pXHO7nHP1A) :crystal_ball: **Additional context** <!-- Add any other context about the problem here. --> Example error from log while connected to mobile network: NtfyAttachDownload Attachment download failed Exception: java.net.UnknownHostException: Unable to resolve host "m.media-amazon.com": No address associated with hostname at java.net.Inet6AddressImpl.lookupHostByName(Inet6AddressImpl.java:156) at java.net.Inet6AddressImpl.lookupAllHostAddr(Inet6AddressImpl.java:103) at java.net.InetAddress.getAllByName(InetAddress.java:1152)
BreizhHardware 2026-05-07 00:28:30 +02:00
  • closed this issue
  • added the
    🪲 bug
    label
Author
Owner

@wunter8 commented on GitHub (Jan 19, 2025):

It's possible your base-url configuration isn't set correctly. It's used to generate the attachment url. Make sure the base-url is a publicly accessible domain name/IP address and port that can be used to access the ntfy server when you're not on WiFi

<!-- gh-comment-id:2600372054 --> @wunter8 commented on GitHub (Jan 19, 2025): It's possible your `base-url` configuration isn't set correctly. It's used to generate the attachment url. Make sure the `base-url` is a publicly accessible domain name/IP address and port that can be used to access the ntfy server when you're not on WiFi
Author
Owner

@witterally commented on GitHub (Jan 19, 2025):

Thanks for the reply. I'm using ntfy servers and not self-hosting. Would that still be applicable?

<!-- gh-comment-id:2600485867 --> @witterally commented on GitHub (Jan 19, 2025): Thanks for the reply. I'm using ntfy servers and not self-hosting. Would that still be applicable?
Author
Owner

@wunter8 commented on GitHub (Jan 19, 2025):

Oh. No. Using the public instance, image attachments should work fine...

Looking closer at the error, it appears to be a DNS error with Amazon?

Unable to resolve host "m.media-amazon.com": No address associated with hostname

I'm not sure why that would be. Attachments are served by the ntfy server, which isn't even hosted on AWS.

These are attached "local files," right? Not just image URL links?

<!-- gh-comment-id:2600526419 --> @wunter8 commented on GitHub (Jan 19, 2025): Oh. No. Using the public instance, image attachments should work fine... Looking closer at the error, it appears to be a DNS error with Amazon? > Unable to resolve host "m.media-amazon.com": No address associated with hostname I'm not sure why that would be. Attachments are served by the ntfy server, which isn't even hosted on AWS. These are attached "local files," right? Not just image URL links?
Author
Owner

@witterally commented on GitHub (Jan 19, 2025):

Yes they are local. If I take that host address and visit it while on wifi the page resolves and just has a message that says "OK". If I turn wifi off and it's only my cell network, I get a 403 error.

The Amazon link is hosted there because they are alerts for Amazon products via the site.

<!-- gh-comment-id:2600692922 --> @witterally commented on GitHub (Jan 19, 2025): Yes they are local. If I take that host address and visit it while on wifi the page resolves and just has a message that says "OK". If I turn wifi off and it's only my cell network, I get a 403 error. The Amazon link is hosted there because they are alerts for Amazon products via the site.
Author
Owner

@witterally commented on GitHub (Jan 19, 2025):

This doesn't seem to be an issue with ntfy itself so I'll get out of your hair. It's possibly something I need to figure out with my mobile network. I was hoping that by changing the DNS it would help but no luck there.

Thanks again!

<!-- gh-comment-id:2600887656 --> @witterally commented on GitHub (Jan 19, 2025): This doesn't seem to be an issue with ntfy itself so I'll get out of your hair. It's possibly something I need to figure out with my mobile network. I was hoping that by changing the DNS it would help but no luck there. Thanks again!
Author
Owner

@witterally commented on GitHub (Jan 19, 2025):

The resolution seems to be enabling mobile background data usage for ntfy in Android. Doh! It's working now.

<!-- gh-comment-id:2600930002 --> @witterally commented on GitHub (Jan 19, 2025): The resolution seems to be enabling mobile background data usage for ntfy in Android. Doh! It's working now.
Author
Owner

@wunter8 commented on GitHub (Jan 19, 2025):

Glad you got it figured out!

<!-- gh-comment-id:2600930698 --> @wunter8 commented on GitHub (Jan 19, 2025): Glad you got it figured out!
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#891
No description provided.