500 on /info with deafult config #767

Closed
opened 2021-01-15 00:25:38 +00:00 by Ghost · 6 comments

So using the default config, when hitting the root page, you'll get the following error:

2021-01-14T19:20:41.495931293-05:00: - ▶ echo recover.go:92 [PANIC RECOVER] interface conversion: interface {} is nil, not string goroutine 14 [running]:
github.com/labstack/echo/v4/middleware.RecoverWithConfig.func1.1.1(0x1476168, 0x1000, 0x0, 0x15cd9c0, 0xc0000fd2c0)
/go/pkg/mod/github.com/labstack/echo/v4@v4.1.17/middleware/recover.go:77 +0x105
panic(0x11bd000, 0xc000367110)
/usr/local/go/src/runtime/panic.go:969 +0x1b9
code.vikunja.io/api/pkg/modules/auth/openid.getProviderFromMap(0xc00061a0c0, 0x131c645, 0x15, 0x11377c0)
/go/src/code.vikunja.io/api/pkg/modules/auth/openid/providers.go:95 +0x86d
code.vikunja.io/api/pkg/modules/auth/openid.GetAllProviders(0xc0000b07e0, 0x131f7d8, 0x17, 0xc00013a930, 0xe)
/go/src/code.vikunja.io/api/pkg/modules/auth/openid/providers.go:46 +0x1a5
code.vikunja.io/api/pkg/routes/api/v1.Info(0x15cd9c0, 0xc0000fd2c0, 0x0, 0x0)
/go/src/code.vikunja.io/api/pkg/routes/api/v1/info.go:107 +0x477
github.com/labstack/echo/v4.(*Echo).add.func1(0x15cd9c0, 0xc0000fd2c0, 0x1326094, 0x1b)
/go/pkg/mod/github.com/labstack/echo/v4@v4.1.17/echo.go:522 +0x62
github.com/labstack/echo/v4/middleware.CORSWithConfig.func1.1(0x15cd9c0, 0xc0000fd2c0, 0x203000, 0x203000)
/go/pkg/mod/github.com/labstack/echo/v4@v4.1.17/middleware/cors.go:121 +0x483
github.com/labstack/echo/v4/middleware.RecoverWithConfig.func1.1(0x15cd9c0, 0xc0000fd2c0, 0x0, 0x0)
/go/pkg/mod/github.com/labstack/echo/v4@v4.1.17/middleware/recover.go:98 +0x142
github.com/labstack/echo/v4/middleware.LoggerWithConfig.func2.1(0x15cd9c0, 0xc0000fd2c0, 0x0, 0x0)
/go/pkg/mod/github.com/labstack/echo/v4@v4.1.17/middleware/logger.go:117 +0x130
github.com/labstack/echo/v4.(*Echo).ServeHTTP(0xc0005cc000, 0x15ac5a0, 0xc000388000, 0xc0000af500)
/go/pkg/mod/github.com/labstack/echo/v4@v4.1.17/echo.go:633 +0x182
net/http.serverHandler.ServeHTTP(0xc0002500e0, 0x15ac5a0, 0xc000388000, 0xc0000af500)
/usr/local/go/src/net/http/server.go:2843 +0xa3
net/http.(*conn).serve(0xc0000fd220, 0x15b06e0, 0xc000323700)
/usr/local/go/src/net/http/server.go:1925 +0x8ad
created by net/http.(*Server).Serve
/usr/local/go/src/net/http/server.go:2969 +0x36c

So looked at the OpenID provider config mentioned in the error. Located here: https://kolaente.dev/vikunja/api/src/branch/master/pkg/modules/auth/openid/providers.go#L95. I'm not familiar with that syntax, but the error said interface {} is nil, not string. So I set the default config's openid > providers > name/authurl/clientid/clientsecret to "". That fixed the error for me.

So using the default config, when hitting the root page, you'll get the following error: ``` 2021-01-14T19:20:41.495931293-05:00: - ▶ echo recover.go:92 [PANIC RECOVER] interface conversion: interface {} is nil, not string goroutine 14 [running]: github.com/labstack/echo/v4/middleware.RecoverWithConfig.func1.1.1(0x1476168, 0x1000, 0x0, 0x15cd9c0, 0xc0000fd2c0) /go/pkg/mod/github.com/labstack/echo/v4@v4.1.17/middleware/recover.go:77 +0x105 panic(0x11bd000, 0xc000367110) /usr/local/go/src/runtime/panic.go:969 +0x1b9 code.vikunja.io/api/pkg/modules/auth/openid.getProviderFromMap(0xc00061a0c0, 0x131c645, 0x15, 0x11377c0) /go/src/code.vikunja.io/api/pkg/modules/auth/openid/providers.go:95 +0x86d code.vikunja.io/api/pkg/modules/auth/openid.GetAllProviders(0xc0000b07e0, 0x131f7d8, 0x17, 0xc00013a930, 0xe) /go/src/code.vikunja.io/api/pkg/modules/auth/openid/providers.go:46 +0x1a5 code.vikunja.io/api/pkg/routes/api/v1.Info(0x15cd9c0, 0xc0000fd2c0, 0x0, 0x0) /go/src/code.vikunja.io/api/pkg/routes/api/v1/info.go:107 +0x477 github.com/labstack/echo/v4.(*Echo).add.func1(0x15cd9c0, 0xc0000fd2c0, 0x1326094, 0x1b) /go/pkg/mod/github.com/labstack/echo/v4@v4.1.17/echo.go:522 +0x62 github.com/labstack/echo/v4/middleware.CORSWithConfig.func1.1(0x15cd9c0, 0xc0000fd2c0, 0x203000, 0x203000) /go/pkg/mod/github.com/labstack/echo/v4@v4.1.17/middleware/cors.go:121 +0x483 github.com/labstack/echo/v4/middleware.RecoverWithConfig.func1.1(0x15cd9c0, 0xc0000fd2c0, 0x0, 0x0) /go/pkg/mod/github.com/labstack/echo/v4@v4.1.17/middleware/recover.go:98 +0x142 github.com/labstack/echo/v4/middleware.LoggerWithConfig.func2.1(0x15cd9c0, 0xc0000fd2c0, 0x0, 0x0) /go/pkg/mod/github.com/labstack/echo/v4@v4.1.17/middleware/logger.go:117 +0x130 github.com/labstack/echo/v4.(*Echo).ServeHTTP(0xc0005cc000, 0x15ac5a0, 0xc000388000, 0xc0000af500) /go/pkg/mod/github.com/labstack/echo/v4@v4.1.17/echo.go:633 +0x182 net/http.serverHandler.ServeHTTP(0xc0002500e0, 0x15ac5a0, 0xc000388000, 0xc0000af500) /usr/local/go/src/net/http/server.go:2843 +0xa3 net/http.(*conn).serve(0xc0000fd220, 0x15b06e0, 0xc000323700) /usr/local/go/src/net/http/server.go:1925 +0x8ad created by net/http.(*Server).Serve /usr/local/go/src/net/http/server.go:2969 +0x36c ``` So looked at the OpenID provider config mentioned in the error. Located here: https://kolaente.dev/vikunja/api/src/branch/master/pkg/modules/auth/openid/providers.go#L95. I'm not familiar with that syntax, but the error said `interface {} is nil, not string`. So I set the default config's `openid > providers > name/authurl/clientid/clientsecret` to `""`. That fixed the error for me.
Owner

What version are you running?

What version are you running?
konrad added the
kind/bug
label 2021-01-15 06:50:20 +00:00
Author

I'm using the latest contianer as of yesterday. Though it doesn't seem to be tagged to a version since the last version is 0.16.0 but that was 5 days ago and the latest image is from 2 days ago.

I'm using the latest contianer as of yesterday. Though it doesn't seem to be tagged to a version since the last version is `0.16.0` but that was 5 days ago and the latest image is from 2 days ago.
Owner

Interestingly I can't reproduce this locally. I'll try to add a check for the interface value though.

I'm using the latest contianer as of yesterday. Though it doesn't seem to be tagged to a version since the last version is 0.16.0 but that was 5 days ago and the latest image is from 2 days ago.

Yeah latest is the current master, not the latest release.

Interestingly I can't reproduce this locally. I'll try to add a check for the interface value though. > I'm using the latest contianer as of yesterday. Though it doesn't seem to be tagged to a version since the last version is 0.16.0 but that was 5 days ago and the latest image is from 2 days ago. Yeah `latest` is the current master, not the latest release.
Owner

Have you used the sample config or no config at all? (which is pretty much the same)

Have you used the [sample config](https://kolaente.dev/vikunja/api/src/branch/master/config.yml.sample) or no config at all? (which is pretty much the same)
Owner

Should be fixed with 20af034d78, feel free to reopen if not.

Should be fixed with https://kolaente.dev/vikunja/api/commit/20af034d7897cfae08928760318536efe2534c3b, feel free to reopen if not.
Author

I was using the sample config with some modifications, but those modifications were not around auth. I will try out the new version later. Thanks!

I was using the sample config with some modifications, but those modifications were not around auth. I will try out the new version later. Thanks!
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: vikunja/vikunja#767
No description provided.