Haufe-Lexware / wicked.haufe.io

An API Management system based on Mashape Kong
http://wicked.haufe.io
Other
124 stars 37 forks source link

Wicked 1.0.0 portal-auth docker container can't resolve Portal and API hosts #150

Closed armezit closed 5 years ago

armezit commented 5 years ago

Host: Debian buster x64 (kernel: 4.18.0-3-amd64) Docker: docker-ce version 18.09.0, build 4d60db4 Docker Compose: 1.22.0, build f46880fe

When deploying wicked 1.0.0 to a docker host locally (local machine without actual DNS entries), I faced with an error in all portal pages, which says:

{"error_description":"The access token is invalid or has expired","error":"invalid_token"}

and the screenshot:

screenshot from 2018-12-24 15-56-13

I looked at logs of the portal-auth container, and found these errors:

{"date":"2018-12-24T12:26:03.518Z","module":"portal-auth:generic-router","message":{"issueAsJson":false,"status":500,"oauthError":"server_error","internalError":{"errno":"ENOTFOUND","code":"ENOTFOUND","syscall":"getaddrinfo","hostname":"api.portal.local","host":"api.portal.local","port":443}},"delta":587,"level":"error"}
{"date":"24/Dec/2018:12:26:03 +0000","method":"POST","url":"/auth/local/api/portal-api/token","remote-addr":"172.31.0.8","version":"1.1","status":"500","content-length":"92","referrer":"-","response-time":"124.893","correlation-id":"ef90fbd6-c934-43fa-97fa-99cd30f3cfbb"}

It seems that portal-auth DNS doesn't know anything about portal.local and api.portal.local. So I added these extra_hosts into the docker-compose.yml file under portal-auth service:

portal-auth:
    extra_hosts:
        - "portal.local:LOCAL_HOST_IP"
        - "api.portal.local:LOCAL_HOST_IP"

Rebuilt wicked docker containers and everything is fine!

I used the docker-compose.yml which was generated by kickstarter, without any modification.

I don't know if this error occurs when deploying to a docker host with real dns or not. Anyway, maybe it's better to add a comment about this in the deploying docs. or even a little change in kickstarter's generated docker-compose.yml file.

DonMartin76 commented 5 years ago

This is a duplicate of #149. Closing so that we can track in one place. Thanks for reporting!