Skip to content
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

Panic on missing group schema ID #4274

Closed
xoxys opened this issue Jul 25, 2022 · 7 comments · Fixed by #4331
Closed

Panic on missing group schema ID #4274

xoxys opened this issue Jul 25, 2022 · 7 comments · Fixed by #4331
Assignees
Labels
Priority:p1-urgent Consider a hotfix release with only that fix Type:Bug

Comments

@xoxys
Copy link
Contributor

xoxys commented Jul 25, 2022

Describe the bug

oCIS panics if the LDAP_GROUP_SCHEMA_ID is set to an unknown attribute.

2022/07/25 08:54:31 http: panic serving 127.0.0.1:58538: runtime error: invalid memory address or nil pointer dereference
goroutine 2179 [running]:
net/http.(*conn).serve.func1()
	net/http/server.go:1825 +0xbf
panic({0x39ba680, 0x528cfc0})
	runtime/panic.go:844 +0x258
github.com/owncloud/ocis/v2/services/graph/pkg/identity.(*LDAP).GetGroups(0xc0008aaa20, {0x3dd8688, 0xc0089dea80}, 0xc0089dfa70)
	github.com/owncloud/ocis/v2/services/graph/pkg/identity/ldap.go:643 +0x84d
github.com/owncloud/ocis/v2/services/graph/pkg/service/v0.Graph.GetGroups({0xc000d68fc0, 0xc055252b40, 0xc0004495f0, {0x3de9348, 0xc0008aaa20}, {0x7fe8073207a0, 0xc0004679b8}, {0x3dd96f0, 0xc001584be0}, 0xc055217200, ...}, ...)
	github.com/owncloud/ocis/v2/services/graph/pkg/service/v0/groups.go:34 +0x1a2
net/http.HandlerFunc.ServeHTTP(0xc00101f960?, {0x7fe8046e5970?, 0xc0089c7040?}, 0xc0089dfa10?)
	net/http/server.go:2084 +0x2f
github.com/owncloud/ocis/v2/services/graph/pkg/middleware.RequireAdmin.func1.1({0x7fe8046e5970, 0xc0089c7040}, 0xc008864e00)
	github.com/owncloud/ocis/v2/services/graph/pkg/middleware/requireadmin.go:46 +0x212
net/http.HandlerFunc.ServeHTTP(0xc000dbbf80?, {0x7fe8046e5970?, 0xc0089c7040?}, 0xc007ae03e0?)
	net/http/server.go:2084 +0x2f
github.com/go-chi/chi/v5.(*ChainHandler).ServeHTTP(0x3989dc0?, {0x7fe8046e5970?, 0xc0089c7040?}, 0x36396c0?)
	github.com/go-chi/chi/[email protected]/chain.go:31 +0x2c
github.com/go-chi/chi/v5.(*Mux).routeHTTP(0xc055252fc0, {0x7fe8046e5970, 0xc0089c7040}, 0xc008864e00)
	github.com/go-chi/chi/[email protected]/mux.go:442 +0x216
net/http.HandlerFunc.ServeHTTP(0x0?, {0x7fe8046e5970?, 0xc0089c7040?}, 0x528bb90?)
	net/http/server.go:2084 +0x2f
github.com/go-chi/chi/v5.(*Mux).ServeHTTP(0xc055252fc0, {0x7fe8046e5970, 0xc0089c7040}, 0xc008864e00)
	github.com/go-chi/chi/[email protected]/mux.go:71 +0x48d
github.com/go-chi/chi/v5.(*Mux).Mount.func1({0x7fe8046e5970, 0xc0089c7040}, 0xc008864e00)
	github.com/go-chi/chi/[email protected]/mux.go:314 +0x19c
net/http.HandlerFunc.ServeHTTP(0x3989dc0?, {0x7fe8046e5970?, 0xc0089c7040?}, 0xc008877bb0?)
	net/http/server.go:2084 +0x2f
github.com/go-chi/chi/v5.(*Mux).routeHTTP(0xc055252cc0, {0x7fe8046e5970, 0xc0089c7040}, 0xc008864e00)
	github.com/go-chi/chi/[email protected]/mux.go:442 +0x216
net/http.HandlerFunc.ServeHTTP(0x0?, {0x7fe8046e5970?, 0xc0089c7040?}, 0x457210?)
	net/http/server.go:2084 +0x2f
github.com/go-chi/chi/v5.(*Mux).ServeHTTP(0xc055252cc0, {0x7fe8046e5970, 0xc0089c7040}, 0xc008864e00)
	github.com/go-chi/chi/[email protected]/mux.go:71 +0x48d
github.com/go-chi/chi/v5.(*Mux).Mount.func1({0x7fe8046e5970, 0xc0089c7040}, 0xc008864e00)
	github.com/go-chi/chi/[email protected]/mux.go:314 +0x19c
net/http.HandlerFunc.ServeHTTP(0x3989dc0?, {0x7fe8046e5970?, 0xc0089c7040?}, 0xc008877ba4?)
	net/http/server.go:2084 +0x2f
github.com/go-chi/chi/v5.(*Mux).routeHTTP(0xc055252c60, {0x7fe8046e5970, 0xc0089c7040}, 0xc008864e00)
	github.com/go-chi/chi/[email protected]/mux.go:442 +0x216
net/http.HandlerFunc.ServeHTTP(0xc0055433a8?, {0x7fe8046e5970?, 0xc0089c7040?}, 0x393fe60?)
	net/http/server.go:2084 +0x2f
github.com/go-chi/chi/v5/middleware.StripSlashes.func1({0x7fe8046e5970, 0xc0089c7040}, 0xc008864e00)
	github.com/go-chi/chi/[email protected]/middleware/strip.go:30 +0x139
net/http.HandlerFunc.ServeHTTP(0x0?, {0x7fe8046e5970?, 0xc0089c7040?}, 0x457210?)
	net/http/server.go:2084 +0x2f
github.com/go-chi/chi/v5.(*Mux).ServeHTTP(0xc055252c60, {0x7fe8046e5970, 0xc0089c7040}, 0xc008864e00)
	github.com/go-chi/chi/[email protected]/mux.go:71 +0x48d
github.com/go-chi/chi/v5.(*Mux).Mount.func1({0x7fe8046e5970, 0xc0089c7040}, 0xc008864e00)
	github.com/go-chi/chi/[email protected]/mux.go:314 +0x19c
net/http.HandlerFunc.ServeHTTP(0x3989dc0?, {0x7fe8046e5970?, 0xc0089c7040?}, 0xc00898cc04?)
	net/http/server.go:2084 +0x2f
github.com/go-chi/chi/v5.(*Mux).routeHTTP(0xc055252b40, {0x7fe8046e5970, 0xc0089c7040}, 0xc008864e00)
	github.com/go-chi/chi/[email protected]/mux.go:442 +0x216
net/http.HandlerFunc.ServeHTTP(0x3dd8688?, {0x7fe8046e5970?, 0xc0089c7040?}, 0x2?)
	net/http/server.go:2084 +0x2f
github.com/owncloud/ocis/v2/services/graph/pkg/middleware.Auth.func1.1({0x7fe8046e5970, 0xc0089c7040}, 0xc008864d00)
	github.com/owncloud/ocis/v2/services/graph/pkg/middleware/auth.go:84 +0x562
net/http.HandlerFunc.ServeHTTP(0x3dd61b0?, {0x7fe8046e5970?, 0xc0089c7040?}, 0xc000078c00?)
	net/http/server.go:2084 +0x2f
github.com/owncloud/ocis/v2/ocis-pkg/middleware.Logger.func1.1({0x3dd61b0, 0xc007d03c00}, 0xc008864d00)
	github.com/owncloud/ocis/v2/ocis-pkg/middleware/logger.go:17 +0xc8
net/http.HandlerFunc.ServeHTTP(0x3ba9ae0?, {0x3dd61b0?, 0xc007d03c00?}, 0xf?)
	net/http/server.go:2084 +0x2f
github.com/owncloud/ocis/v2/ocis-pkg/middleware.Version.func1.1({0x3dd61b0, 0xc007d03c00}, 0x3639f01?)
	github.com/owncloud/ocis/v2/ocis-pkg/middleware/version.go:18 +0x18f
net/http.HandlerFunc.ServeHTTP(0x3dd8688?, {0x3dd61b0?, 0xc007d03c00?}, 0x3639fa0?)
	net/http/server.go:2084 +0x2f
github.com/go-chi/chi/v5/middleware.RequestID.func1({0x3dd61b0, 0xc007d03c00}, 0xc008864c00)
	github.com/go-chi/chi/[email protected]/middleware/request_id.go:76 +0x354
net/http.HandlerFunc.ServeHTTP(0x3dd85e0?, {0x3dd61b0?, 0xc007d03c00?}, 0x528bb90?)
	net/http/server.go:2084 +0x2f
github.com/go-chi/chi/v5.(*Mux).ServeHTTP(0xc055252b40, {0x3dd61b0, 0xc007d03c00}, 0xc0087bd500)
	github.com/go-chi/chi/[email protected]/mux.go:88 +0x442
github.com/owncloud/ocis/v2/services/graph/pkg/service/v0.Graph.ServeHTTP(...)
	github.com/owncloud/ocis/v2/services/graph/pkg/service/v0/graph.go:85
github.com/owncloud/ocis/v2/services/graph/pkg/service/v0.instrument.ServeHTTP(...)
	github.com/owncloud/ocis/v2/services/graph/pkg/service/v0/instrument.go:24
github.com/owncloud/ocis/v2/services/graph/pkg/service/v0.logging.ServeHTTP(...)
	github.com/owncloud/ocis/v2/services/graph/pkg/service/v0/logging.go:24
github.com/owncloud/ocis/v2/services/graph/pkg/service/v0.tracing.ServeHTTP(...)
	github.com/owncloud/ocis/v2/services/graph/pkg/service/v0/tracing.go:20
net/http.serverHandler.ServeHTTP({0xc0084b1830?}, {0x3dd61b0, 0xc007d03c00}, 0xc0087bd500)
	net/http/server.go:2916 +0x43b
net/http.(*conn).serve(0xc008365720, {0x3dd8688, 0xc0014f6780})
	net/http/server.go:1966 +0x5d7
created by net/http.(*Server).Serve
	net/http/server.go:3071 +0x4db

Expected behavior

Raise an error, but don't panic on unknown attributes.

Setup

Container (owncloud/ocis:2.0.0-beta.5) + External OpenLDAP

@xoxys xoxys added the Type:Bug label Jul 25, 2022
@micbar micbar added the Priority:p1-urgent Consider a hotfix release with only that fix label Jul 26, 2022
@dragonchaser dragonchaser self-assigned this Jul 27, 2022
@xoxys
Copy link
Contributor Author

xoxys commented Jul 28, 2022

Seems to be fixed on latest already...

@dragonchaser
Copy link
Contributor

@xoxys thx, closing then

@micbar
Copy link
Contributor

micbar commented Jul 28, 2022

what was the fix? Would be important to link the code change.

@xoxys
Copy link
Contributor Author

xoxys commented Jul 28, 2022

Nobody knows right now

@dragonchaser
Copy link
Contributor

could have been the bump of libregraph/idm shortly after the beta, but just guessing maybe @rhafer knows more?

@xoxys
Copy link
Contributor Author

xoxys commented Jul 28, 2022

Thats what git bisect is made for, but I dont have time to look into it.

@rhafer
Copy link
Contributor

rhafer commented Aug 2, 2022

I am pretty sure this is not fixed yet. At least I don't remember fixing it. Fix would be in the graph service. Will reopen and check again.

@rhafer rhafer reopened this Aug 2, 2022
@rhafer rhafer self-assigned this Aug 2, 2022
rhafer added a commit to rhafer/ocis that referenced this issue Aug 4, 2022
rhafer added a commit to rhafer/ocis that referenced this issue Aug 4, 2022
rhafer added a commit that referenced this issue Aug 5, 2022
rhafer added a commit that referenced this issue Aug 5, 2022
ownclouders pushed a commit that referenced this issue Aug 5, 2022
Author: Ralf Haferkamp <[email protected]>
Date:   Thu Aug 4 10:45:10 2022 +0200

    Add changelog for #4274
@micbar micbar added this to the 2.0.0 General Availability milestone Aug 8, 2022
@dragonchaser dragonchaser removed their assignment Aug 9, 2022
@micbar micbar mentioned this issue Aug 11, 2022
26 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority:p1-urgent Consider a hotfix release with only that fix Type:Bug
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants