Calibre-Web Behind Traefik - Working but UI and Too Many Requests Issue

Hi,

I tried to ask this in the LinuxServer.io support group on Discord, but I have pointed this down to be an issue only when accessing calibre-web behind Traefik and they said they don't support Traefik so can't help with this.

Hopefully, someone has experienced the same issue and can assist or know what's going on.

I am experiencing this issue with Calibre web where the left side menu is always overlapping the UI no matter if I am reading a book or browsing. See screenshot. This is happening on mobile and desktop when accessing the docker service via subdomain.

I have completely pruned all calibre web folders/files and redeployed them twice, but it's the same every time.

See screenshot:

Then I tried domain name vs local and noticed that I am unable to expand any of the settings in my Traefik-hosted instance of calibre-web when accessing through the subdomain.

The URL just keeps updating to admin/viewconfig#collapsefour, admin/viewconfig#collapsesix instead of expanding the toggles. This is any of the settings under the admin page.

When accessing via local IP everything works fine.

Here's my docker-compose file:

services:
  # Calibre-Web - eBook Management
  calibre-web:
    image: lscr.io/linuxserver/calibre-web:nightly 
    container_name: calibre-web
    security_opt:
      - no-new-privileges:true
    restart: unless-stopped
    # profiles: ["media", "arrs", "all"]
    networks:
      - traefik_proxy
    ports:
      - "8083:8083"
    volumes:
      - $DOCKERDIR/appdata/calibre-web:/config
      - $DATADIR/BOOKS:/data/books
    environment:
      TZ: $TZ
      PUID: $PUID
      PGID: $PGID
    labels:
      - "traefik.enable=true"
      # HTTP Routers
      - "traefik.http.routers.calibre-web-rtr.entrypoints=websecure"
      - "traefik.http.routers.calibre-web-rtr.rule=Host(`ebooks.$DOMAINNAME_1`)"
      # Middlewares
      - "traefik.http.routers.calibre-web-rtr.middlewares=chain-no-auth@file"
      # HTTP Services
      - "traefik.http.routers.calibre-web-rtr.service=calibre-web-svc"
      - "traefik.http.services.calibre-web-svc.loadbalancer.server.port=8083"
services:
  # Traefik 2 - Reverse Proxy
  traefik:
    container_name: traefik
    image: traefik:3.0.1
    security_opt:
      - no-new-privileges:true
    restart: unless-stopped
    # profiles: ["core", "all"]
    networks:
      traefik_proxy:
        # ipv4_address: # You can specify a static IP
      socket_proxy:
    command: # CLI arguments
      - --global.checkNewVersion=true
      - --global.sendAnonymousUsage=true
      - --entrypoints.web.address=:80
      - --entrypoints.websecure.address=:443
      - --entrypoints.traefik.address=:8080
      - --entrypoints.websecure.http.tls=true
      - --entrypoints.web.http.redirections.entrypoint.to=websecure
      - --entrypoints.web.http.redirections.entrypoint.scheme=https
      - --entrypoints.web.http.redirections.entrypoint.permanent=true
      - --api=true
      - --api.dashboard=true
      # - --api.insecure=true
      #- --serversTransport.insecureSkipVerify=true
      # Allow these IPs to set the X-Forwarded-* headers - Cloudflare IPs: https://www.cloudflare.com/ips/
      - --entrypoints.websecure.forwardedHeaders.trustedIPs=$CLOUDFLARE_IPS,$LOCAL_IPS
      - --log=true
      - --log.filePath=/logs/traefik.log
      - --log.level=INFO # (Default: error) DEBUG, INFO, WARN, ERROR, FATAL, PANIC
      - --accessLog=true
      - --accessLog.filePath=/logs/access.log
      - --accessLog.bufferingSize=100 # Configuring a buffer of 100 lines
      - --accessLog.filters.statusCodes=204-299,400-499,500-599
      - --providers.docker=true
      # - --providers.docker.endpoint=unix:///var/run/docker.sock # Disable for Socket Proxy. Enable otherwise.
      - --providers.docker.endpoint=tcp://socket-proxy:2375 # Enable for Socket Proxy. Disable otherwise.
      - --providers.docker.exposedByDefault=false
      - --providers.docker.network=traefik_proxy 
      # - --providers.docker.swarmMode=false
      - --entrypoints.websecure.http.tls.options=tls-opts@file
      # Add dns-cloudflare as default certresolver for all services. Also enables TLS and no need to specify on individual services
      - --entrypoints.websecure.http.tls.certresolver=dns-cloudflare
      - --entrypoints.websecure.http.tls.domains[0].main=$DOMAINNAME_1
      - --entrypoints.websecure.http.tls.domains[0].sans=*.$DOMAINNAME_1
      # - --entrypoints.websecure.http.tls.domains[1].main=$DOMAINNAME_2 # Pulls main cert for second domain
      # - --entrypoints.websecure.http.tls.domains[1].sans=*.$DOMAINNAME_2 # Pulls wildcard cert for second domain
      - --providers.file.directory=/rules # Load dynamic configuration from one or more .toml or .yml files in a directory
      - --providers.file.watch=true # Only works on top level files in the rules folder
      # - --certificatesResolvers.dns-cloudflare.acme.caServer=https://acme-staging-v02.api.letsencrypt.org/directory # LetsEncrypt Staging Server - uncomment when testing
      - --certificatesResolvers.dns-cloudflare.acme.storage=/acme.json
      - --certificatesResolvers.dns-cloudflare.acme.dnsChallenge.provider=cloudflare
      - --certificatesResolvers.dns-cloudflare.acme.dnsChallenge.resolvers=1.1.1.1:53,1.0.0.1:53
      - --certificatesResolvers.dns-cloudflare.acme.dnsChallenge.delayBeforeCheck=90 # To delay DNS check and reduce LE hitrate
    ports:
      - target: 80
        published: 80
        protocol: tcp
        mode: host
      - target: 443
        published: 443
        protocol: tcp
        mode: host
      # - target: 8080 # need to enable --api.insecure=true
      #  published: 8085
      #  protocol: tcp
      #  mode: host

I tried to Inspect and monitor the console and I saw error 429 - Too Many Requests, so I removed the middlewares-rate-limit for now and the error is gone. But now when I go to my subdomain calibre-web just keeps loading and loading and the issue stays the same.

These are the middleware I have currently.

image

I have about 25 other apps behind Traefik and no issues with those so far, but I tried to search the internet and I don't see anyone having a similar issue so I wonder if it would be something to do with my Traefik setup.

Please help, thanks

Can you just inline your compose file here?

Updated my post to include the compose file as an inline, thanks.

Add Traefik compose and make sure to include the network part.

Sorry, my post got flagged, you should see the traefik compose in there now, thanks for helping.

How do you create that?

Do you need to set the base address in the application? Wordpress for example stores the initial URL and will always redirect to it.

Just via the Traefik compose file.

I looked it up online after you mentioned it, doesn't seem like I need to. The linuxserver.io image supports reverse proxy by default as far as I could read.

Check your browser developer tools network tab for requests and responses.

Already tried that. I was getting error 429.then I removed the rate limit middleware. The error no longer showed but calibre behaviour did not change.

No other errors other than that.

Reduce complexity, remove unneeded middlewares to test.

A rate limiter on a web app loading many images seems counter-intuitive.

Have you enabled and checked Traefik debug log (link)?

Thanks let me try disabling Middlewares one by one.

This is the error I was getting in console before disabling rate limit middleware.

You can enable Traefik access log in JSON format to see if the errors come from target service (OriginStatus) or from Traefik (DownstreamStatus).

@bluepuma77 So I enabled debug logs and this is all that I see in there when I access calibre-web.

I also tried disabling all the middlewares but no dice.

The only thing that I see now and wasn't showing before are these error messages in the console:

I also tried another docker container. Some random one on Git Hub.

And it seems to work and I don't have this issue with it. Seems like something stupid to do with the LSIO container for some reason.

How do I check to see if anyone else is having this same issue?

I am searching the internet and finding nothing, my setup can't be that special.

You can check Reddit - Dive into anything , which seems quite active.

Thank you, I appreciate you taking the time to help me out here.

I have created a post on reddit.

https://www.reddit.com/r/Traefik/s/3dniQMBhgX

Hmm, what’s going on there?

Sorry, this post has been removed by the moderators of r/Traefik.