Skip to content

[Bug] Jellyseerr container image incompatible with Kubernetes DNS resolution (minimal musl-based image issues) #1613

Closed as not planned

Description

@EgorBryantsev

Description

When deploying Jellyseerr into a Kubernetes environment (with CoreDNS), the container image (fallenbagel/jellyseerr:latest) fails to properly resolve service names or external domains inside the pod when using standard Kubernetes DNS (dnsPolicy: ClusterFirst).

This causes things like fetch errors to TMDB, Github api, etc and http 500 in web ui.

Changing the jellyseerr deployment to:

spec:
  template:
    spec:
      dnsPolicy: None
      dnsConfig:
        nameservers:
          - 8.8.8.8
          - 1.1.1.1

fixes this (but breaks internal k8s dns resolution, e.g. jellyfin or radarr).

This is a known issue as per the k8 docs:

Some Linux distributions (e.g. Ubuntu) use a local DNS resolver by default (systemd-resolved). Systemd-resolved moves and replaces /etc/resolv.conf with a stub file that can cause a fatal forwarding loop when resolving names in upstream servers. This can be fixed manually by using kubelet's --resolv-conf flag to point to the correct resolv.conf (With systemd-resolved, this is /run/systemd/resolve/resolv.conf). kubeadm automatically detects systemd-resolved, and adjusts the kubelet flags accordingly.

Kubernetes installs do not configure the nodes' resolv.conf files to use the cluster DNS by default, because that process is inherently distribution-specific. This should probably be implemented eventually.

Linux's libc (a.k.a. glibc) has a limit for the DNS nameserver records to 3 by default and Kubernetes needs to consume 1 nameserver record. This means that if a local installation already uses 3 nameservers, some of those entries will be lost. To work around this limit, the node can run dnsmasq, which will provide more nameserver entries. You can also use kubelet's --resolv-conf flag.

If you are using Alpine version 3.17 or earlier as your base image, DNS may not work properly due to a design issue with Alpine. Until musl version 1.24 didn't include TCP fallback to the DNS stub resolver meaning any DNS call above 512 bytes would fail. Please upgrade your images to Alpine version 3.18 or above.

As far as i can tell the helm chart for jellyseerr uses the same image, so has the same problem.

Version

2.5.2

Steps to Reproduce

  1. Deploy using yaml files (deployment, service, ingress, etc) using dnsPolicy: ClusterFirst.
  2. Try to load web ui.
  3. Web ui gives error 500, Failed to fetch errors in log. (external DNS queries like nslookup work, but application-layer fetches fail).

Screenshots

No response

Logs

[warn][GitHub API]: Failed to retrieve GitHub releases. This may be an issue on GitHub's end. Jellyseerr can't check if it's on the latest version. {"errorMessage":"fetch failed"}

[debug][API]: Something went wrong retrieving regions {"errorMessage":"[TMDB] Failed to fetch countries: fetch failed"}
[debug][API]: Something went wrong retrieving languages {"errorMessage":"[TMDB] Failed to fetch languages: fetch failed"}
[debug][API]: Something went wrong retrieving trending items {"errorMessage":"[TMDB] Failed to fetch all trending: fetch failed"}
[debug][API]: Something went wrong retrieving the movie genre slider {"errorMessage":"[TMDB] Failed to fetch movie genres: fetch failed"}
[debug][API]: Something went wrong retrieving popular movies {"errorMessage":"[TMDB] Failed to fetch discover movies: fetch failed"}
[debug][API]: Something went wrong retrieving popular series {"errorMessage":"[TMDB] Failed to fetch discover TV: fetch failed"}
[debug][API]: Something went wrong retrieving the series genre slider {"errorMessage":"[TMDB] Failed to fetch TV genres: fetch failed"}

Platform

desktop

Database

SQLite (default)

Device

Desktop

Operating System

Ubuntu 24.04, k8s v1.32

Browser

Firefox

Additional Context

No response

Code of Conduct

  • I agree to follow Jellyseerr's Code of Conduct

Activity

  1. added
    awaiting triage
    bug
    on Apr 27, 2025
  2. fallenbagel commented on Apr 28, 2025

    @fallenbagel
    Member

    Please try with develop tag.

  3. M0NsTeRRR commented on Apr 28, 2025

    @M0NsTeRRR
    Member

    Hello,

    I use dnsPolicy: ClusterFirst in a dual-stack cluster (Ubuntu Server with k3s), and so far I have had no issues resolving domains inside my cluster, within my local network, or on the internet (e.g., the TMDB API).

    Some Linux distributions (e.g. Ubuntu) use a local DNS resolver by default (systemd-resolved). Systemd-resolved moves and replaces /etc/resolv.conf with a stub file that can cause a fatal forwarding loop when resolving names in upstream servers. This can be fixed manually by using kubelet's --resolv-conf flag to point to the correct resolv.conf (With systemd-resolved, this is /run/systemd/resolve/resolv.conf). kubeadm automatically detects systemd-resolved, and adjusts the kubelet flags accordingly.
    Kubernetes installs do not configure the nodes' resolv.conf files to use the cluster DNS by default, because that process is inherently distribution-specific. This should probably be implemented eventually.
    Linux's libc (a.k.a. glibc) has a limit for the DNS nameserver records to 3 by default and Kubernetes needs to consume 1 nameserver record. This means that if a local installation already uses 3 nameservers, some of those entries will be lost. To work around this limit, the node can run dnsmasq, which will provide more nameserver entries. You can also use kubelet's --resolv-conf flag.

    It's more likely a cluster configuration issue, or maybe I didn't understand your point. 😄

    If you are using Alpine version 3.17 or earlier as your base image, DNS may not work properly due to a design issue with Alpine. Until musl version 1.24 didn't include TCP fallback to the DNS stub resolver meaning any DNS call above 512 bytes would fail. Please upgrade your images to Alpine version 3.18 or above.

    The Jellyseerr image uses Alpine 3.21, so it shouldn't be affected by what you mentioned.

    /app # uname -a
    Linux jellyseerr-jellyseerr-chart-568486b9f6-kzz6f 6.8.0-51-generic #52-Ubuntu SMP ....
    /app # cat /etc/alpine-release
    3.21.3
    
  4. EgorBryantsev commented on Apr 28, 2025

    @EgorBryantsev
    Author

    Please try with develop tag.

    The same error happens with fallenbagel/jellyseerr:develop.


    I used kubeadm for my cluster, and apart from jellyseerr, dns works for other pods (at least for debian/ubuntu based pods). Maybe it's a k3s vs kubeadm thing.

    In the jellyseerr pod, nslookup works (can resolve domains), but app-level requests like fetch, apk add, etc fail. /etc/resolv.conf inside the pod also points to the correct coredns IP, and kubelet has the correct --resolv-conf=/run/systemd/resolve/resolv.conf flag.

    To be honest I started using k8s only few weeks ago because I ran out of things to do in my homelab, so it could just be me messing something up. This does seem like a musl-based alpine problem though, glibc containers work fine.

    @M0NsTeRRR Could you share your jellyseerr deployment.yaml/helm-values.yaml? Also, are you using systemd-resolved?

    Thanks for the help.

    / # nslookup google.com
    Server:		10.96.0.10
    Address:	10.96.0.10:53
    
    Non-authoritative answer:
    Name:	google.com
    Address: 142.250.179.142
    
    Non-authoritative answer:
    Name:	google.com
    Address: 2a00:1450:400e:803::200e
    
    / # apk add curl
    fetch https://dl-cdn.alpinelinux.org/alpine/v3.21/main/x86_64/APKINDEX.tar.gz
    WARNING: updating and opening https://dl-cdn.alpinelinux.org/alpine/v3.21/main: DNS lookup error
    fetch https://dl-cdn.alpinelinux.org/alpine/v3.21/community/x86_64/APKINDEX.tar.gz
    WARNING: updating and opening https://dl-cdn.alpinelinux.org/alpine/v3.21/community: DNS lookup error
    ERROR: unable to select packages:
      curl (no such package):
        required by: world[curl]
    
  5. M0NsTeRRR commented on Apr 28, 2025

    @M0NsTeRRR
    Member

    Could you share your jellyseerr deployment.yaml/helm-values.yaml?

    https://github.com/M0NsTeRRR/homelabv3-infra/tree/main/argocd/media/jellyseerr

    Also, are you using systemd-resolved?

    Yes

    [Resolve]
    DNS=192.168.10.21#dns1.unicornafk.fr 192.168.10.22#dns2.unicornafk.fr 2a0c:b641:2c0:110::21#dns1.unicornafk.fr 2a0c:b641:2c0:110::22#dns2.unicornafk.fr
    FallbackDNS=9.9.9.9#dns.quad9.net 149.112.112.112#dns.quad9.net 2620:fe::fe#dns.quad9.net 2620:fe::9#dns.quad9.net
    Domains=unicornafk.fr
    DNSSEC=true
    DNSOverTLS=true
    #MulticastDNS=no
    #LLMNR=no
    #Cache=no-negative
    #CacheFromLocalhost=no
    #DNSStubListener=yes
    #DNSStubListenerExtra=
    #ReadEtcHosts=yes
    #ResolveUnicastSingleLabel=noroot
    

    In the jellyseerr pod, nslookup works (can resolve domains), but app-level requests like fetch, apk add, etc fail. /etc/resolv.conf inside the pod also points to the correct coredns IP, and kubelet has the correct --resolv-conf=/run/systemd/resolve/resolv.conf flag.

    apk add also works for me.
    Looks like more the global fetch/axios issue @fallenbagel is it the same behaviour on docker (nslookup work but apk etc... not) ?

  6. fallenbagel commented on Apr 28, 2025

    @fallenbagel
    Member

    @M0NsTeRRR we dont use fetch anymore in develop. It's axios.

  7. EgorBryantsev commented on Apr 28, 2025

    @EgorBryantsev
    Author

    Changing the jellyseerr deployment to:

    spec:
      template:
        spec:
          dnsConfig:
            options:
              - name: ndots
                value: "1"
    

    fixes it. Is this just a limitation of musl?

  8. M0NsTeRRR commented on Apr 29, 2025

    @M0NsTeRRR
    Member

    Not as I know as it works for me with 4 nameservers

  9. added and removed
    bug
    awaiting triage
    on Apr 30, 2025
  10. ccureau commented on Jul 1, 2025

    @ccureau

    I can confirm that this is related to IPv6 being enabled in the cluster. I disabled by setting the appropriate lines in /etc/sysctl.conf and restarted all nodes, and all of my communication between pods works as expected.

    If @EgorBryantsev still has their original setup, I wonder if it would be enough to set spec.ipFamilyPolicy to SingleStack in each of the services would make a difference.

    I'll eventually get to testing it myself, but that's for another day.

  11. M0NsTeRRR commented on Jul 1, 2025

    @M0NsTeRRR
    Member

    It's maybe related to #1747. I haven't had access to my cluster so far, but I think I use IPv4 first, and you might have IPv6 first it's why I've never faced the issue until somebody reported it.

  12. M0NsTeRRR commented on Jul 15, 2025

    @M0NsTeRRR
    Member

    I've made some fixes regarding IPv6, and I believe the axios issue is related to fetch failed error. If you could test it, @EgorBryantsev and @ccureau, with the updated develop image, that would be great.

  13. Monoboy4ik commented on Jul 22, 2025

    @Monoboy4ik

    version 2.7.2

    2025-07-22T07:34:12.064Z [debug][API]: Something went wrong retrieving regions{"errorMessage":"[TMDB] Failed to fetch countries: Hostname/IP does not match certificate's altnames: Host: api.themoviedb.org. is not in the cert's altnames: DNS:synology.monoboy.ru"}

    its another bug?

  14. M0NsTeRRR commented on Jul 22, 2025

    @M0NsTeRRR
    Member

    Not the same issue at least.

  15. Monoboy4ik commented on Jul 22, 2025

    @Monoboy4ik

    Not the same issue at least.

    thx!
    restart container resolved problem....

  16. gauthier-th commented on Jul 22, 2025

    @gauthier-th
    Member

    @EgorBryantsev can this be closed?

  17. github-actions commented on Oct 5, 2025

    @github-actions

    This issue is stale because it has been open 30 days with no activity. Please provide an update or the requested information to keep it open.

  18. github-actions commented on Nov 4, 2025

    @github-actions

    This issue was closed because it has been stalled for 30 days with no activity. Feel free to reopen it once you provide the required update or information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions