Am I setting services correctly?

I am new to traefik, what I understood that I can use only one entrypoint to get traefik to do routing or the redirection to the correct service. For that I have set up a traefik container and two services, the traefik container is working fine and only one service is getting redirected and I can browse it from chrome. The same labels are used for a second container but for sure with different URL and loadbalancer settings, unfortunately, I am not able to see the result in the browser only for the second service. I have read the docs and don't know what is the mistake I am doing please see bellow configuration:

traefik container:

version: '3.7'

services:

  traefik:
    # Use the latest Traefik image
    image: traefik:v2.4.6
    ports:
      - target: 80
        published: 8000
        mode: host

    deploy:
      placement:
        constraints:
          - node.role == manager
      replicas: 1
      update_config:
        parallelism: 2
        delay: 10s
      restart_policy:
        condition: on-failure
      labels:
        - traefik.enable=true
        - traefik.docker.network=khotaba_network
        - traefik.http.routers.traefik.rule=Host(`manager.${DOMAIN?Variable not set}`)
        - traefik.http.routers.traefik.service=api@internal
        - traefik.http.services.traefik.loadbalancer.server.port=8080
        - traefik.http.routers.traefik.entrypoints=http
        - traefik.http.routers.traefik.middlewares=admin-auth
        - traefik.http.middlewares.admin-auth.basicauth.users=${USERNAME?Variable not set}:${HASHED_PASSWORD?Variable not set}
        
        # middleware redirect
        - traefik.http.middlewares.redirect-to-http.redirectscheme.scheme=http

    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
    command:
      - --api.insecure=true
      - --providers.docker
      - --providers.docker.exposedbydefault=false
      - --providers.docker.swarmmode
      - --entrypoints.http.address=:80
      - --accesslog
      - --log
      - --api
    networks:
      - khotaba_network

networks:
  khotaba_network:
    external: true

the configuration of the first service

version: '3.7'
services:
  
  khotabaa-gateway:
    image: khotabaa-gateway-service
    deploy:
      replicas: 2
      update_config:
        parallelism: 2
        delay: 10s
      restart_policy:
        condition: on-failure
      labels:
        - traefik.enable=true
        - traefik.docker.network=khotaba_network
        - traefik.http.routers.khotabaa-gateway.rule=Host(`gateway.${DOMAIN?Variable not set}`)
        - traefik.http.services.khotabaa-gateway.loadbalancer.server.port=9002
        - traefik.http.routers.khotabaa-gateway.entrypoints=http


    environment:
      IDENTITY_AUTHORITY_URI: 'http://172.16.8.3:5001'
      USER_API_URI: 'http://khotabaa-user-service:5006'
      POEM_API_URI: 'http://khotabaa-poem-service:5007'
      MAJLES_API_URI: 'http://khotabaa-majles-service:5008'
      NOTIFICATION_API_URI: 'http://khotabaa-notification-service:5009'
    ports:
      - 9002:9002
    networks:
      - khotaba_network

networks:
  khotaba_network:
    external: true

these are working fine! and I can browse the urls and see the result. Now when I add the second service with same configuration as gateway service, I am not able to get redircted to this service, this is how i label it:

version: '3.7'
services:

  khotabaa-identity-service:
    image: khotabaa-identity-service
    deploy:
      replicas: 2
      update_config:
        parallelism: 2
        delay: 10s
      restart_policy:
        condition: on-failure
      labels:
        - traefik.enable=true
        - traefik.docker.network=khotaba_network
        - traefik.http.routers.khotabaa-identity-service.rule=Host(`identity.${DOMAIN?Variable not set}`)
        - traefik.http.services.khotabaa-identity-service.loadbalancer.server.port=5001
        - "traefik.http.routers.khotabaa-identity-service.entrypoints=http"

    environment:
      IDENTITY_ISSUER_URI: 'http://172.16.8.3:5001'
      GATEWAY_USER_URI: 'http://172.16.8.3:9002/v0.1/user'
      CERT_PASSWORD: ${CERT_PASSWORD?Variable not set}
      CONNECTION_STRING: ${CONNECTION_STRING?Variable not set}
    ports:
      - '5001:5001'
    networks:
      - khotaba_network

networks:
  khotaba_network:
    external: true

each of the previous configurations has its one docker-compose and deployed as a stack under the same network as you see. Please any idea why it won't work? I have spent hours reading docs and I can't see any addition to what I have made.

here is a screenshot of the dashboard

I really appreciate your help guys :slight_smile:

Regards,

please I really need help with my issue :frowning:

Hello @mo3motto

Can you please check whether port 5001 in khotabaa-identity-service is correct?

You can also test it in the following way:

Assuming that khotaba_network is using Overlay network and it is Attachable you can run a test container, e.g.

docker run -it --rm --network khotaba_network alpine sh

Then install curl inside the container apk add curl and call the service by:

curl khotabaa-identity-service:5001

You should receive a response from your service.


I deployed your config files on Swarm using test applications (instead of your images) and I was able to reach both services.

hello @jakubhajek thanks for your reply, yes i did as you mention and can see the result
bellow is the result

.

and bellow a screenhost of the service running on 5001
docker service ls

and here is the docker ps result

CONTAINER ID   IMAGE                                  COMMAND                  CREATED         STATUS         PORTS                  NAMES
a1f7807d02b4   khotabaa-identity-service:latest       "dotnet Service.Khot…"   6 minutes ago   Up 6 minutes   5001/tcp               khotabaa-identity-service_khotabaa-identity-service.1.nyejb552br2jpptynsvpsqgeb
e0c50fcff780   khotabaa-identity-service:latest       "dotnet Service.Khot…"   6 minutes ago   Up 6 minutes   5001/tcp               khotabaa-identity-service_khotabaa-identity-service.2.6ltzkhnc9kixpe6fe5mohusw5
e5dcf2b00519   traefik:v2.4.6                         "/entrypoint.sh --ap…"   11 hours ago    Up 11 hours    0.0.0.0:8000->80/tcp   khotabaa-traefik-proxy_traefik.1.ogcbu2ifbv8rczq4e02947vf6
22ecbfb79dab   553119677e15                           "dotnet Service.Khot…"   25 hours ago    Up 25 hours    9002/tcp               khotabaa-gateway-service_khotabaa-ga

I really don't understand what could be the issue and how I can solve it :frowning:

Thanks for checking that.
What response do you get from identity.${DOMAIN}?

Before checking that please enable level log DEBUG and set log format to JSON and then restart the Traefik.

Here comes the result from the debug file:

please see entire file at this link:

time="2021-03-11T10:34:34Z" level=info msg="Configuration loaded from flags."
{"level":"info","msg":"Traefik version 2.4.6 built on 2021-03-01T18:25:05Z","time":"2021-03-11T10:34:34Z"}
{"level":"debug","msg":"Static configuration loaded {\"global\":{\"checkNewVersion\":true,\"sendAnonymousUsage\":true},\"serversTransport\":{\"maxIdleConnsPerHost\":200},\"entryPoints\":{\"http\":{\"address\":\":80\",\"transport\":{\"lifeCycle\":{\"graceTimeOut\":10000000000},\"respondingTimeouts\":{\"idleTimeout\":180000000000}},\"forwardedHeaders\":{},\"http\":{}},\"traefik\":{\"address\":\":8080\",\"transport\":{\"lifeCycle\":{\"graceTimeOut\":10000000000},\"respondingTimeouts\":{\"idleTimeout\":180000000000}},\"forwardedHeaders\":{},\"http\":{}}},\"providers\":{\"providersThrottleDuration\":2000000000,\"docker\":{\"watch\":true,\"endpoint\":\"unix:///var/run/docker.sock\",\"defaultRule\":\"Host(`{{ normalize .Name }}`)\",\"swarmMode\":true,\"swarmModeRefreshSeconds\":15000000000}},\"api\":{\"insecure\":true,\"dashboard\":true},\"log\":{\"level\":\"DEBUG\",\"format\":\"json\"},\"accessLog\":{\"format\":\"common\",\"filters\":{},\"fields\":{\"defaultMode\":\"keep\",\"headers\":{\"defaultMode\":\"drop\"}}},\"pilot\":{\"token\":\"e66fed11-947e-4c1f-b4b5-4f10ecc78f43\"}}","time":"2021-03-11T10:34:34Z"}
{"level":"info","msg":"Stats collection is enabled.","time":"2021-03-11T10:34:34Z"}
{"level":"info","msg":"Many thanks for contributing to Traefik's improvement by allowing us to receive anonymous information from your configuration.","time":"2021-03-11T10:34:34Z"}
{"level":"info","msg":"Help us improve Traefik by leaving this feature on :)","time":"2021-03-11T10:34:34Z"}
{"level":"info","msg":"More details on: https://doc.traefik.io/traefik/contributing/data-collection/","time":"2021-03-11T10:34:34Z"}
{"level":"info","msg":"Starting provider aggregator.ProviderAggregator {}","time":"2021-03-11T10:34:34Z"}
{"entryPointName":"http","level":"debug","msg":"Start TCP Server","time":"2021-03-11T10:34:34Z"}
{"entryPointName":"traefik","level":"debug","msg":"Start TCP Server","time":"2021-03-11T10:34:34Z"}
{"level":"info","msg":"Starting provider *traefik.Provider {}","time":"2021-03-11T10:34:34Z"}
{"level":"info","msg":"Starting provider *docker.Provider {\"watch\":true,\"endpoint\":\"unix:///var/run/docker.sock\",\"defaultRule\":\"Host(`{{ normalize .Name }}`)\",\"swarmMode\":true,\"swarmModeRefreshSeconds\":15000000000}","time":"2021-03-11T10:34:34Z"}
{"level":"info","msg":"Starting provider *acme.ChallengeTLSALPN {\"Timeout\":4000000000}","time":"2021-03-11T10:34:34Z"}
{"level":"debug","msg":"Configuration received from provider internal: {\"http\":{\"routers\":{\"api\":{\"entryPoints\":[\"traefik\"],\"service\":\"api@internal\",\"rule\":\"PathPrefix(`/api`)\",\"priority\":2147483646},\"dashboard\":{\"entryPoints\":[\"traefik\"],\"middlewares\":[\"dashboard_redirect@internal\",\"dashboard_stripprefix@internal\"],\"service\":\"dashboard@internal\",\"rule\":\"PathPrefix(`/`)\",\"priority\":2147483645}},\"services\":{\"api\":{},\"dashboard\":{},\"noop\":{}},\"middlewares\":{\"dashboard_redirect\":{\"redirectRegex\":{\"regex\":\"^(http:\\\\/\\\\/(\\\\[[\\\\w:.]+\\\\]|[\\\\w\\\\._-]+)(:\\\\d+)?)\\\\/$\",\"replacement\":\"${1}/dashboard/\",\"permanent\":true}},\"dashboard_stripprefix\":{\"stripPrefix\":{\"prefixes\":[\"/dashboard/\",\"/dashboard\"]}}},\"serversTransports\":{\"default\":{\"maxIdleConnsPerHost\":200}}},\"tcp\":{},\"tls\":{}}","providerName":"internal","time":"2021-03-11T10:34:34Z"}
{"entryPointName":"traefik","level":"debug","middlewareName":"tracing","middlewareType":"TracingForwarder","msg":"Added outgoing tracing middleware api@internal","routerName":"api@internal","time":"2021-03-11T10:34:34Z"}
{"entryPointName":"traefik","level":"debug","middlewareName":"tracing","middlewareType":"TracingForwarder","msg":"Added outgoing tracing middleware dashboard@internal","routerName":"dashboard@internal","time":"2021-03-11T10:34:34Z"}
{"entryPointName":"traefik","level":"debug","middlewareName":"dashboard_stripprefix@internal","middlewareType":"StripPrefix","msg":"Creating middleware","routerName":"dashboard@internal","time":"2021-03-11T10:34:34Z"}
{"entryPointName":"traefik","level":"debug","middlewareName":"dashboard_stripprefix@internal","msg":"Adding tracing to middleware","routerName":"dashboard@internal","time":"2021-03-11T10:34:34Z"}
{"entryPointName":"traefik","level":"debug","middlewareName":"dashboard_redirect@internal","middlewareType":"RedirectRegex","msg":"Creating middleware","routerName":"dashboard@internal","time":"2021-03-11T10:34:34Z"}
{"entryPointName":"traefik","level":"debug","middlewareName":"dashboard_redirect@internal","middlewareType":"RedirectRegex","msg":"Setting up redirection from ^(http:\\/\\/(\\[[\\w:.]+\\]|[\\w\\._-]+)(:\\d+)?)\\/$ to ${1}/dashboard/","routerName":"dashboard@internal","time":"2021-03-11T10:34:34Z"}
{"entryPointName":"traefik","level":"debug","middlewareName":"dashboard_redirect@internal","msg":"Adding tracing to middleware","routerName":"dashboard@internal","time":"2021-03-11T10:34:34Z"}
{"entryPointName":"traefik","level":"debug","middlewareName":"traefik-internal-recovery","middlewareType":"Recovery","msg":"Creating middleware","time":"2021-03-11T10:34:34Z"}
{"entryPointName":"http","level":"debug","middlewareName":"metrics-entrypoint","middlewareType":"Metrics","msg":"Creating middleware","time":"2021-03-11T10:34:34Z"}
{"entryPointName":"traefik","level":"debug","middlewareName":"metrics-entrypoint","middlewareType":"Metrics","msg":"Creating middleware","time":"2021-03-11T10:34:34Z"}
{"entryPointName":"http","level":"debug","middlewareName":"metrics-entrypoint","middlewareType":"Metrics","msg":"Creating middleware","time":"2021-03-11T10:34:34Z"}
{"entryPointName":"traefik","level":"debug","middlewareName":"metrics-entrypoint","middlewareType":"Metrics","msg":"Creating middleware","time":"2021-03-11T10:34:34Z"}
{"level":"debug","msg":"No default certificate, generating one","time":"2021-03-11T10:34:34Z"}
{"level":"debug","msg":"Provider connection established with docker 20.10.3 (API 1.41)","providerName":"docker","time":"2021-03-11T10:34:34Z"}
{"container":"khotabaa-majles-service-kjck3wu7sycytg90oowwnlu02","level":"debug","msg":"Filtering disabled container","providerName":"docker","time":"2021-03-11T10:34:34Z"}
{"container":"khotabaa-majles-service-td45tu3y2n5uan9zfvu8grskf","level":"debug","msg":"Filtering disabled container","providerName":"docker","time":"2021-03-11T10:34:34Z"}
{"container":"khotabaa-notification-service-jiwysekat9srx9q7qthr3a1py","level":"debug","msg":"Filtering disabled container","providerName":"docker","time":"2021-03-11T10:34:34Z"}
{"container":"khotabaa-notification-service-vubwf8ijzl4cuy4hr40wnbusz","level":"debug","msg":"Filtering disabled container","providerName":"docker","time":"2021-03-11T10:34:34Z"}
{"container":"khotabaa-user-service-mccp2a8889d2v43a6254gp4ao","level":"debug","msg":"Filtering disabled container","providerName":"docker","time":"2021-03-11T10:34:34Z"}
{"container":"khotabaa-user-service-uk536qxhdf4w23mf7hjxteumk","level":"debug","msg":"Filtering disabled container","providerName":"docker","time":"2021-03-11T10:34:34Z"}
{"container":"khotabaa-poem-service-itz4ugap9i4sseqe5moat48r6","level":"debug","msg":"Filtering disabled container","providerName":"docker","time":"2021-03-11T10:34:34Z"}
{"container":"khotabaa-poem-service-j1saedgmn7jaili2v21ni215g","level":"debug","msg":"Filtering disabled container","providerName":"docker","time":"2021-03-11T10:34:34Z"}
{"level":"debug","msg":"Configuration received from provider docker: {\"http\":{\"routers\":{\"khotabaa-gateway\":{\"entryPoints\":[\"http\"],\"service\":\"khotabaa-gateway\",\"rule\":\"Host(`gateway.moemortada.com`)\"},\"khotabaa-identity-service\":{\"entryPoints\":[\"http\"],\"service\":\"khotabaa-identity-service\",\"rule\":\"Host(`identity.moemortada.com`)\"},\"traefik\":{\"entryPoints\":[\"http\"],\"middlewares\":[\"admin-auth\"],\"service\":\"api@internal\",\"rule\":\"Host(`manager.moemortada.com`)\"}},\"services\":{\"khotabaa-gateway\":{\"loadBalancer\":{\"servers\":[{\"url\":\"http://10.0.4.38:9002\"},{\"url\":\"http://10.0.4.7:9002\"}],\"passHostHeader\":true}},\"khotabaa-identity-service\":{\"loadBalancer\":{\"servers\":[{\"url\":\"http://10.0.4.245:5001\"},{\"url\":\"http://10.0.4.246:5001\"}],\"passHostHeader\":true}},\"traefik\":{\"loadBalancer\":{\"servers\":[{\"url\":\"http://10.0.4.249:8080\"}],\"passHostHeader\":true}}},\"middlewares\":{\"admin-auth\":{\"basicAuth\":{\"users\":[\"admin:$apr1$fimNQZzP$n3Jktnk8pJdrWKIP1I2XA1\"]}},\"redirect-to-http\":{\"redirectScheme\":{\"scheme\":\"http\"}}}},\"tcp\":{},\"udp\":{}}","providerName":"docker","time":"2021-03-11T10:34:34Z"}
{"level":"debug","msg":"No default certificate, generating one","time":"2021-03-11T10:34:34Z"}
{"entryPointName":"traefik","level":"debug","middlewareName":"tracing","middlewareType":"TracingForwarder","msg":"Added outgoing tracing middleware api@internal","routerName":"api@internal","time":"2021-03-11T10:34:34Z"}
{"entryPointName":"traefik","level":"debug","middlewareName":"tracing","middlewareType":"TracingForwarder","msg":"Added outgoing tracing middleware dashboard@internal","routerName":"dashboard@internal","time":"2021-03-11T10:34:34Z"}
{"entryPointName":"traefik","level":"debug","middlewareName":"dashboard_stripprefix@internal","middlewareType":"StripPrefix","msg":"Creating middleware","routerName":"dashboard@internal","time":"2021-03-11T10:34:34Z"}
{"entryPointName":"traefik","level":"debug","middlewareName":"dashboard_stripprefix@internal","msg":"Adding tracing to middleware","routerName":"dashboard@internal","time":"2021-03-11T10:34:34Z"}
{"entryPointName":"traefik","level":"debug","middlewareName":"dashboard_redirect@internal","middlewareType":"RedirectRegex","msg":"Creating middleware","routerName":"dashboard@internal","time":"2021-03-11T10:34:34Z"}
{"entryPointName":"traefik","level":"debug","middlewareName":"dashboard_redirect@internal","middlewareType":"RedirectRegex","msg":"Setting up redirection from ^(http:\\/\\/(\\[[\\w:.]+\\]|[\\w\\._-]+)(:\\d+)?)\\/$ to ${1}/dashboard/","routerName":"dashboard@internal","time":"2021-03-11T10:34:34Z"}
{"entryPointName":"traefik","level":"debug","middlewareName":"dashboard_redirect@internal","msg":"Adding tracing to middleware","routerName":"dashboard@internal","time":"2021-03-11T10:34:34Z"}
{"entryPointName":"traefik","level":"debug","middlewareName":"traefik-internal-recovery","middlewareType":"Recovery","msg":"Creating middleware","time":"2021-03-11T10:34:34Z"}
{"entryPointName":"http","level":"debug","middlewareName":"pipelining","middlewareType":"Pipelining","msg":"Creating middleware","routerName":"khotabaa-gateway@docker","serviceName":"khotabaa-gateway","time":"2021-03-11T10:34:34Z"}
{"entryPointName":"http","level":"debug","middlewareName":"metrics-service","middlewareType":"Metrics","msg":"Creating middleware","routerName":"khotabaa-gateway@docker","serviceName":"khotabaa-gateway","time":"2021-03-11T10:34:34Z"}
{"entryPointName":"http","level":"debug","msg":"Creating load-balancer","routerName":"khotabaa-gateway@docker","serviceName":"khotabaa-gateway","time":"2021-03-11T10:34:34Z"}
{"entryPointName":"http","level":"debug","msg":"Creating server 0 http://10.0.4.38:9002","routerName":"khotabaa-gateway@docker","serverName":0,"serviceName":"khotabaa-gateway","time":"2021-03-11T10:34:34Z"}
{"entryPointName":"http","level":"debug","msg":"Creating server 1 http://10.0.4.7:9002","routerName":"khotabaa-gateway@docker","serverName":1,"serviceName":"khotabaa-gateway","time":"2021-03-11T10:34:34Z"}
{"entryPointName":"http","level":"debug","middlewareName":"tracing","middlewareType":"TracingForwarder","msg":"Added outgoing tracing middleware khotabaa-gateway","routerName":"khotabaa-gateway@docker","time":"2021-03-11T10:34:34Z"}
{"entryPointName":"http","level":"debug","middlewareName":"pipelining","middlewareType":"Pipelining","msg":"Creating middleware","routerName":"khotabaa-identity-service@docker","serviceName":"khotabaa-identity-service","time":"2021-03-11T10:34:34Z"}
{"entryPointName":"http","level":"debug","middlewareName":"metrics-service","middlewareType":"Metrics","msg":"Creating middleware","routerName":"khotabaa-identity-service@docker","serviceName":"khotabaa-identity-service","time":"2021-03-11T10:34:34Z"}
{"entryPointName":"http","level":"debug","msg":"Creating load-balancer","routerName":"khotabaa-identity-service@docker","serviceName":"khotabaa-identity-service","time":"2021-03-11T10:34:34Z"}
{"entryPointName":"http","level":"debug","msg":"Creating server 0 http://10.0.4.245:5001","routerName":"khotabaa-identity-service@docker","serverName":0,"serviceName":"khotabaa-identity-service","time":"2021-03-11T10:34:34Z"}
{"entryPointName":"http","level":"debug","msg":"Creating server 1 http://10.0.4.246:5001","routerName":"khotabaa-identity-service@docker","serverName":1,"serviceName":"khotabaa-identity-service","time":"2021-03-11T10:34:34Z"}
{"entryPointName":"http","level":"debug","middlewareName":"tracing","middlewareType":"TracingForwarder","msg":"Added outgoing tracing middleware khotabaa-identity-service","routerName":"khotabaa-identity-service@docker","time":"2021-03-11T10:34:34Z"}
{"entryPointName":"http","level":"debug","middlewareName":"tracing","middlewareType":"TracingForwarder","msg":"Added outgoing tracing middleware api@internal","routerName":"traefik@docker","time":"2021-03-11T10:34:34Z"}
{"entryPointName":"http","level":"debug","middlewareName":"admin-auth@docker","middlewareType":"BasicAuth","msg":"Creating middleware","routerName":"traefik@docker","time":"2021-03-11T10:34:34Z"}
{"entryPointName":"http","level":"debug","middlewareName":"admin-auth@docker","msg":"Adding tracing to middleware","routerName":"traefik@docker","time":"2021-03-11T10:34:34Z"}
{"entryPointName":"http","level":"debug","middlewareName":"traefik-internal-recovery","middlewareType":"Recovery","msg":"Creating middleware","time":"2021-03-11T10:34:34Z"}
{"entryPointName":"http","level":"debug","middlewareName":"metrics-entrypoint","middlewareType":"Metrics","msg":"Creating middleware","time":"2021-03-11T10:34:34Z"}
{"entryPointName":"traefik","level":"debug","middlewareName":"metrics-entrypoint","middlewareType":"Metrics","msg":"Creating middleware","time":"2021-03-11T10:34:34Z"}
{"entryPointName":"http","level":"debug","middlewareName":"metrics-entrypoint","middlewareType":"Metrics","msg":"Creating middleware","time":"2021-03-11T10:34:34Z"}
{"entryPointName":"traefik","level":"debug","middlewareName":"metrics-entrypoint","middlewareType":"Metrics","msg":"Creating middleware","time":"2021-03-11T10:34:34Z"}
{"level":"debug","msg":"No default certificate, generating one","time":"2021-03-11T10:34:34Z"}
{"level":"debug","msg":"No default certificate, generating one","time":"2021-03-11T10:34:35Z"}
{"level":"debug","middlewareName":"admin-auth@docker","middlewareType":"BasicAuth","msg":"Authentication succeeded","time":"2021-03-11T10:34:39Z"}
78.68.18.191 - admin [11/Mar/2021:10:34:39 +0000] "GET /api/overview HTTP/1.1" 200 435 "-" "-" 1 "traefik@docker" "-" 1ms
{"level":"debug","middlewareName":"admin-auth@docker","middlewareType":"BasicAuth","msg":"Authentication succeeded","time":"2021-03-11T10:34:43Z"}
78.68.18.191 - admin [11/Mar/2021:10:34:43 +0000] "GET /api/overview HTTP/1.1" 200 435 "-" "-" 2 "traefik@docker" "-" 0ms
{"level":"debug","middlewareName":"admin-auth@docker","middlewareType":"BasicAuth","msg":"Authentication succeeded","time":"2021-03-11T10:34:48Z"}
78.68.18.191 - admin [11/Mar/2021:10:34:48 +0000] "GET /api/overview HTTP/1.1" 200 435 "-" "-" 3 "traefik@docker" "-" 0ms
{"container":"khotabaa-majles-service-kjck3wu7sycytg90oowwnlu02","level":"debug","msg":"Filtering disabled container","providerName":"docker","time":"2021-03-11T10:34:49Z"}
{"container":"khotabaa-majles-service-td45tu3y2n5uan9zfvu8grskf","level":"debug","msg":"Filtering disabled container","providerName":"docker","time":"2021-03-11T10:34:49Z"}
{"container":"khotabaa-notification-service-jiwysekat9srx9q7qthr3a1py","level":"debug","msg":"Filtering disabled container","providerName":"docker","time":"2021-03-11T10:34:49Z"}
{"container":"khotabaa-notification-service-vubwf8ijzl4cuy4hr40wnbusz","level":"debug","msg":"Filtering disabled container","providerName":"docker","time":"2021-03-11T10:34:49Z"}
{"container":"khotabaa-user-service-mccp2a8889d2v43a6254gp4ao","level":"debug","msg":"Filtering disabled container","providerName":"docker","time":"2021-03-11T10:34:49Z"}
{"container":"khotabaa-user-service-uk536qxhdf4w23mf7hjxteumk","level":"debug","msg":"Filtering disabled container","providerName":"docker","time":"2021-03-11T10:34:49Z"}
{"container":"khotabaa-poem-service-itz4ugap9i4sseqe5moat48r6","level":"debug","msg":"Filtering disabled container","providerName":"docker","time":"2021-03-11T10:34:49Z"}
{"container":"khotabaa-poem-service-j1saedgmn7jaili2v21ni215g","level":"debug","msg":"Filtering disabled container","providerName":"docker","time":"2021-03-11T10:34:49Z"}
{"level":"debug","msg":"Configuration received from provider docker: {\"http\":{\"routers\":{\"khotabaa-gateway\":{\"entryPoints\":[\"http\"],\"service\":\"khotabaa-gateway\",\"rule\":\"Host(`gateway.moemortada.com`)\"},\"khotabaa-identity-service\":{\"entryPoints\":[\"http\"],\"service\":\"khotabaa-identity-service\",\"rule\":\"Host(`identity.moemortada.com`)\"},\"traefik\":{\"entryPoints\":[\"http\"],\"middlewares\":[\"admin-auth\"],\"service\":\"api@internal\",\"rule\":\"Host(`manager.moemortada.com`)\"}},\"services\":{\"khotabaa-gateway\":{\"loadBalancer\":{\"servers\":[{\"url\":\"http://10.0.4.38:9002\"},{\"url\":\"http://10.0.4.7:9002\"}],\"passHostHeader\":true}},\"khotabaa-identity-service\":{\"loadBalancer\":{\"servers\":[{\"url\":\"http://10.0.4.245:5001\"},{\"url\":\"http://10.0.4.246:5001\"}],\"passHostHeader\":true}},\"traefik\":{\"loadBalancer\":{\"servers\":[{\"url\":\"http://10.0.4.249:8080\"}],\"passHostHeader\":true}}},\"middlewares\":{\"admin-auth\":{\"basicAuth\":{\"users\":[\"admin:$apr1$fimNQZzP$n3Jktnk8pJdrWKIP1I2XA1\"]}},\"redirect-to-http\":{\"redirectScheme\":{\"scheme\":\"http\"}}}},\"tcp\":{},\"udp\":{}}","providerName":"docker","time":"2021-03-11T10:34:49Z"}
{"level":"info","msg":"Skipping same configuration","providerName":"docker","time":"2021-03-11T10:34:49Z"}
{"level":"debug","middlewareName":"admin-auth@docker","middlewareType":"BasicAuth","msg":"Authentication succeeded","time":"2021-03-11T10:34:53Z"}
78.68.18.191 - admin [11/Mar/2021:10:34:53 +0000] "GET /api/overview HTTP/1.1" 200 435 "-" "-" 4 "traefik@docker" "-" 0ms
{"level":"debug","middlewareName":"admin-auth@docker","middlewareType":"BasicAuth","msg":"Authentication succeeded","time":"2021-03-11T10:34:58Z"}
78.68.18.191 - admin [11/Mar/2021:10:34:58 +0000] "GET /api/overview HTTP/1.1" 200 435 "-" "-" 5 "traefik@docker" "-" 0ms
{"level":"debug","middlewareName":"admin-auth@docker","middlewareType":"BasicAuth","msg":"Authentication succeeded","time":"2021-03-11T10:35:04Z"}
78.68.18.191 - admin [11/Mar/2021:10:35:04 +0000] "GET /api/overview HTTP/1.1" 200 435 "-" "-" 6 "traefik@docker" "-" 0ms
{"container":"khotabaa-majles-service-kjck3wu7sycytg90oowwnlu02","level":"debug","msg":"Filtering disabled container","providerName":"docker","time":"2021-03-11T10:35:04Z"}

@jakubhajek, i still cant find a solution :frowning: , I tried the same service I am using for gateway.$DOMAIN, with the same configuration and it is not reachable,
added these configuration on it

        - traefik.enable=true
        - traefik.docker.network=khotaba_network
        - traefik.http.routers.khotabaa-gateway.rule=Host(`duplicategateway.${DOMAIN?Variable not set}`)
        - traefik.http.services.khotabaa-gateway.loadbalancer.server.port=5013
        - traefik.http.routers.khotabaa-gateway.entrypoints=http

it seems like I am missing an option to tell the traefik that I should look to more than one service? I dont know if thats correct?

I have found in your log file lots of entries with Filtering disabled containers meaning that labels are not in the section deploy as it is required by Swarm.

Let's try to fix that first and than move further with investigation.

How the logs look like when you try to access the identity.${DOMAIN} service ?

@jakubhajek true, these containers are not labeled and are separated, they are deployed on the same node.

Do you want me to enable traefik on these containers? even if they are not related to what i am doing? they only talk with the gateway internally ?

opening identity.${DOMAIN} from the browser resulted the log file I sent to you. I cant see more than that, even if I do gateway.${DOMAIN} i see the same result but with the updated date with the latest request.

Would you please let us know what HTTP response you got from the identity service ? I am asking because I was not able to find that in log files you published.

Thank you,

see bro nothing is happening here is the url http://identity.moemortada.com:8000/.well-known/openid-configuration

is it just loading and loading and nothing is happening, even if i use curl, i get no response :frowning:
thats the response i get :
curl: (7) Failed to connect to identity.moemortada.com port 8000: Operation timed out

that is the only output i get from the logs when curl the identity service. Its totally different from the output of the gateway



{"level":"debug","msg":"Configuration received from provider docker: {\"http\":{\"routers\":{\"khotabaa-gateway\":{\"entryPoints\":[\"http\"],\"service\":\"khotabaa-gateway\",\"rule\":\"Host(`gateway.moemortada.com`)\"},\"khotabaa-identity-service\":{\"entryPoints\":[\"http\"],\"service\":\"khotabaa-identity-service\",\"rule\":\"Host(`identity.moemortada.com`)\"},\"traefik\":{\"entryPoints\":[\"http\"],\"middlewares\":[\"admin-auth\"],\"service\":\"api@internal\",\"rule\":\"Host(`manager.moemortada.com`)\"}},\"services\":{\"khotabaa-gateway\":{\"loadBalancer\":{\"servers\":[{\"url\":\"http://10.0.4.38:9002\"},{\"url\":\"http://10.0.4.7:9002\"}],\"passHostHeader\":true}},\"khotabaa-identity-service\":{\"loadBalancer\":{\"servers\":[{\"url\":\"http://10.0.4.79:5001\"},{\"url\":\"http://10.0.4.78:5001\"}],\"passHostHeader\":true}},\"traefik\":{\"loadBalancer\":{\"servers\":[{\"url\":\"http://10.0.4.250:8080\"}],\"passHostHeader\":true}}},\"middlewares\":{\"admin-auth\":{\"basicAuth\":{\"users\":[\"admin:$apr1$r3yMaPUy$nXKEDG0//p5i061jmvKQr/\"]}},\"redirect-to-http\":{\"redirectScheme\":{\"scheme\":\"http\"}}}},\"tcp\":{},\"udp\":{}}","providerName":"docker","time":"2021-03-11T15:35:38Z"}

{"level":"info","msg":"Skipping same configuration","providerName":"docker","time":"2021-03-11T15:35:38Z"}

{"level":"debug","middlewareName":"admin-auth@docker","middlewareType":"BasicAuth","msg":"Authentication succeeded","time":"2021-03-11T15:35:41Z"}

78.68.18.191 - admin [11/Mar/2021:15:35:41 +0000] "GET /api/overview HTTP/1.1" 200 435 "-" "-" 258 "traefik@docker" "-" 1ms

{"level":"debug","middlewareName":"admin-auth@docker","middlewareType":"BasicAuth","msg":"Authentication succeeded","time":"2021-03-11T15:35:46Z"}

78.68.18.191 - admin [11/Mar/2021:15:35:46 +0000] "GET /api/overview HTTP/1.1" 200 435 "-" "-" 259 "traefik@docker" "-" 0ms

{"level":"debug","middlewareName":"admin-auth@docker","middlewareType":"BasicAuth","msg":"Authentication succeeded","time":"2021-03-11T15:35:51Z"}

78.68.18.191 - admin [11/Mar/2021:15:35:51 +0000] "GET /api/overview HTTP/1.1" 200 435 "-" "-" 260 "traefik@docker" "-" 0ms

{"container":"khotabaa-majles-service-kjck3wu7sycytg90oowwnlu02","level":"error","msg":"service \"khotabaa-majles-service\" error: port is missing","providerName":"docker","time":"2021-03-11T15:35:53Z"}

{"container":"khotabaa-majles-service-td45tu3y2n5uan9zfvu8grskf","level":"error","msg":"service \"khotabaa-majles-service\" error: port is missing","providerName":"docker","time":"2021-03-11T15:35:53Z"}

{"container":"khotabaa-notification-service-jiwysekat9srx9q7qthr3a1py","level":"error","msg":"service \"khotabaa-notification-service\" error: port is missing","providerName":"docker","time":"2021-03-11T15:35:53Z"}

{"container":"khotabaa-notification-service-vubwf8ijzl4cuy4hr40wnbusz","level":"error","msg":"service \"khotabaa-notification-service\" error: port is missing","providerName":"docker","time":"2021-03-11T15:35:53Z"}

{"container":"khotabaa-user-service-mccp2a8889d2v43a6254gp4ao","level":"error","msg":"service \"khotabaa-user-service\" error: port is missing","providerName":"docker","time":"2021-03-11T15:35:53Z"}

{"container":"khotabaa-user-service-uk536qxhdf4w23mf7hjxteumk","level":"error","msg":"service \"khotabaa-user-service\" error: port is missing","providerName":"docker","time":"2021-03-11T15:35:53Z"}

{"container":"khotabaa-poem-service-itz4ugap9i4sseqe5moat48r6","level":"error","msg":"service \"khotabaa-poem-service\" error: port is missing","providerName":"docker","time":"2021-03-11T15:35:53Z"}

{"container":"khotabaa-poem-service-j1saedgmn7jaili2v21ni215g","level":"error","msg":"service \"khotabaa-poem-service\" error: port is missing","providerName":"docker","time":"2021-03-11T15:35:53Z"}

{"level":"debug","msg":"Configuration received from provider docker: {\"http\":{\"routers\":{\"khotabaa-gateway\":{\"entryPoints\":[\"http\"],\"service\":\"khotabaa-gateway\",\"rule\":\"Host(`gateway.moemortada.com`)\"},\"khotabaa-identity-service\":{\"entryPoints\":[\"http\"],\"service\":\"khotabaa-identity-service\",\"rule\":\"Host(`identity.moemortada.com`)\"},\"traefik\":{\"entryPoints\":[\"http\"],\"middlewares\":[\"admin-auth\"],\"service\":\"api@internal\",\"rule\":\"Host(`manager.moemortada.com`)\"}},\"services\":{\"khotabaa-gateway\":{\"loadBalancer\":{\"servers\":[{\"url\":\"http://10.0.4.38:9002\"},{\"url\":\"http://10.0.4.7:9002\"}],\"passHostHeader\":true}},\"khotabaa-identity-service\":{\"loadBalancer\":{\"servers\":[{\"url\":\"http://10.0.4.79:5001\"},{\"url\":\"http://10.0.4.78:5001\"}],\"passHostHeader\":true}},\"traefik\":{\"loadBalancer\":{\"servers\":[{\"url\":\"http://10.0.4.250:8080\"}],\"passHostHeader\":true}}},\"middlewares\":{\"admin-auth\":{\"basicAuth\":{\"users\":[\"admin:$apr1$r3yMaPUy$nXKEDG0//p5i061jmvKQr/\"]}},\"redirect-to-http\":{\"redirectScheme\":{\"scheme\":\"http\"}}}},\"tcp\":{},\"udp\":{}}","providerName":"docker","time":"2021-03-11T15:35:53Z"}

{"level":"info","msg":"Skipping same configuration","providerName":"docker","time":"2021-03-11T15:35:53Z"}

{"level":"debug","middlewareName":"admin-auth@docker","middlewareType":"BasicAuth","msg":"Authentication succeeded","time":"2021-03-11T15:35:56Z"}

78.68.18.191 - admin [11/Mar/2021:15:35:56 +0000] "GET /api/overview HTTP/1.1" 200 435 "-" "-" 261 "traefik@docker" "-" 0ms

{"level":"debug","middlewareName":"admin-auth@docker","middlewareType":"BasicAuth","msg":"Authentication succeeded","time":"2021-03-11T15:36:01Z"}

78.68.18.191 - admin [11/Mar/2021:15:36:01 +0000] "GET /api/overview HTTP/1.1" 200 435 "-" "-" 262 "traefik@docker" "-" 0ms

So, Identity does not hit Traefik. Please have a look at DNS entries for Identity and Gateway

❯ dig identity.moemortada.com +short
77.111.240.4
❯ dig gateway.moemortada.com +short
188.148.144.90
❯ dig gateway.moemortada.com +short
188.148.144.90

Can you please which IP address is correct?

the 188.148.144.90 is the correct one

Please update the identity service to point to the correct IP address and your issue will be solved :slight_smile:

thats really silly from my side!! I mean I forgot to add the A domain name for identity !! kill me !! i am really sorry for that and I really appreciate your help :slight_smile: real thx for you man!

No worries :slight_smile: Glad to hear that we solved that. Thank you for your patience and using Traefik :slight_smile: