Error "Recovered from panic in http handler: net/http: abort Handler"

Hello,

I'm currently issuing a recurrent error (multiple times every ~6h):

level=error msg="Recovered from panic in http handler: net/http: abort Handler" middlewareType=Recovery middlewareName=traefik-internal-recovery

I have 2 entrypoints, 9 HTTP Routers, 6 HTTP services, 2 middlewares. Metrics on InfluxDB + Accesslog enabled.

Sorry, I don't know how to reproduce it. Do you have any idea?

If you want more details, just ask. :slight_smile:

Thanks for reading.

1 Like

Hello,

could you provide the full stacktrace and more information about your context (configuration, docker-compose files, version, ...)

Sure, here all my Traefik-related configurations. (I've changed my real domain by example.com).

For the stacktrace, sorry, I just have the log message I posted.

# devops/docker-compose.yml
version: '3.5'
networks:
    traefik:
        name: traefik
volumes:
    influxdb: ~
services:
    traefik:
        image: traefik:v2.0
        ports:
            - 0.0.0.0:80:80
            - 0.0.0.0:443:443
        networks:
            - traefik
        volumes:
            - /var/run/docker.sock:/var/run/docker.sock
            - ./log:/var/log/traefik
            - ./traefik.yml:/etc/traefik/traefik.yml
            - ./traefik_dynamic.yml:/dynamic_conf.yml
            - ./acme.json:/acme.json
        labels:
            - "traefik.enable=true"
            - "traefik.http.routers.dashboard.rule=Host(`traefik.example.com`)"
            - "traefik.http.routers.dashboard.entrypoints=web-secure"
            - "traefik.http.routers.dashboard.service=api@internal"
            - "traefik.http.routers.dashboard.tls.certresolver=ovh_acme"
            - "traefik.http.routers.dashboard.middlewares=auth-admin@file"
        restart: unless-stopped
    redis-commander:
        image: rediscommander/redis-commander:latest
        labels:
            - "traefik.enable=true"
            - "traefik.http.routers.redis-commander.rule=Host(`redis.example.com`)"
            - "traefik.http.routers.redis-commander.entrypoints=web-secure"
            - "traefik.http.services.redis-commander.loadbalancer.server.port=8081"
            - "traefik.http.routers.redis-commander.tls.certresolver=ovh_acme"
            - "traefik.http.routers.redis-commander.middlewares=auth-admin@file"
        networks:
            - traefik
        ports:
            - 127.0.0.1:8081:8081
        restart: unless-stopped
    influxdb:
        image: influxdb:1.7-alpine
        networks:
            - traefik
    grafana:
        image: grafana/grafana:latest
        networks:
            - traefik
        labels:
            - "traefik.enable=true"
            - "traefik.http.routers.grafana.rule=Host(`grafana.example.com`)"
            - "traefik.http.routers.grafana.entrypoints=web-secure"
            - "traefik.http.services.grafana.loadbalancer.server.port=3000"
            - "traefik.http.routers.grafana.tls.certresolver=ovh_acme"
            - "traefik.http.routers.grafana.middlewares=auth-admin@file"
# devops/traefik.yml
log:
    level: INFO
accessLog:
    filePath: "/var/log/traefik/access.log"
    bufferingSize: 100

entryPoints:
    web:
        address: ":80"
    web-secure:
        address: ":443"
providers:
    file:
        filename: dynamic_conf.yml
    docker:
        exposedbydefault: false
        network: traefik
certificatesResolvers:
    ovh_acme:
        acme:
            email: foobar@example.com
            storage: acme.json
            dnsChallenge:
                provider: ovh
                delayBeforeCheck: 0
api:
    dashboard: true
metrics:
    influxDB:
        address: influxdb:8089
        protocol: udp
        pushInterval: 30
        database: default
        addEntryPointsLabels: true
        addServicesLabels: true
# devops/traefik_dynamic.yml
http:
    middlewares:
        auth-admin:
            basicAuth:
                users:
                    - 'admin:$2y$05$xxxxxx'
                realm: ForAdminOnly
                removeHeader: true
# example.com/docker-compose.yml
version: '3.5'
networks:
    traefik:
        external:
            name: traefik
services:
    apache:
        image: example_apache:${APP_VERSION:-latest}
        networks:
            - default
            - traefik
        labels:
            - "traefik.enable=true"
            - "traefik.http.routers.example.rule=Host(`example.com`)"
            - "traefik.http.routers.example.entrypoints=web-secure"
            - "traefik.http.services.example.loadbalancer.server.port=80"
            - "traefik.http.routers.example.tls.certresolver=ovh_acme"
            - "traefik.http.routers.example_insecure.rule=Host(`example.com`)"
            - "traefik.http.routers.example_insecure.entrypoints=web"
            - "traefik.http.routers.example_insecure.middlewares=redirect_https@docker"
            - "traefik.http.middlewares.redirect_https.redirectscheme.scheme=https"
            - "traefik.http.middlewares.redirect_https.redirectscheme.permanent=true"
    # other internal services
# blog/docker-compose.yml
version: '3.5'
networks:
    traefik:
        external:
            name: traefik
services:
    ghost:
        image: ghost:2-alpine
        restart: unless-stopped
        volumes:
            - ./content:/var/lib/ghost/content
        environment:
            url: 'https://blog.example.com'
        networks:
            - default
            - traefik
        labels:
            - "traefik.enable=true"
            - "traefik.http.routers.blog.rule=Host(`blog.example.com`)"
            - "traefik.http.routers.blog.entrypoints=web-secure"
            - "traefik.http.services.blog.loadbalancer.server.port=2368"
            - "traefik.http.routers.blog.tls.certresolver=ovh_acme"
            - "traefik.http.routers.blog_insecure.rule=Host(`blog.example.com`)"
            - "traefik.http.routers.blog_insecure.entrypoints=web"
            - "traefik.http.routers.blog_insecure.middlewares=redirect_https@docker"
# webext/docker-compose.yml
version: '3.5'
networks:
    traefik:
        external:
            name: traefik
services:
    apache:
        image: httpd:2.4-alpine
        networks:
            - traefik
        volumes:
            - ./builds:/srv/builds
            - ./httpd.conf:/usr/local/apache2/conf/httpd.conf
        labels:
            - "traefik.enable=true"
            - "traefik.http.routers.webext.rule=Host(`ext.example.com`)"
            - "traefik.http.routers.webext.entrypoints=web-secure"
            - "traefik.http.services.webext.loadbalancer.server.port=80"
            - "traefik.http.routers.webext.tls.certresolver=ovh_acme"
            - "traefik.http.routers.webext_insecure.rule=Host(`ext.example.com`)"
            - "traefik.http.routers.webext_insecure.entrypoints=web"
            - "traefik.http.routers.webext_insecure.middlewares=redirect_https@docker"

could you try a way to get the full stacktrace, I really need that to debug.

EDIT: the stacktrace is not displayed, I will improve this part.

Thanks for the PR https://github.com/containous/traefik/pull/5654. :slight_smile:

I'll post the stacktrace at the next version.