Hi, I'd like to ask for some help with using the error middleware with Traefik 3.7.5 on Docker. I'm getting an error which looks unrelated and I'm not sure if it's a configuration issue or a bug.
I'm trying to create an error middleware rewriting 403 to 500 but always get an unrelated error the service "@provider" does not exist when using it.
In the file provider:
local_ip:
IPAllowList:
sourceRange:
- 127.0.0.1/32
- 10.0.0.0/8
- 172.16.0.0/12
- 192.168.0.0/16
rewrite_status:
errors:
statusRewrites:
"403": 500
local_only:
chain:
middlewares:
- rewrite_status
- local_ip
In the docker compose:
labels:
- traefik.enable=true
- traefik.http.routers.test.rule=Host(`test.com`)
- traefik.http.routers.test.middlewares=local_only@file
Also tried using docker labels:
labels:
- traefik.enable=true
- traefik.http.routers.test.rule=Host(`test.com`)
- traefik.http.middlewares.rewrite_stat.errors.statusRewrites.403=500
- traefik.http.routers.test.middlewares=test_mw
- traefik.http.middlewares.test_mw.chain.middlewares=local_ip@file,rewrite_stat
The local_ip@file middleware on its own works well. It allows to quickly test from a mobile connection.
Accessing test.com gives a 404.
On the traefik dashboard, the error middleware shows an error:
- the service "@file" does not exist when using the file provider (local_only@file)
- the service "@docker" does not exist when using docker labels (test_mw)
When the middleware is not used in a chain or a label, it shows up in the dashboard with no error.
The error message is really puzzling as the providers do exist and work which does not help me identify what the issue could be here.