Skip to content

Issue with Path Frontend Rule in Docker Swarm #2278

@mattlawnz

Description

@mattlawnz

Do you want to request a feature or report a bug?

BUG

What did you do?

I was configuring a couple of backends that were going to be accessed with a Specific Path on the default domain.
Our Environment is Docker Swarm.
We are deploying all containers via stack files
traefik has been deployed (via stack, whose configuration is futher down), and is part of the proxy network to which all stacks are deployed into.

The labels we added to one of the stack files are like this:

      labels:
        - "traefik.port=8092"
        - "traefik.docker.network=proxy"
        - "traefix.protocol=http"
        - "traefik.tags=solr-update"
        - "traefik.backend=solr-update"
        - "traefik.frontend.rule=Path:/solr-update"

Note that when we deploy a stack with a specific Host entry, it works fine.

I have tried adding a HOST entry as part of the traefik.frontend.rule, but that did not work.

What did you expect to see?

I expected to see a working http connection to the container.

What did you see instead?

I saw a 404 Not Found.

Here are the results of curl connections to the container:

curl -v http://10.0.0.10:8092/solr-update/healthcheck
* Hostname was NOT found in DNS cache
*   Trying 10.0.0.10...
* Connected to 10.0.0.10 (10.0.0.10) port 8092 (#0)
> GET /solr-update/healthcheck HTTP/1.1
> User-Agent: curl/7.35.0
> Host: 10.0.0.10:8092
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Thu, 19 Oct 2017 02:11:31 GMT
< Content-Type: text/plain; charset=utf-8
* Server Kestrel is not blacklisted
< Server: Kestrel
< Transfer-Encoding: chunked
<
OK - Solr-Update
 ConfigName: Testing
 SolrServer: http://IT205183.thewarehousegroup.net:8983
 User      : UpdateUser
 Password  : ************
* Connection #0 to host 10.0.0.10 left intact

and via traefik:

curl -v http://whakldman01d.thewarehousegroup.net/solr-update/healthcheck
* About to connect() to whakldman01d.thewarehousegroup.net port 80 (#0)
*   Trying 10.1.2.170...
* Connected to whakldman01d.thewarehousegroup.net (10.1.2.170) port 80 (#0)
> GET /solr-update/healthcheck HTTP/1.1
> User-Agent: curl/7.29.0
> Host: whakldman01d.thewarehousegroup.net
> Accept: */*
>
< HTTP/1.1 404 Not Found
< Content-Type: text/plain; charset=utf-8
< X-Content-Type-Options: nosniff
< Date: Thu, 19 Oct 2017 02:14:16 GMT
< Content-Length: 19
<
404 page not found
* Connection #0 to host whakldman01d.thewarehousegroup.net left intact

Output of traefik version: (What version of Traefik are you using?)

Version:      v1.4.0
Codename:     roquefort
Go version:   go1.9.1
Built:        2017-10-16_04:52:07PM
OS/Arch:      linux/amd64

What is your environment & configuration (arguments, toml, provider, platform, ...)?

Traefik is deplyed via a stack file, which is below:

version: "3"

services:

  traefik:
    image: traefik
    ports:
      - 80:80
      - 443:443
      - 8080:8080
    networks:
      - proxy
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    command: -c /dev/null
      - --web
      - --docker
      - --docker.domain=whakldman01d.thewarehousegroup.net
      - --docker.watch
      - --logLevel=DEBUG
      - --docker.swarmmode=true
      - --docker.exposedbydefault=true
      - --defaultEntryPoints='http'
    deploy:
      replicas: 1
      restart_policy:
        condition: on-failure
        delay: 10s
        max_attempts: 12
        window: 200s
      resources:
        limits:
          cpus: '0.5'
          memory: 20M

networks:
  proxy:
    external: true

If applicable, please paste the log output in debug mode (--debug switch)

time="2017-10-18T22:02:28Z" level=info msg="Using TOML configuration file /dev/null"
time="2017-10-18T22:02:28Z" level=info msg="Traefik version v1.4.0 built on 2017-10-16_04:52:07PM"
time="2017-10-18T22:02:28Z" level=debug msg="Global configuration loaded {"GraceTimeOut":10000000000,"Debug":false,"CheckNewVersion":true,"AccessLogsFile":"","AccessLog":null,"TraefikLogsFi
le":"","LogLevel":"DEBUG","EntryPoints":{"http":{"Network":"","Address":":80","TLS":null,"Redirect":null,"Auth":null,"WhitelistSourceRange":null,"Compress":false,"ProxyProtocol":null,"Forwa
rdedHeaders":{"Insecure":true,"TrustedIPs":null}}},"Cluster":null,"Constraints":[],"ACME":null,"DefaultEntryPoints":["http"],"ProvidersThrottleDuration":2000000000,"MaxIdleConnsPerHost":200
,"IdleTimeout":0,"InsecureSkipVerify":false,"RootCAs":null,"Retry":null,"HealthCheck":{"Interval":30000000000},"RespondingTimeouts":null,"ForwardingTimeouts":null,"Docker":{"Watch":true,"Fi
lename":"","Constraints":null,"Trace":false,"DebugLogGeneratedTemplate":false,"Endpoint":"unix:///var/run/docker.sock","Domain":"whakldman01d.thewarehousegroup.net","TLS":null,"ExposedByDef
ault":true,"UseBindPortIP":false,"SwarmMode":true},"File":null,"Web":{"Address":":8080","CertFile":"","KeyFile":"","ReadOnly":false,"Statistics":null,"Metrics":null,"Path":"","Auth":null,"D
ebug":false,"CurrentConfigurations":null,"Stats":null,"StatsRecorder":null},"Marathon":null,"Consul":null,"ConsulCatalog":null,"Etcd":null,"Zookeeper":null,"Boltdb":null,"Kubernetes":null,"
Mesos":null,"Eureka":null,"ECS":null,"Rancher":null,"DynamoDB":null}"
time="2017-10-18T22:02:29Z" level=info msg="Preparing server http &{Network: Address::80 TLS:<nil> Redirect:<nil> Auth:<nil> WhitelistSourceRange:[] Compress:false ProxyProtocol:<nil> Forwa
rdedHeaders:0xc420584e00} with readTimeout=0s writeTimeout=0s idleTimeout=3m0s"
time="2017-10-18T22:02:29Z" level=info msg="Starting server on :80"
time="2017-10-18T22:02:29Z" level=info msg="Starting provider *docker.Provider {"Watch":true,"Filename":"","Constraints":null,"Trace":false,"DebugLogGeneratedTemplate":false,"Endpoint":"uni
x:///var/run/docker.sock","Domain":"whakldman01d.thewarehousegroup.net","TLS":null,"ExposedByDefault":true,"UseBindPortIP":false,"SwarmMode":true}"
time="2017-10-18T22:02:29Z" level=info msg="Starting provider *web.Provider {"Address":":8080","CertFile":"","KeyFile":"","ReadOnly":false,"Statistics":null,"Metrics":null,"Path":"","Auth":
null,"Debug":false,"CurrentConfigurations":{},"Stats":{"Uptime":"2017-10-18T22:02:29.061284825Z","Pid":1,"ResponseCounts":{},"TotalResponseCounts":{},"TotalResponseTime":"0001-01-01T00:00:0
0Z"},"StatsRecorder":null}"
time="2017-10-18T22:02:29Z" level=debug msg="Provider connection established with docker 17.06.2-ce (API 1.30)"
time="2017-10-18T22:02:30Z" level=debug msg="Filtering container without port and no traefik.port label traefik_traefik.1"
time="2017-10-18T22:02:30Z" level=debug msg="Configuration received from provider docker: {}"
time="2017-10-18T22:02:30Z" level=debug msg="Last docker config received more than %!s(flaeg.Duration=2000000000), OK"
time="2017-10-18T22:02:30Z" level=info msg="Server configuration reloaded on :80"
time="2017-10-19T01:09:46Z" level=debug msg="Creating frontend frontend-Path-solr-update"
time="2017-10-19T01:09:46Z" level=debug msg="Wiring frontend frontend-Path-solr-update to entryPoint http"
time="2017-10-19T01:09:46Z" level=debug msg="Creating route route-frontend-Path-solr-update Path:/solr-update"
time="2017-10-19T01:09:46Z" level=debug msg="Creating backend backend-solr-update"
time="2017-10-19T01:09:46Z" level=debug msg="Creating load-balancer wrr"
time="2017-10-19T01:09:46Z" level=debug msg="Creating server server-solr-update_update-service-1 at http://10.0.0.10:8092 with weight 0"
time="2017-10-19T01:09:46Z" level=info msg="Server configuration reloaded on :80"
time="2017-10-19T01:10:01Z" level=debug msg="Filtering container without port and no traefik.port label traefik_traefik.1"
time="2017-10-19T01:10:02Z" level=debug msg="Validation of load balancer method for backend backend-image-cache failed: invalid load-balancing method ''. Using default method wrr."
time="2017-10-19T01:10:02Z" level=debug msg="Validation of load balancer method for backend backend-portainer failed: invalid load-balancing method ''. Using default method wrr."
time="2017-10-19T01:10:02Z" level=debug msg="Validation of load balancer method for backend backend-solr-update failed: invalid load-balancing method ''. Using default method wrr."
time="2017-10-19T01:10:02Z" level=debug msg="Configuration received from provider docker: {"backends":{"backend-image-cache":{"servers":{"server-image-cache_imagecache-1":{"url":"http://10.
0.0.7:8080","weight":0},"server-image-cache_imagecache-2":{"url":"http://10.0.0.8:8080","weight":0}},"loadBalancer":{"method":"wrr"}},"backend-portainer":{"servers":{"server-portainer_porta
iner-1":{"url":"http://10.0.0.5:9000","weight":0}},"loadBalancer":{"method":"wrr"}},"backend-solr-update":{"servers":{"server-solr-update_update-service-1":{"url":"http://10.0.0.10:8092","w
eight":0}},"loadBalancer":{"method":"wrr"}}},"frontends":{"frontend-Host-portainer-dev-thewarehousegroup-net":{"entryPoints":["http"],"backend":"backend-portainer","routes":{"route-frontend
-Host-portainer-dev-thewarehousegroup-net":{"rule":"Host:portainer-dev.thewarehousegroup.net"}},"passHostHeader":true,"priority":0,"basicAuth":[],"headers":{}},"frontend-Path-productImage":
{"entryPoints":["http"],"backend":"backend-image-cache","routes":{"route-frontend-Path-productImage":{"rule":"Path:/productImage"}},"passHostHeader":true,"priority":0,"basicAuth":[],"header
s":{}},"frontend-Path-solr-update":{"entryPoints":["http"],"backend":"backend-solr-update","routes":{"route-frontend-Path-solr-update":{"rule":"Path:/solr-update"}},"passHostHeader":true,"p
riority":0,"basicAuth":[],"headers":{}}}}"

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions