Skip to content
This repository has been archived by the owner on Jan 24, 2019. It is now read-only.

"Fail!" with Google provider #430

Closed
svanschalkwyk opened this issue Aug 5, 2017 · 2 comments · Fixed by #431
Closed

"Fail!" with Google provider #430

svanschalkwyk opened this issue Aug 5, 2017 · 2 comments · Fixed by #431

Comments

@svanschalkwyk
Copy link

svanschalkwyk commented Aug 5, 2017

I'm getting this with Google:

Aug 05 02:17:54 nginx01 systemd[1]: Stopped LSB: Start oauth2-proxy at boot time.. Aug 05 02:17:54 nginx01 systemd[1]: Starting LSB: Start oauth2-proxy at boot time.... Aug 05 02:17:54 nginx01 oauth2-proxy[5265]: * Starting A reverse proxy that provides authentication with Googl Aug 05 02:17:56 nginx01 oauth2-proxy[5265]: ...fail! Aug 05 02:17:56 nginx01 systemd[1]: Started LSB: Start oauth2-proxy at boot time..

The error log contains:

$cat /var/log/oauth2-proxy/oauth2-proxy.error.log panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x40 pc=0x7ae03f] goroutine 1 [running]: main.(*Options).Validate(0xc4200e2000, 0xc4200e2000, 0xc420050420) /Users/jehiah/projects/gopath/src/github.com/bitly/oauth2_proxy/options.go:149 +0x30f main.main() /Users/jehiah/projects/gopath/src/github.com/bitly/oauth2_proxy/main.go:101 +0x1303 panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x40 pc=0x7ae03f] goroutine 1 [running]: main.(*Options).Validate(0xc4200e2000, 0xc4200e2000, 0xc420050420) /Users/jehiah/projects/gopath/src/github.com/bitly/oauth2_proxy/options.go:149 +0x30f main.main() /Users/jehiah/projects/gopath/src/github.com/bitly/oauth2_proxy/main.go:101 +0x1303

My config file contains this:
cookie-domain = "localhost:4180" http_address = "127.0.0.1:4180" upstreams = ["127.0.0.1:8080/"] cookie-secure = false cookie_secret = "cookie_secret" client_id = "1234567890123-ggxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com" provider = "Google" client_secret = "zzzzzzzzzzzzzzzzzzzzzzzzzz" email-domain = "*"

This occurs even with upstreams = ["127.0.0.1:8080"]
Any idea what may be causing this? The error suggests it may be in the upstreams setting but I have tried all variations.

@svanschalkwyk svanschalkwyk changed the title "Fail" with Google "Fail!" with Google provider Aug 5, 2017
@ploxiln
Copy link
Contributor

ploxiln commented Aug 5, 2017

Please learn to use triple-backticks so your lines are not all messed up: https://help.github.com/articles/basic-writing-and-formatting-syntax/#quoting-code

Mini reference - leave the triple-backticks on their own line without the text:

```
line one
line two
```

Anyway - you just need to add http:// to your upstream, e.g. "http://127.0.0.1:8080"

It should not crash in this case though, it should print a better error message. The crash is a bug - I think that when this was originally written, upstreamURL would end up as an empty struct, not a null pointer. I'll whip up a quick fix PR for that ...

@svanschalkwyk
Copy link
Author

Much appreciated.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants