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

Backend for custom error page has no RemoteAddr/Scheme #3643

Closed
bonndan opened this issue Jul 19, 2018 · 10 comments
Closed

Backend for custom error page has no RemoteAddr/Scheme #3643

bonndan opened this issue Jul 19, 2018 · 10 comments
Assignees
Labels
area/middleware kind/bug/confirmed a confirmed bug (reproducible). priority/P1 need to be fixed in next release status/5-frozen-due-to-age
Milestone

Comments

@bonndan
Copy link

bonndan commented Jul 19, 2018

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

Bug

What did you do?

Trying to use custom error pages for a service "gateway" from the backend "keycloak". The browser shows "Internal server error" and the traefik logs indicate the backend is not resolved properly.

Environment is traefik:1.7 docker image running in swarm mode.

What did you expect to see?

A HTML page from the "keycloak" service.

What did you see instead?

Internal Server Error

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

Version:      v1.7.0-rc2
Codename:     maroilles
Go version:   go1.10.3
Built:        2018-07-17_12:42:38PM
OS/Arch:      linux/amd64

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

version: "3.3"

networks:
  public:
    external:
      name: 

services:
  traefik:
    image: traefik:1.7 # 1.7 supports per-frontend auth forwarding
    command: --api --docker --docker.domain=xxx --docker.swarmmode --docker.watch 
    ports:
      - "80:80"     # The HTTP port
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock 
    networks:
      - public
version: '3.3'

services:

  gateway:
    image: keycloak-proxy:latest
    deploy:
      labels:
        - "traefik.backend=gateway"
        - "traefik.frontend.rule=PathPrefixStrip:/gateway"
        - "traefik.port=8080"
        - "traefik.docker.network=public"
        - "traefik.frontend.errors.all.backend=keycloak"
        - "traefik.frontend.errors.all.status=400-599"
        - "traefik.frontend.errors.all.query=/auth/realms/master/account"
      placement:
        constraints:
          - node.role == worker
      mode: replicated
      replicas: 1
    networks:
      - public

networks:
  public:
    external:
      name: public
version: '3'

volumes:
  postgres_data:
      driver: local
    
networks:
  public:
    external:
      name: 
  keycloak:

services:
  postgres:
      image: postgres
      volumes:
        - postgres_data:/var/lib/postgresql/data
      environment:
        XXX:YYY
      networks:
        - keycloak
  keycloak:
      image: jboss/keycloak
      environment:
        XXX:YYY
      healthcheck:
        test: ["CMD", "curl", "-f", "http://localhost:8080/auth/"]
        interval: 5s
        timeout: 2s
        retries: 15
      deploy:
        labels:
          - "traefik.backend=keycloak"
          - "traefik.port=8080"
          - "traefik.frontend.rule=PathPrefix:/auth"
          - "traefik.docker.network=public" #needed because we have two networks
      networks:
        - public
        - keycloak
      depends_on:
        - postgres

If applicable, please paste the log output in DEBUG level (--logLevel=DEBUG switch)

globalservices_traefik.0.vzd4fktlfe17@docker-32    | time="2018-07-19T13:18:14Z" level=debug msg="Upstream ResponseWriter of type *pipelining.writerWithoutCloseNotify does not implement http.CloseNotifier. Returning dummy channel."

...

globalservices_traefik.0.vzd4fktlfe17@xxx    | time="2018-07-19T13:18:14Z" level=debug msg="'500 Internal Server Error' caused by: unsupported protocol scheme \"\""
globalservices_traefik.0.vzd4fktlfe17@xxx    | time="2018-07-19T13:18:14Z" level=debug msg="vulcand/oxy/forward/http: Round trip: /auth/realms/master/account, code: 500, Length: 21, duration: 100.339µs"

...

globalservices_traefik.0.vzd4fktlfe17@xxx    | time="2018-07-19T13:00:34Z" level=debug msg="vulcand/oxy/forward: completed ServeHttp on request" Request="{\"Method\":\"GET\",\"URL\":{\"Scheme\":\"\",\"Opaque\":\"\",\"User\":null,\"Host\":\"\",\"Path\":\"/auth/realms/master/account\",\"RawPath\":\"\",\"ForceQuery\":false,\"RawQuery\":\"\",\"Fragment\":\"\"},\"Proto\":\"HTTP/1.1\",\"ProtoMajor\":1,\"ProtoMinor\":1,\"Header\":{\"Accept\":[\"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\"],\"Accept-Encoding\":[\"gzip, deflate\"],\"Accept-Language\":[\"de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7\"],\"Cache-Control\":[\"max-age=0\"],\"Connection\":[\"keep-alive\"],\"Cookie\":[\"_ga=GA1.1.1559381502.1530883005; _gid=GA1.1.1615818971.1531902865; kc-access=; kc-state=\"],\"Upgrade-Insecure-Requests\":[\"1\"],\"User-Agent\":[\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36\"],\"X-Forwarded-Prefix\":[\"/gateway\"]},\"ContentLength\":0,\"TransferEncoding\":null,\"Host\":\"\",\"Form\":null,\"PostForm\":null,\"MultipartForm\":null,\"Trailer\":null,\"RemoteAddr\":\"\",\"RequestURI\":\"/auth/realms/master/account\",\"TLS\":null}"

@ldez ldez added priority/P2 need to be fixed in the future kind/bug/possible a possible bug that needs analysis before it is confirmed or fixed. and removed status/0-needs-triage labels Jul 19, 2018
@ldez ldez self-assigned this Jul 19, 2018
@kachkaev
Copy link
Contributor

kachkaev commented Aug 5, 2018

I guess I'm facing the same thing – see my comment in #3678

@bonndan
Copy link
Author

bonndan commented Aug 8, 2018

I also got this error in a rancher environment now: The backend was resolved to a non-existent IP, resulting in bad gateway.

@ldez
Copy link
Member

ldez commented Aug 8, 2018

If you have this problem, could you give us the version of Traefik you are using.

@bonndan
Copy link
Author

bonndan commented Aug 8, 2018

I opened this issue, it's still 1.7-RC2. Haven't tried RC3, but according to the changelog nothing has been done regarding this issue.

@signaleleven
Copy link

1.7-RC3

@kachkaev
Copy link
Contributor

kachkaev commented Aug 8, 2018

Also 1.7-RC3 (details in #3678 (comment)). I could not make custom error pages working regardless of what I tried. Is there an example ingress rule that I can test in my cluster? I don't exclude that the error occurs because of a clash with other annotations that I've been using.

@ldez ldez added priority/P1 need to be fixed in next release kind/bug/confirmed a confirmed bug (reproducible). area/middleware and removed kind/bug/possible a possible bug that needs analysis before it is confirmed or fixed. priority/P2 need to be fixed in the future labels Aug 8, 2018
@ldez
Copy link
Member

ldez commented Aug 8, 2018

I confirm the bug, it's a regression related to #3312

@kachkaev
Copy link
Contributor

kachkaev commented Aug 9, 2018

@ldez do you think the bug occurs in all scenarios or are there certain combinations of ignress annotations where a custom error would be shown? If yes, I'd be keen to taste the flavour of this feature.

@ldez
Copy link
Member

ldez commented Aug 9, 2018

the bug occurs in all scenarios and all providers, I don't think there is any workaround. Sorry.

@traefiker
Copy link
Contributor

Closed by #3894.

@traefik traefik locked and limited conversation to collaborators Sep 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/middleware kind/bug/confirmed a confirmed bug (reproducible). priority/P1 need to be fixed in next release status/5-frozen-due-to-age
Projects
None yet
Development

No branches or pull requests

6 participants