-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
runtime error: index out of range [0] with length 0 while extracting state of of the csrf #2311
Comments
@jesinity, @JoelSpeed, @tuunit : Do you have an environment to test this? |
I only have the ability to test this via the local test environments that we have set up here. Very odd indeed that the state parameter isn't being passed through. Is it possible at all that the ingress is somehow stripping the query string? |
Currently, I use docker compose to use keycloak + oauth2 proxy + Redis + nginx proxy manager. This problem also occurs My oauth2 proxy docker compose services: oauth2-proxy: redis: |
2023/12/12 13:18:17 | stderr | /opt/bitnami/go/src/net/http/server.go:3089 +0x5ed -- | -- | -- 2023/12/12 13:18:17 | stderr | created by net/http.(*Server).Serve 2023/12/12 13:18:17 | stderr | /opt/bitnami/go/src/net/http/server.go:1995 +0x612 2023/12/12 13:18:17 | stderr | net/http.(*conn).serve(0xc00037e900, {0x103d808, 0xc00043e0f0}) 2023/12/12 13:18:17 | stderr | /opt/bitnami/go/src/net/http/server.go:2936 +0x316 2023/12/12 13:18:17 | stderr | net/http.serverHandler.ServeHTTP({0xc00031b260?}, {0x103cf10, 0xc0000161c0}, 0xc0002a0800) 2023/12/12 13:18:17 | stderr | /bitnami/blacksmith-sandox/oauth2-proxy-7.5.1/src/github.com/oauth2-proxy/oauth2-proxy/oauthproxy.go:531 +0x2a 2023/12/12 13:18:17 | stderr | main.(*OAuthProxy).ServeHTTP(0x0?, {0x103cf10?, 0xc0000161c0?}, 0x469a6e?) 2023/12/12 13:18:17 | stderr | /bitnami/blacksmith-sandox/oauth2-proxy-7.5.1/pkg/mod/github.com/gorilla/[email protected]/mux.go:210 +0x1cf 2023/12/12 13:18:17 | stderr | github.com/gorilla/mux.(*Router).ServeHTTP(0xc0005f9bc0, {0x103cf10, 0xc0000161c0}, 0xc0002a0800) 2023/12/12 13:18:17 | stderr | /opt/bitnami/go/src/net/http/server.go:2122 +0x2f 2023/12/12 13:18:17 | stderr | net/http.HandlerFunc.ServeHTTP(0xc0002a0900?, {0x103cf10?, 0xc0000161c0?}, 0xc00010c7c0?) 2023/12/12 13:18:17 | stderr | /bitnami/blacksmith-sandox/oauth2-proxy-7.5.1/src/github.com/oauth2-proxy/oauth2-proxy/pkg/middleware/scope.go:19 +0xcc 2023/12/12 13:18:17 | stderr | github.com/oauth2-proxy/oauth2-proxy/v7/pkg/middleware.NewScope.func1.1({0x103cf10, 0xc0000161c0}, 0xc00031b950?) 2023/12/12 13:18:17 | stderr | /opt/bitnami/go/src/net/http/server.go:2122 +0x2f 2023/12/12 13:18:17 | stderr | net/http.HandlerFunc.ServeHTTP(0xc0002a0a00?, {0x103cf10?, 0xc0000161c0?}, 0x102f801?) 2023/12/12 13:18:17 | stderr | /bitnami/blacksmith-sandox/oauth2-proxy-7.5.1/src/github.com/oauth2-proxy/oauth2-proxy/pkg/middleware/request_logger.go:27 +0x127 2023/12/12 13:18:17 | stderr | github.com/oauth2-proxy/oauth2-proxy/v7/pkg/middleware.requestLogger.func1({0x103cf10?, 0xc0000161c0}, 0xc0002a0b00) 2023/12/12 13:18:17 | stderr | /opt/bitnami/go/src/net/http/server.go:2122 +0x2f 2023/12/12 13:18:17 | stderr | net/http.HandlerFunc.ServeHTTP(0x415e90?, {0x103c370?, 0xc00037b280?}, 0x10?) 2023/12/12 13:18:17 | stderr | /bitnami/blacksmith-sandox/oauth2-proxy-7.5.1/src/github.com/oauth2-proxy/oauth2-proxy/pkg/middleware/healthcheck.go:40 +0xbd 2023/12/12 13:18:17 | stderr | github.com/oauth2-proxy/oauth2-proxy/v7/pkg/middleware.healthCheck.func1({0x103c370, 0xc00037b280}, 0x4cf101?) 2023/12/12 13:18:17 | stderr | /opt/bitnami/go/src/net/http/server.go:2122 +0x2f 2023/12/12 13:18:17 | stderr | net/http.HandlerFunc.ServeHTTP(0x20?, {0x103c370?, 0xc00037b280?}, 0xc0003536f0?) 2023/12/12 13:18:17 | stderr | /bitnami/blacksmith-sandox/oauth2-proxy-7.5.1/src/github.com/oauth2-proxy/oauth2-proxy/pkg/middleware/readynesscheck.go:38 +0x238 2023/12/12 13:18:17 | stderr | github.com/oauth2-proxy/oauth2-proxy/v7/pkg/middleware.readynessCheck.func1({0x103c370?, 0xc00037b280?}, 0xc0002a0b00?) 2023/12/12 13:18:17 | stderr | /opt/bitnami/go/src/net/http/server.go:2122 +0x2f 2023/12/12 13:18:17 | stderr | net/http.HandlerFunc.ServeHTTP(0xc00037e990?, {0x103c370?, 0xc00037b280?}, 0x4ebd9e?) 2023/12/12 13:18:17 | stderr | /bitnami/blacksmith-sandox/oauth2-proxy-7.5.1/pkg/mod/github.com/prometheus/[email protected]/prometheus/promhttp/instrument_server.go:146 +0xb8 2023/12/12 13:18:17 | stderr | github.com/prometheus/client_golang/prometheus/promhttp.InstrumentHandlerCounter.func1({0x103c370?, 0xc00037b280?}, 0xc0002a0b00) 2023/12/12 13:18:17 | stderr | /opt/bitnami/go/src/net/http/server.go:2122 +0x2f 2023/12/12 13:18:17 | stderr | net/http.HandlerFunc.ServeHTTP(0x103c370?, {0x7fd461d622b8?, 0xc00031b9e0?}, 0xc000353538?) 2023/12/12 13:18:17 | stderr | /bitnami/blacksmith-sandox/oauth2-proxy-7.5.1/pkg/mod/github.com/prometheus/[email protected]/prometheus/promhttp/instrument_server.go:60 +0xd4 2023/12/12 13:18:17 | stderr | github.com/prometheus/client_golang/prometheus/promhttp.InstrumentHandlerInFlight.func1({0x7fd461d622b8, 0xc00031b9e0}, 0x103c300?) 2023/12/12 13:18:17 | stderr | /opt/bitnami/go/src/net/http/server.go:2122 +0x2f 2023/12/12 13:18:17 | stderr | net/http.HandlerFunc.ServeHTTP(0xacd9be?, {0x7fd461d622b8?, 0xc00031b9e0?}, 0xc00031b9b0?) 2023/12/12 13:18:17 | stderr | /bitnami/blacksmith-sandox/oauth2-proxy-7.5.1/pkg/mod/github.com/prometheus/[email protected]/prometheus/promhttp/instrument_server.go:108 +0xbf 2023/12/12 13:18:17 | stderr | github.com/prometheus/client_golang/prometheus/promhttp.InstrumentHandlerDuration.func2({0x7fd461d622b8, 0xc00031b9e0}, 0xc0002a0b00) 2023/12/12 13:18:17 | stderr | /opt/bitnami/go/src/net/http/server.go:2122 +0x2f 2023/12/12 13:18:17 | stderr | net/http.HandlerFunc.ServeHTTP(0x30?, {0x7fd461d622b8?, 0xc00031b9e0?}, 0xc000353488?) 2023/12/12 13:18:17 | stderr | /bitnami/blacksmith-sandox/oauth2-proxy-7.5.1/src/github.com/oauth2-proxy/oauth2-proxy/oauthproxy.go:1012 +0x5c 2023/12/12 13:18:17 | stderr | main.prepareNoCacheMiddleware.func1({0x7fd461d622b8, 0xc00031b9e0}, 0x4cf1b7?) 2023/12/12 13:18:17 | stderr | /opt/bitnami/go/src/net/http/server.go:2122 +0x2f 2023/12/12 13:18:17 | stderr | net/http.HandlerFunc.ServeHTTP(0x7fd461d622b8?, {0x7fd461d622b8?, 0xc00031b9e0?}, 0x30?) 2023/12/12 13:18:17 | stderr | /bitnami/blacksmith-sandox/oauth2-proxy-7.5.1/src/github.com/oauth2-proxy/oauth2-proxy/oauthproxy.go:825 +0x335 2023/12/12 13:18:17 | stderr | main.(*OAuthProxy).OAuthCallback(0xc000464000, {0x7fd461d622b8, 0xc00031b9e0}, 0xc0002a0b00) 2023/12/12 13:18:17 | stderr | /bitnami/blacksmith-sandox/oauth2-proxy-7.5.1/src/github.com/oauth2-proxy/oauth2-proxy/pkg/cookies/csrf.go:77 +0x27 2023/12/12 13:18:17 | stderr | github.com/oauth2-proxy/oauth2-proxy/v7/pkg/cookies.LoadCSRFCookie(0xc0002a0b00, 0xc000477fc0?) 2023/12/12 13:18:17 | stderr | /bitnami/blacksmith-sandox/oauth2-proxy-7.5.1/src/github.com/oauth2-proxy/oauth2-proxy/pkg/cookies/csrf.go:94 +0x2c 2023/12/12 13:18:17 | stderr | github.com/oauth2-proxy/oauth2-proxy/v7/pkg/cookies.GenerateCookieName(0xd39920?, 0xc00042e520) 2023/12/12 13:18:17 | stderr | /bitnami/blacksmith-sandox/oauth2-proxy-7.5.1/src/github.com/oauth2-proxy/oauth2-proxy/pkg/cookies/csrf.go:222 +0x91 2023/12/12 13:18:17 | stderr | github.com/oauth2-proxy/oauth2-proxy/v7/pkg/cookies.ExtractStateSubstring(0xc000353118?) 2023/12/12 13:18:17 | stderr | /opt/bitnami/go/src/runtime/panic.go:890 +0x263 2023/12/12 13:18:17 | stderr | panic({0xe1dbe0, 0xc00003a3a8}) 2023/12/12 13:18:17 | stderr | /opt/bitnami/go/src/net/http/server.go:1854 +0xbf 2023/12/12 13:18:17 | stderr | net/http.(*conn).serve.func1() 2023/12/12 13:18:17 | stderr | goroutine 1880 [running]: 2023/12/12 13:18:17 | stderr | 2023/12/12 05:18:17 http: panic serving 172.27.0.1:58726: runtime error: index out of range [0] with length 0 2023/12/12 13:18:16 | stderr | /opt/bitnami/go/src/net/http/server.go:3089 +0x5ed 2023/12/12 13:18:16 | stderr | created by net/http.(*Server).Serve 2023/12/12 13:18:16 | stderr | /opt/bitnami/go/src/net/http/server.go:1995 +0x612 2023/12/12 13:18:16 | stderr | net/http.(*conn).serve(0xc0001d6360, {0x103d808, 0xc00043e0f0}) 2023/12/12 13:18:16 | stderr | /opt/bitnami/go/src/net/http/server.go:2936 +0x316 2023/12/12 13:18:16 | stderr | net/http.serverHandler.ServeHTTP({0xc00037c990?}, {0x103cf10, 0xc0001582a0}, 0xc0000a6600) 2023/12/12 13:18:16 | stderr | /bitnami/blacksmith-sandox/oauth2-proxy-7.5.1/src/github.com/oauth2-proxy/oauth2-proxy/oauthproxy.go:531 +0x2a 2023/12/12 13:18:16 | stderr | main.(*OAuthProxy).ServeHTTP(0x0?, {0x103cf10?, 0xc0001582a0?}, 0x469a6e?) 2023/12/12 13:18:16 | stderr | /bitnami/blacksmith-sandox/oauth2-proxy-7.5.1/pkg/mod/github.com/gorilla/[email protected]/mux.go:210 +0x1cf 2023/12/12 13:18:16 | stderr | github.com/gorilla/mux.(*Router).ServeHTTP(0xc0005f9bc0, {0x103cf10, 0xc0001582a0}, 0xc0000a6600) 2023/12/12 13:18:16 | stderr | /opt/bitnami/go/src/net/http/server.go:2122 +0x2f 2023/12/12 13:18:16 | stderr | net/http.HandlerFunc.ServeHTTP(0xc0000a6700?, {0x103cf10?, 0xc0001582a0?}, 0xc000118780?) 2023/12/12 13:18:16 | stderr | /bitnami/blacksmith-sandox/oauth2-proxy-7.5.1/src/github.com/oauth2-proxy/oauth2-proxy/pkg/middleware/scope.go:19 +0xcc 2023/12/12 13:18:16 | stderr | github.com/oauth2-proxy/oauth2-proxy/v7/pkg/middleware.NewScope.func1.1({0x103cf10, 0xc0001582a0}, 0xc00037d020?) 2023/12/12 13:18:16 | stderr | /opt/bitnami/go/src/net/http/server.go:2122 +0x2f 2023/12/12 13:18:16 | stderr | net/http.HandlerFunc.ServeHTTP(0xc0000a6800?, {0x103cf10?, 0xc0001582a0?}, 0x102f801?) 2023/12/12 13:18:16 | stderr | /bitnami/blacksmith-sandox/oauth2-proxy-7.5.1/src/github.com/oauth2-proxy/oauth2-proxy/pkg/middleware/request_logger.go:27 +0x127 2023/12/12 13:18:16 | stderr | github.com/oauth2-proxy/oauth2-proxy/v7/pkg/middleware.requestLogger.func1({0x103cf10?, 0xc0001582a0}, 0xc0000a6900) 2023/12/12 13:18:16 | stderr | /opt/bitnami/go/src/net/http/server.go:2122 +0x2f 2023/12/12 13:18:16 | stderr | net/http.HandlerFunc.ServeHTTP(0x415e90?, {0x103c370?, 0xc0005c24a0?}, 0x10?) 2023/12/12 13:18:16 | stderr | /bitnami/blacksmith-sandox/oauth2-proxy-7.5.1/src/github.com/oauth2-proxy/oauth2-proxy/pkg/middleware/healthcheck.go:40 +0xbd 2023/12/12 13:18:16 | stderr | github.com/oauth2-proxy/oauth2-proxy/v7/pkg/middleware.healthCheck.func1({0x103c370, 0xc0005c24a0}, 0x4cf101?) 2023/12/12 13:18:16 | stderr | /opt/bitnami/go/src/net/http/server.go:2122 +0x2f 2023/12/12 13:18:16 | stderr | net/http.HandlerFunc.ServeHTTP(0x20?, {0x103c370?, 0xc0005c24a0?}, 0xc0003576f0?) 2023/12/12 13:18:16 | stderr | /bitnami/blacksmith-sandox/oauth2-proxy-7.5.1/src/github.com/oauth2-proxy/oauth2-proxy/pkg/middleware/readynesscheck.go:38 +0x238 2023/12/12 13:18:16 | stderr | github.com/oauth2-proxy/oauth2-proxy/v7/pkg/middleware.readynessCheck.func1({0x103c370?, 0xc0005c24a0?}, 0xc0000a6900?) 2023/12/12 13:18:16 | stderr | /opt/bitnami/go/src/net/http/server.go:2122 +0x2f 2023/12/12 13:18:16 | stderr | net/http.HandlerFunc.ServeHTTP(0xc0001d63f0?, {0x103c370?, 0xc0005c24a0?}, 0x4ebd9e?) 2023/12/12 13:18:16 | stderr | /bitnami/blacksmith-sandox/oauth2-proxy-7.5.1/pkg/mod/github.com/prometheus/[email protected]/prometheus/promhttp/instrument_server.go:146 +0xb8 2023/12/12 13:18:16 | stderr | github.com/prometheus/client_golang/prometheus/promhttp.InstrumentHandlerCounter.func1({0x103c370?, 0xc0005c24a0?}, 0xc0000a6900) 2023/12/12 13:18:16 | stderr | /opt/bitnami/go/src/net/http/server.go:2122 +0x2f 2023/12/12 13:18:16 | stderr | net/http.HandlerFunc.ServeHTTP(0x103c370?, {0x7fd461d622b8?, 0xc00037d0b0?}, 0xc000357538?) 2023/12/12 13:18:16 | stderr | /bitnami/blacksmith-sandox/oauth2-proxy-7.5.1/pkg/mod/github.com/prometheus/[email protected]/prometheus/promhttp/instrument_server.go:60 +0xd4 2023/12/12 13:18:16 | stderr | github.com/prometheus/client_golang/prometheus/promhttp.InstrumentHandlerInFlight.func1({0x7fd461d622b8, 0xc00037d0b0}, 0x103c300?) 2023/12/12 13:18:16 | stderr | /opt/bitnami/go/src/net/http/server.go:2122 +0x2f 2023/12/12 13:18:16 | stderr | net/http.HandlerFunc.ServeHTTP(0xacd9be?, {0x7fd461d622b8?, 0xc00037d0b0?}, 0xc00037d080?) 2023/12/12 13:18:16 | stderr | /bitnami/blacksmith-sandox/oauth2-proxy-7.5.1/pkg/mod/github.com/prometheus/[email protected]/prometheus/promhttp/instrument_server.go:108 +0xbf 2023/12/12 13:18:16 | stderr | github.com/prometheus/client_golang/prometheus/promhttp.InstrumentHandlerDuration.func2({0x7fd461d622b8, 0xc00037d0b0}, 0xc0000a6900) 2023/12/12 13:18:16 | stderr | /opt/bitnami/go/src/net/http/server.go:2122 +0x2f 2023/12/12 13:18:16 | stderr | net/http.HandlerFunc.ServeHTTP(0x30?, {0x7fd461d622b8?, 0xc00037d0b0?}, 0xc000357488?) 2023/12/12 13:18:16 | stderr | /bitnami/blacksmith-sandox/oauth2-proxy-7.5.1/src/github.com/oauth2-proxy/oauth2-proxy/oauthproxy.go:1012 +0x5c 2023/12/12 13:18:16 | stderr | main.prepareNoCacheMiddleware.func1({0x7fd461d622b8, 0xc00037d0b0}, 0x4cf1b7?) 2023/12/12 13:18:16 | stderr | /opt/bitnami/go/src/net/http/server.go:2122 +0x2f 2023/12/12 13:18:16 | stderr | net/http.HandlerFunc.ServeHTTP(0x7fd461d622b8?, {0x7fd461d622b8?, 0xc00037d0b0?}, 0x30?) 2023/12/12 13:18:16 | stderr | /bitnami/blacksmith-sandox/oauth2-proxy-7.5.1/src/github.com/oauth2-proxy/oauth2-proxy/oauthproxy.go:825 +0x335 2023/12/12 13:18:16 | stderr | main.(*OAuthProxy).OAuthCallback(0xc000464000, {0x7fd461d622b8, 0xc00037d0b0}, 0xc0000a6900) 2023/12/12 13:18:16 | stderr | /bitnami/blacksmith-sandox/oauth2-proxy-7.5.1/src/github.com/oauth2-proxy/oauth2-proxy/pkg/cookies/csrf.go:77 +0x27 2023/12/12 13:18:16 | stderr | github.com/oauth2-proxy/oauth2-proxy/v7/pkg/cookies.LoadCSRFCookie(0xc0000a6900, 0xc000477fc0?) 2023/12/12 13:18:16 | stderr | /bitnami/blacksmith-sandox/oauth2-proxy-7.5.1/src/github.com/oauth2-proxy/oauth2-proxy/pkg/cookies/csrf.go:94 +0x2c 2023/12/12 13:18:16 | stderr | github.com/oauth2-proxy/oauth2-proxy/v7/pkg/cookies.GenerateCookieName(0xd39920?, 0xc00042e520) 2023/12/12 13:18:16 | stderr | /bitnami/blacksmith-sandox/oauth2-proxy-7.5.1/src/github.com/oauth2-proxy/oauth2-proxy/pkg/cookies/csrf.go:222 +0x91 2023/12/12 13:18:16 | stderr | github.com/oauth2-proxy/oauth2-proxy/v7/pkg/cookies.ExtractStateSubstring(0xc000357118?) 2023/12/12 13:18:16 | stderr | /opt/bitnami/go/src/runtime/panic.go:890 +0x263 2023/12/12 13:18:16 | stderr | panic({0xe1dbe0, 0xc00028a0c0}) 2023/12/12 13:18:16 | stderr | /opt/bitnami/go/src/net/http/server.go:1854 +0xbf 2023/12/12 13:18:16 | stderr | net/http.(*conn).serve.func1() 2023/12/12 13:18:16 | stderr | goroutine 1845 [running]: 2023/12/12 13:18:16 | stderr | 2023/12/12 05:18:16 http: panic serving 172.27.0.1:58722: runtime error: index out of range [0] with length 0 2023/12/12 13:18:14 | stderr | /opt/bitnami/go/src/net/http/server.go:3089 +0x5ed 2023/12/12 13:18:14 | stderr | created by net/http.(*Server).Serve 2023/12/12 13:18:14 | stderr | /opt/bitnami/go/src/net/http/server.go:1995 +0x612 2023/12/12 13:18:14 | stderr | net/http.(*conn).serve(0xc00037e630, {0x103d808, 0xc00043e0f0}) 2023/12/12 13:18:14 | stderr | /opt/bitnami/go/src/net/http/server.go:2936 +0x316 2023/12/12 13:18:14 | stderr | net/http.serverHandler.ServeHTTP({0xc00031aa80?}, {0x103cf10, 0xc0000160e0}, 0xc0002a0400) 2023/12/12 13:18:14 | stderr | /bitnami/blacksmith-sandox/oauth2-proxy-7.5.1/src/github.com/oauth2-proxy/oauth2-proxy/oauthproxy.go:531 +0x2a 2023/12/12 13:18:14 | stderr | main.(*OAuthProxy).ServeHTTP(0x0?, {0x103cf10?, 0xc0000160e0?}, 0x469a6e?) 2023/12/12 13:18:14 | stderr | /bitnami/blacksmith-sandox/oauth2-proxy-7.5.1/pkg/mod/github.com/gorilla/[email protected]/mux.go:210 +0x1cf 2023/12/12 13:18:14 | stderr | github.com/gorilla/mux.(*Router).ServeHTTP(0xc0005f9bc0, {0x103cf10, 0xc0000160e0}, 0xc0002a0400) 2023/12/12 13:18:14 | stderr | /opt/bitnami/go/src/net/http/server.go:2122 +0x2f 2023/12/12 13:18:14 | stderr | net/http.HandlerFunc.ServeHTTP(0xc0002a0500?, {0x103cf10?, 0xc0000160e0?}, 0xc00010c040?) 2023/12/12 13:18:14 | stderr | /bitnami/blacksmith-sandox/oauth2-proxy-7.5.1/src/github.com/oauth2-proxy/oauth2-proxy/pkg/middleware/scope.go:19 +0xcc 2023/12/12 13:18:14 | stderr | github.com/oauth2-proxy/oauth2-proxy/v7/pkg/middleware.NewScope.func1.1({0x103cf10, 0xc0000160e0}, 0xc00031b080?) 2023/12/12 13:18:14 | stderr | /opt/bitnami/go/src/net/http/server.go:2122 +0x2f 2023/12/12 13:18:14 | stderr | net/http.HandlerFunc.ServeHTTP(0xc0002a0600?, {0x103cf10?, 0xc0000160e0?}, 0x102f801?) 2023/12/12 13:18:14 | stderr | /bitnami/blacksmith-sandox/oauth2-proxy-7.5.1/src/github.com/oauth2-proxy/oauth2-proxy/pkg/middleware/request_logger.go:27 +0x127 2023/12/12 13:18:14 | stderr | github.com/oauth2-proxy/oauth2-proxy/v7/pkg/middleware.requestLogger.func1({0x103cf10?, 0xc0000160e0}, 0xc0002a0700) 2023/12/12 13:18:14 | stderr | /opt/bitnami/go/src/net/http/server.go:2122 +0x2f 2023/12/12 13:18:14 | stderr | net/http.HandlerFunc.ServeHTTP(0x415e90?, {0x103c370?, 0xc00037b060?}, 0x10?) 2023/12/12 13:18:14 | stderr | /bitnami/blacksmith-sandox/oauth2-proxy-7.5.1/src/github.com/oauth2-proxy/oauth2-proxy/pkg/middleware/healthcheck.go:40 +0xbd 2023/12/12 13:18:14 | stderr | github.com/oauth2-proxy/oauth2-proxy/v7/pkg/middleware.healthCheck.func1({0x103c370, 0xc00037b060}, 0x4cf101?) 2023/12/12 13:18:14 | stderr | /opt/bitnami/go/src/net/http/server.go:2122 +0x2f 2023/12/12 13:18:14 | stderr | net/http.HandlerFunc.ServeHTTP(0x20?, {0x103c370?, 0xc00037b060?}, 0xc0003536f0?) 2023/12/12 13:18:14 | stderr | /bitnami/blacksmith-sandox/oauth2-proxy-7.5.1/src/github.com/oauth2-proxy/oauth2-proxy/pkg/middleware/readynesscheck.go:38 +0x238 2023/12/12 13:18:14 | stderr | github.com/oauth2-proxy/oauth2-proxy/v7/pkg/middleware.readynessCheck.func1({0x103c370?, 0xc00037b060?}, 0xc0002a0700?) 2023/12/12 13:18:14 | stderr | /opt/bitnami/go/src/net/http/server.go:2122 +0x2f 2023/12/12 13:18:14 | stderr | net/http.HandlerFunc.ServeHTTP(0xc00037e6c0?, {0x103c370?, 0xc00037b060?}, 0x4ebd9e?) 2023/12/12 13:18:14 | stderr | /bitnami/blacksmith-sandox/oauth2-proxy-7.5.1/pkg/mod/github.com/prometheus/[email protected]/prometheus/promhttp/instrument_server.go:146 +0xb8 2023/12/12 13:18:14 | stderr | github.com/prometheus/client_golang/prometheus/promhttp.InstrumentHandlerCounter.func1({0x103c370?, 0xc00037b060?}, 0xc0002a0700) 2023/12/12 13:18:14 | stderr | /opt/bitnami/go/src/net/http/server.go:2122 +0x2f 2023/12/12 13:18:14 | stderr | net/http.HandlerFunc.ServeHTTP(0x103c370?, {0x7fd461d622b8?, 0xc00031b110?}, 0xc000353538?) 2023/12/12 13:18:14 | stderr | /bitnami/blacksmith-sandox/oauth2-proxy-7.5.1/pkg/mod/github.com/prometheus/[email protected]/prometheus/promhttp/instrument_server.go:60 +0xd4 2023/12/12 13:18:14 | stderr | github.com/prometheus/client_golang/prometheus/promhttp.InstrumentHandlerInFlight.func1({0x7fd461d622b8, 0xc00031b110}, 0x103c300?) 2023/12/12 13:18:14 | stderr | /opt/bitnami/go/src/net/http/server.go:2122 +0x2f 2023/12/12 13:18:14 | stderr | net/http.HandlerFunc.ServeHTTP(0xacd9be?, {0x7fd461d622b8?, 0xc00031b110?}, 0xc00031b0e0?) 2023/12/12 13:18:14 | stderr | /bitnami/blacksmith-sandox/oauth2-proxy-7.5.1/pkg/mod/github.com/prometheus/[email protected]/prometheus/promhttp/instrument_server.go:108 +0xbf 2023/12/12 13:18:14 | stderr | github.com/prometheus/client_golang/prometheus/promhttp.InstrumentHandlerDuration.func2({0x7fd461d622b8, 0xc00031b110}, 0xc0002a0700) 2023/12/12 13:18:14 | stderr | /opt/bitnami/go/src/net/http/server.go:2122 +0x2f 2023/12/12 13:18:14 | stderr | net/http.HandlerFunc.ServeHTTP(0x30?, {0x7fd461d622b8?, 0xc00031b110?}, 0xc000353488?) 2023/12/12 13:18:14 | stderr | /bitnami/blacksmith-sandox/oauth2-proxy-7.5.1/src/github.com/oauth2-proxy/oauth2-proxy/oauthproxy.go:1012 +0x5c 2023/12/12 13:18:14 | stderr | main.prepareNoCacheMiddleware.func1({0x7fd461d622b8, 0xc00031b110}, 0x4cf1b7?) 2023/12/12 13:18:14 | stderr | /opt/bitnami/go/src/net/http/server.go:2122 +0x2f 2023/12/12 13:18:14 | stderr | net/http.HandlerFunc.ServeHTTP(0x7fd461d622b8?, {0x7fd461d622b8?, 0xc00031b110?}, 0x30?) 2023/12/12 13:18:14 | stderr | /bitnami/blacksmith-sandox/oauth2-proxy-7.5.1/src/github.com/oauth2-proxy/oauth2-proxy/oauthproxy.go:825 +0x335 2023/12/12 13:18:14 | stderr | main.(*OAuthProxy).OAuthCallback(0xc000464000, {0x7fd461d622b8, 0xc00031b110}, 0xc0002a0700) 2023/12/12 13:18:14 | stderr | /bitnami/blacksmith-sandox/oauth2-proxy-7.5.1/src/github.com/oauth2-proxy/oauth2-proxy/pkg/cookies/csrf.go:77 +0x27 2023/12/12 13:18:14 | stderr | github.com/oauth2-proxy/oauth2-proxy/v7/pkg/cookies.LoadCSRFCookie(0xc0002a0700, 0xc000477fc0?) 2023/12/12 13:18:14 | stderr | /bitnami/blacksmith-sandox/oauth2-proxy-7.5.1/src/github.com/oauth2-proxy/oauth2-proxy/pkg/cookies/csrf.go:94 +0x2c 2023/12/12 13:18:14 | stderr | github.com/oauth2-proxy/oauth2-proxy/v7/pkg/cookies.GenerateCookieName(0xd39920?, 0xc00042e520) 2023/12/12 13:18:14 | stderr | /bitnami/blacksmith-sandox/oauth2-proxy-7.5.1/src/github.com/oauth2-proxy/oauth2-proxy/pkg/cookies/csrf.go:222 +0x91 2023/12/12 13:18:14 | stderr | github.com/oauth2-proxy/oauth2-proxy/v7/pkg/cookies.ExtractStateSubstring(0xc000353118?) 2023/12/12 13:18:14 | stderr | /opt/bitnami/go/src/runtime/panic.go:890 +0x263 2023/12/12 13:18:14 | stderr | panic({0xe1dbe0, 0xc00003a348}) 2023/12/12 13:18:14 | stderr | /opt/bitnami/go/src/net/http/server.go:1854 +0xbf 2023/12/12 13:18:14 | stderr | net/http.(*conn).serve.func1() 2023/12/12 13:18:14 | stderr | goroutine 1873 [running]: 2023/12/12 13:18:14 | stderr | 2023/12/12 05:18:14 http: panic serving 172.27.0.1:58718: runtime error: index out of range [0] with length 0 |
@cheungpatrick : In your logs, is there an entry with something like "GET - "/oauth2/callback?code=" ? |
Complete log. I lost the IP code.
|
@jesinity did you manage to fix your issue ? I have the same |
This issue has been inactive for 60 days. If the issue is still relevant please comment to re-activate the issue. If no action is taken within 7 days, the issue will be marked closed. |
This issue has been inactive for 60 days. If the issue is still relevant please comment to re-activate the issue. If no action is taken within 7 days, the issue will be marked closed. |
Context
I'm trying to integrate the oauth2-proxy in my app.
Tried so many different options, started from version 7.3 then upgraded to 7.5 unsuccessfully.
Setup
Configuration
my app ingress:
oauth2-proxy ingress
oauth2-proxy deployment
Behaviour
First off, the flow works correctly if I omit the
--whitelist-domain=*.mydomain.com
. The oauth flow performs correctly, I authenticated then get redirected to my app.Then I noticed that I have the cookie, but the bearer token was not propagated to my app: that's what I want to happen to further act on the JWT token that I received.
I further inspected the logs and saw logs like:
The I added the whitelist domain mentioned above, that warning disappeared but other issues came about.
The new issue is that, after the successful login, once the app gets redirects to the
oauth2/callback#
, I get the errorSo I upgraded to last version, 7.5.1 from 7.3: that has these new options:
as this issue suggests:
#1937
I added these 2 options then I get this new error, quite scary:
and the error seems to be in here csrf.go
I'm really lost here, but as far as I see from the logs the "state" is there in the URL, it is something that I redacted.
Also it should not fail that miserably, but give some better error messaging on it.
Besides testing it out with the redis cache, I don't know what should I do next and what is the root cause of the problem.
Any suggestions?
The text was updated successfully, but these errors were encountered: