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 SUBNET registration #1920

Closed
pjuarezd opened this issue Dec 27, 2023 · 0 comments · Fixed by #1921
Closed

panic on SUBNET registration #1920

pjuarezd opened this issue Dec 27, 2023 · 0 comments · Fixed by #1921
Assignees

Comments

@pjuarezd
Copy link
Member

Register Operator on subnet properly and do not show error or silently catch the error.

Steps to Reproduce (for bugs)

This is a bug when registering from MinIO Operator UI with SUBNET, snapshot of screen for reference.

Screenshot 2023-12-27 at 1 58 41 PM

When a valid active API Key is provided a PANIC error runtime error: invalid memory address or nil pointer dereference shows in the console pod log:

2023/12/27 21:55:05 server.go:3214: http: panic serving 127.0.0.1:55600: runtime error: invalid memory address or nil pointer dereference
goroutine 355 [running]:
net/http.(*conn).serve.func1()
    net/http/server.go:1868 +0xb0
panic({0x1f24f80?, 0x5d22960?})
    runtime/panic.go:920 +0x26c
github.com/minio/operator/api.SubnetRegisterWithAPIKey({0x48bef98, 0x40004da4b0}, {0x0?, 0x0?}, {0x4000c100f0, 0x24})
    github.com/minio/operator/api/operator_subnet.go:183 +0x5c
github.com/minio/operator/api.registerTenant(...)
    github.com/minio/operator/api/operator_subnet.go:206
github.com/minio/operator/api.registerTenants({0x48bef98, 0x40004da4b0}, {0x48d1228, 0x4000568030}, {0x4000ff5000?, 0x4, 0x4000e6d098?}, {0x4000c100f0, 0x24})
    github.com/minio/operator/api/operator_subnet.go:171 +0xb4
github.com/minio/operator/api.getOperatorSubnetRegisterAPIKeyResponse(0x40010202a0, {0x4000fbe300?, 0x4000d3c250?})
    github.com/minio/operator/api/operator_subnet.go:144 +0x244
github.com/minio/operator/api.registerOperatorSubnetHandlers.func4({0x4000fbe300?, 0x4000d3c250?}, 0x4000e6d098?)
    github.com/minio/operator/api/operator_subnet.go:73 +0x38
github.com/minio/operator/api/operations/operator_api.OperatorSubnetRegisterAPIKeyHandlerFunc.Handle(0x4000b8b128?, {0x4000fbe300?, 0x4000d3c250?}, 0x48997a0?)
    github.com/minio/operator/api/operations/operator_api/operator_subnet_register_api_key.go:38 +0x38
github.com/minio/operator/api/operations/operator_api.(*OperatorSubnetRegisterAPIKey).ServeHTTP(0x4000910408, {0x48b37a0, 0x40003f03c0}, 0x4000fbe300)
    github.com/minio/operator/api/operations/operator_api/operator_subnet_register_api_key.go:85 +0x234
github.com/go-openapi/runtime/middleware.(*Context).RoutesHandler.NewOperationExecutor.func1({0x48b37a0, 0x40003f03c0}, 0x4000fbe300)
    github.com/go-openapi/[email protected]/middleware/operation.go:28 +0x5c
net/http.HandlerFunc.ServeHTTP(0x1d257e0?, {0x48b37a0?, 0x40003f03c0?}, 0x0?)
    net/http/server.go:2136 +0x38
github.com/go-openapi/runtime/middleware.NewRouter.func1({0x48b37a0, 0x40003f03c0}, 0x4000fbe100)
    github.com/go-openapi/[email protected]/middleware/router.go:78 +0x1c4
net/http.HandlerFunc.ServeHTTP(0x4000b8b428?, {0x48b37a0?, 0x40003f03c0?}, 0x2817c?)
    net/http/server.go:2136 +0x38
github.com/go-openapi/runtime/middleware.Redoc.func1({0x48b37a0, 0x40003f03c0}, 0xffff5c7d34d0?)
    github.com/go-openapi/[email protected]/middleware/redoc.go:72 +0x1f4
net/http.HandlerFunc.ServeHTTP(0x40003f03c0?, {0x48b37a0?, 0x40003f03c0?}, 0x1804fc4?)
    net/http/server.go:2136 +0x38
github.com/go-openapi/runtime/middleware.Spec.func1({0x48b37a0, 0x40003f03c0}, 0x4000b8b401?)
    github.com/go-openapi/[email protected]/middleware/spec.go:46 +0x168
net/http.HandlerFunc.ServeHTTP(0x5d2f000?, {0x48b37a0?, 0x40003f03c0?}, 0x4?)
    net/http/server.go:2136 +0x38
github.com/klauspost/compress/gzhttp.NewWrapper.func1.1({0x48adea8, 0x40003f0140}, 0xedd1e9439?)
    github.com/klauspost/[email protected]/gzhttp/compress.go:497 +0x2d0
net/http.HandlerFunc.ServeHTTP(0x48b27b0?, {0x48adea8?, 0x40003f0140?}, 0x4000fa77b3?)
    net/http/server.go:2136 +0x38
github.com/minio/operator/api.setupGlobalMiddleware.AuditLogMiddleware.func1({0x48b27b0?, 0x4000b49b20?}, 0x4000fbe100)
    github.com/minio/operator/api/configure_operator.go:215 +0x68
net/http.HandlerFunc.ServeHTTP(0x4000c10005?, {0x48b27b0?, 0x4000b49b20?}, 0x1bda338?)
    net/http/server.go:2136 +0x38
github.com/minio/operator/api.setupGlobalMiddleware.proxyMiddleware.func2({0x48b27b0, 0x4000b49b20}, 0x4000fbe100)
    github.com/minio/operator/api/configure_operator.go:146 +0xb0
net/http.HandlerFunc.ServeHTTP(0x4000c10005?, {0x48b27b0?, 0x4000b49b20?}, 0x231a6d5?)
    net/http/server.go:2136 +0x38
github.com/minio/operator/api.setupGlobalMiddleware.FileServerMiddleware.func3({0x48b27b0, 0x4000b49b20}, 0x4000fbe100)
    github.com/minio/operator/api/configure_operator.go:390 +0xdc
net/http.HandlerFunc.ServeHTTP(0x4000fbe000?, {0x48b27b0?, 0x4000b49b20?}, 0x4890d20?)
    net/http/server.go:2136 +0x38
github.com/minio/operator/api.setupGlobalMiddleware.ContextMiddleware.func4({0x48b27b0, 0x4000b49b20}, 0x4000fbe000)
    github.com/minio/operator/api/configure_operator.go:207 +0x208
net/http.HandlerFunc.ServeHTTP(0x4000a88500?, {0x48b27b0?, 0x4000b49b20?}, 0x4890ce0?)
    net/http/server.go:2136 +0x38
github.com/minio/operator/api.setupGlobalMiddleware.AuthenticationMiddleware.func5({0x48b27b0, 0x4000b49b20}, 0x4000a88500)
    github.com/minio/operator/api/configure_operator.go:246 +0x26c
net/http.HandlerFunc.ServeHTTP(0x4000293e00?, {0x48b27b0?, 0x4000b49b20?}, 0x3d96e0?)
    net/http/server.go:2136 +0x38
github.com/minio/operator/api.setupGlobalMiddleware.(*Secure).Handler.func6({0x48b27b0, 0x4000b49b20}, 0x4000d3c050?)
    github.com/unrolled/[email protected]/secure.go:203 +0x8c
net/http.HandlerFunc.ServeHTTP(0x10?, {0x48b27b0?, 0x4000b49b20?}, 0x4000b49b20?)
    net/http/server.go:2136 +0x38
net/http.serverHandler.ServeHTTP({0x48a42d0?}, {0x48b27b0?, 0x4000b49b20?}, 0x6?)
    net/http/server.go:2938 +0xbc
net/http.(*conn).serve(0x4000e0db90, {0x48bef60, 0x4000c89ce0})
    net/http/server.go:2009 +0x518
created by net/http.(*Server).Serve in goroutine 38
    net/http/server.go:3086 +0x4cc

Operator Console UI API endpoint /api/v1/subnet/apikey/register retuns empty message and the register "fails" without show any error message on the UI, UI redirects to login page, no registration happens on SUBNET.

Other users reports show that UI shows an Error 503, and apparently the cluster actually gets registered on SUBNET, just the UI fails to complete the procedure. This was observed on Operator version 5.0.10

imagen

Possible Solution

Needs to handle a nil pointer exception

Your Environment

  • minio-operator 5.0.10 false negative register with 505 error banner
  • minio-operator 5.0.11 no registration at all in SUBNET.
  • Environment name and version (e.g. kubernetes v1.17.2): kubernetes, kind kindest/node:v1.27.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants