Traefik misinterpreting services listed with dynamic configuration file

I just upgraded from traefik 2.6.2 to traefik 2.8.5 -- didn't change anything in my static or dynamic configuration files. Traefik is now misinterpreting the services listed in dynamic configuration file under the http routers section. Let me post some examples and screenshots.

Here is a snippet of my dynamic configuration file:

http:
  routers:
    nc.domain.com:
      rule: "Host(`nc.domain.com`)"
      entryPoints:
        - web
        - websecure
      middlewares:
        - mw_nextcloud_host_header
        #- mw_compress_headers
        - mw_nextcloud_caldav
        - mw_security_headers
      service:
        - sv_proxy_pass_nc.domain.com
      tls:
        options: modern@file
        certResolver: le
        domains:
          - main: nc.domain.com
            sans:
              - nc.domain.com

Nothing really to speak of in the configuration file.

Here however is a screen capture of the dashboard:

Look how the service is listed: || 24 || sv_proxy_pass.nc.domain.com@file

What is the || 24 || part?
I'm getting an error because the router cant find a service literally named: || 24 || sv_proxy_pass.nc.domain.com@file

I have a service defined sv_proxy_pass.nc.domain.com@file (as defined in the same dynamic config file and confirmed on the dashboard).

All my router defined services in this file have the exact same || 24 || extension. Looks like a format error or something.

Hello,

it's because service in the router must be a string instead of an array.

http:
  routers:
    nc.domain.com:
      rule: "Host(`nc.domain.com`)"
      entryPoints:
        - web
        - websecure
      middlewares:
        - mw_nextcloud_host_header
        #- mw_compress_headers
        - mw_nextcloud_caldav
        - mw_security_headers
      service: sv_proxy_pass_nc.domain.com  ## <------ Here the fix
      tls:
        options: modern@file
        certResolver: le
        domains:
          - main: nc.domain.com
            sans:
              - nc.domain.com

One easy way to check whether a configuration file is well-formed is to validate it with:

1 Like

Hey thanks for the solution which it did work. Just a question however -- is this a recent change? My old configuration using an array worked for quite a long time.

service has always been a string, not an array.

Since v2.8 we fixed a bug around configuration, so now an error is reported when a configuration is invalid.

I see. Weird however, in the older versions using a single value within an array actually worked (as you probably know). So in the older versions no error was reported but the system still functioned. In the newer versions the error is reported (in a very cryptic way) and the system fails to work. I don't know a lot about programming and dealing with yaml structures, but my only take away from this would be that the error is reported in more clear manner. || 24 || means nothing to me although I'm interpreting this must mean wrong expected format.

Thank you for your help.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.