Traefik 2.2.1 Middleware problem

Hello

Im using Traefik in kubernetes and i have such problem. With Traefik 2.2.1 looks like Middlwares are not working, with previous version i do not have problems. Here is my error from logs:

E0708 18:01:01.046756       1 reflector.go:153] pkg/mod/k8s.io/client-go@v0.17.3/tools/cache/reflector.go:105: Failed to list *v1alpha1.Middleware: v1alpha1.MiddlewareList.Items: []v1alpha1.Middleware: v1alpha1.Middleware.Spec: v1alpha1.MiddlewareSpec.Headers: dynamic.Headers.AddVaryHeader: ReadBool: expect t or f, but found ", error found in #10 byte of ...|yHeader":"true"}}},{|..., bigger context ...|n":"*","accessControlMaxAge":100,"addVaryHeader":"true"}}},{"apiVersion":"traefik.containo.us/v1alph|...
E0708 18:01:02.049556       1 reflector.go:153] pkg/mod/k8s.io/client-go@v0.17.3/tools/cache/reflector.go:105: Failed to list *v1alpha1.Middleware: v1alpha1.MiddlewareList.Items: []v1alpha1.Middleware: v1alpha1.Middleware.Spec: v1alpha1.MiddlewareSpec.Headers: dynamic.Headers.AddVaryHeader: ReadBool: expect t or f, but found ", error found in #10 byte of ...|yHeader":"true"}}}],|..., bigger context ...|n":"*","accessControlMaxAge":100,"addVaryHeader":"true"}}}],"kind":"MiddlewareList","metadata":{"con|...

Is it same problem what is mentioned here. Log is looking very similar but it is not exactly that same.

Hi @holo,

Could you share a configuration with a reproducible case ?

Hello

Here are our Middleware configs:

apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
  name: cors
spec:
  headers:
    accessControlAllowMethods:
      - "GET"
      - "POST"
      - "DELETE"
      - "OPTIONS"
      - "PUT"
    accessControlAllowHeaders:
      - Origin
      - X-Requested-With
      - Content-Type
      - Accept
      - auth-token
      - Warning-Message
      - Authentication
      - Authorization
    accessControlAllowOrigin: "*"
    accessControlMaxAge: 100
    addVaryHeader: "true"

---

apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
  name: stripprefix
spec:
  stripPrefix:
    prefixes:
      - /prefix-1/
      - /prefix-2/
      - /prefix-3/

And how we use it:

apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: prefix-1-ingressroute
spec:
  entryPoints:
    - web
  routes:
    - match: Host(`branch123.domain.pl`) && PathPrefix(`/prefix-1/`)
      kind: Rule
      priority: 2
      services:
        - name: prefix-1-svc
          port: 8051
      middlewares:
        - name: cors
        - name: stripprefix
...

Could you try :
addVaryHeader: true

Thank You!
This change fix issue

Have a nice day! :slight_smile:

1 Like