buzzfeed / sso

sso, aka S.S.Octopus, aka octoboi, is a single sign-on solution for securing internal services
MIT License
3.09k stars 186 forks source link

[Quickstart] 500 Internal Server Error #285

Open lakshaytalkstomachines opened 4 years ago

lakshaytalkstomachines commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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"}

stevetauber commented 4 years ago

I am experiencing the same error

stevetauber commented 4 years ago

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

namelivia commented 4 years ago

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 commented 4 years ago

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.

wassan128 commented 4 years ago

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

rlabrecque commented 3 years ago

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