sso icon indicating copy to clipboard operation
sso copied to clipboard

[Quickstart] 500 Internal Server Error

Open lakshaytalkstomachines opened this issue 4 years ago • 8 comments

Describe the bug Getting 500 internal server error after authenticating with google on redirect in quickstart.

Screenshots

Screenshot from 2020-03-11 11-37-31

lakshaytalkstomachines avatar Mar 11 '20 06:03 lakshaytalkstomachines

In sso proxy logs : {"error":"Post http://host.docker.internal/google/redeem: dial tcp: lookup host.docker.internal on 127.0.0.11:53: no such host","level":"error","msg":"error redeeming authorization code","remote_address":"172.18.0.1","service":"sso-proxy","time":"2020-03-11 11:10:10.627"} {"http_status":500,"level":"info","msg":"error page","page_message":"Internal Error","page_title":"Internal Error","remote_address":"172.18.0.1","service":"sso-proxy","time":"2020-03-11 11:10:10.627"}

lakshaytalkstomachines avatar Mar 11 '20 11:03 lakshaytalkstomachines

I commented out this line : - PROVIDER_URL_INTERNAL=http://host.docker.internal in docker compose . then i got this error in sso proxy logs : {"error":"Post http://sso-auth.localtest.me/google/redeem: dial tcp 127.0.0.1:80: connect: connection refused","level":"error","msg":"error redeeming authorization code","remote_address":"172.18.0.1","service":"sso-proxy","time":"2020-03-11 12:16:29.725"}

lakshaytalkstomachines avatar Mar 11 '20 12:03 lakshaytalkstomachines

I am experiencing the same error

stevetauber avatar Apr 03 '20 15:04 stevetauber

@Jusshersmith Do you have an idea what this might be?

stevetauber avatar Apr 03 '20 15:04 stevetauber

On the docker-compose file there is an environment variable called PROVIDER_URL_INTERNAL that is pointing to host.docker.internal this DNS name should "magically" point to docker host machine, but sadly that is not implemented in Docker Linux yet, it just works on Windows and Mac, you can follow the issue here: https://github.com/docker/for-linux/issues/264

namelivia avatar Jun 01 '20 10:06 namelivia

As a workaround you can set it manually can do execute ifconfig on your terminal, look for the docker0 interface ip address. And then replace host.docker.internal for that ip address on docker-compose.yml. Not the best of the solutions but it will make it work.

namelivia avatar Jun 01 '20 10:06 namelivia

I encountered same problem.

In my case, adding extra_hosts setting makes me happy.

$ ip r   # on your host
default via 10.0.2.2 dev eth0  metric 1
...

then quickstart/docker-compose.yml:

        expose:
          - 4180
+       extra_hosts:
+         - host.docker.internal:10.0.2.2

Related: https://github.com/docker/toolbox/issues/823

wassan128 avatar Jun 11 '20 14:06 wassan128

This was my issue & the solution for this on k8s: https://github.com/buzzfeed/sso/issues/102

rlabrecque avatar Nov 24 '20 19:11 rlabrecque