Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provider=swarm - Gateway time-out Error code 504 #10743

Closed
2 tasks done
jrCleber opened this issue May 20, 2024 · 1 comment
Closed
2 tasks done

provider=swarm - Gateway time-out Error code 504 #10743

jrCleber opened this issue May 20, 2024 · 1 comment

Comments

@jrCleber
Copy link

Welcome!

  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've searched similar issues on the Traefik community forum and didn't find any.

What did you do?

I'm testing traefik using binaries from version 2.11.2 and 3.0.0. traefik is running outside of docker.

With the file provider and docker, the middleware, router and services function smoothly. But when I change docker to swarm mode, the routing fails and I get error 504 in the browser.

I opened this question on the community forum, but I haven't gotten a satisfactory answer yet.


routely

What did you see instead?

I receive the error in the browser: Gateway time-out Error code 504

I work with docker, docker swarm and file providers. I would like to point out that the error only occurs when swarm mode is enabled, both in version 2 and version 3.

What version of Traefik are you using?

2.11.2 and 3.0.0

What is your environment & configuration?

[global]
  checkNewVersion = false
  sendAnonymousUsage = false

[entryPoints]
  [entryPoints.websecure]
    address = ":443"
    [entryPoints.websecure.http]
      tls = {  }

  [entryPoints.web]
    address = ":80"
    [entryPoints.web.http]
      [entryPoints.web.http.redirections]
        [entryPoints.web.http.redirections.entryPoint]
          to = "websecure"
          scheme = "https"
          permanent = true
          priority = 1

[log]
  level = "DEBUG"
  filePath = "./log/traefik.json"
  format = "json"
  maxSize = 100
  maxAge = 30

[accessLog]
  filePath = "./log/access.log"
  format = "json"
  bufferingSize = 100

[api]
  dashboard = true

[providers]
  [providers.file]
  filename = "./dynamic/conf.toml"
  watch = true

  # V2.11.2
  [providers.docker]
    swarmMode = true
    endpoint = "unix:///var/run/docker.sock"
    exposedByDefault = false
    network = "public_network"
    watch = true
    
  # V3.0.0
  # [providers.swarm]
  #   endpoint = "unix:///var/run/docker.sock"
  #   exposedByDefault = false
  #   network = "public_network"
  #   watch = true

[certificatesResolvers.letsencryptresolver.acme]
  email = "admin@test.com"
  storage = "./letsencrypt/acme.json"
  [certificatesResolvers.letsencryptresolver.acme.httpChallenge]
    entryPoint = "web"
labels:
  - 'traefik.enable=true'
  - 'traefik.docker.network=public_network'
  - 'traefik.http.routers.portainer.rule=Host(`deploybox.domain.com`)'
  - 'traefik.http.routers.portainer.entrypoints=websecure'
  - 'traefik.http.routers.portainer.priority=1'
  - 'traefik.http.routers.portainer.tls.certresolver=letsencryptresolver'
  - 'traefik.http.routers.portainer.service=portainer'
  - 'traefik.http.services.portainer.loadbalancer.server.port=9000'

If applicable, please paste the log output in DEBUG level

{
  "level": "debug",
  "error": "dial tcp 10.0.1.15:9000: i/o timeout",
  "time": "2024-05-20T11:03:10Z",
  "caller": "github.com/traefik/traefik/v3/pkg/server/service/proxy.go:100",
  "message": "504 Gateway Timeout"
}
{
  "time": "2024-05-20T11:23:26Z",
  "caller": "log/log.go:245",
  "level": "debug",
  "message": "http: TLS handshake error from 87.236.176.111:36259: tls: client offered only unsupported versions: [302 301]"
}
@emilevauge
Copy link
Member

emilevauge commented May 23, 2024

Hi @jrCleber, as bluepuma77 already answered on the forum, it looks like your Traefik instance is not part of the Docker Overlay Network, hence can't access to the containers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants