Details
-
Bug
-
Resolution: Fixed
-
Major
-
None
-
None
-
Untriaged
-
0
-
Unknown
Description
We observed a panic in Fleet Manager https://couchbasecloud.atlassian.net/browse/AV-66746 that originated from cbrest 1.0.0.
From a quick look at the code, if the request fails a nil response is returned from the retryer and Do() panics trying to assert the nil type is an *http.Response
payload, err := retryer.DoWithContext(
|
ctx,
|
func(ctx *retry.Context) (any, error) { return c.do(ctx, request) }, //nolint:bodyclose
|
)
|
|
resp := payload.(*http.Response)
|
app: cp-fm-gateway
|
caller: middleware/recovery.go:30
|
env: prod
|
error: interface conversion: interface {} is nil, not *http.Response
|
level: error
|
logger: /cp-fm-gateway
|
msg: recovered from panic while responding to a http request
|
requestId: stacktrace
|
github.com/couchbasecloud/couchbase-cloud/cmd/cp-fm-gateway/server.(*FleetManager).Start.Recovery.func5.1.1
|
internal/middleware/recovery.go:30
|
runtime.gopanic
|
GOROOT/src/runtime/panic.go:914
|
runtime.panicdottypeE
|
GOROOT/src/runtime/iface.go:263
|
github.com/couchbase/tools-common/couchbase/rest.(*Client).Do
|
external/com_github_couchbase_tools_common_couchbase/rest/client.go:684
|
github.com/couchbase/tools-common/couchbase/rest.(*Client).ExecuteWithContext
|
external/com_github_couchbase_tools_common_couchbase/rest/client.go:509
|
github.com/couchbasecloud/couchbase-cloud/internal/fleetmanager/clusters.(*IndexService).getIndexStatuses
|
internal/fleetmanager/clusters/indexes.go:456
|
github.com/couchbasecloud/couchbase-cloud/internal/fleetmanager/clusters.(*IndexService).GetClustersIndexes
|
internal/fleetmanager/clusters/indexes.go:355
|
github.com/couchbasecloud/couchbase-cloud/cmd/cp-fm-gateway/server.(*FleetManager).registerEndpoints.(*IndexesManager).GetClustersIndexes.func28
|
cmd/cp-fm-gateway/clusters/indexes.go:211
|
github.com/couchbasecloud/couchbase-cloud/cmd/cp-api/v2.(*Endpoint).ServeHTTP
|
cmd/cp-api/v2/endpoint.go:16
|
github.com/couchbasecloud/couchbase-cloud/cmd/cp-fm-gateway/server.(*JWTMiddleware).Middleware-fm.(*JWTMiddleware).Middleware.func1
|
cmd/cp-fm-gateway/server/middleware.go:84
|
net/http.HandlerFunc.ServeHTTP
|
GOROOT/src/net/http/server.go:2136
|
github.com/couchbasecloud/couchbase-cloud/cmd/cp-fm-gateway/server.(*FleetManager).Start.Recovery.func5.1
|
internal/middleware/recovery.go:48
|
net/http.HandlerFunc.ServeHTTP
|
GOROOT/src/net/http/server.go:2136
|
github.com/gorilla/mux.(*Router).ServeHTTP
|
external/com_github_gorilla_mux/mux.go:210
|
net/http.serverHandler.ServeHTTP
|
GOROOT/src/net/http/server.go:2938
|
net/http.(*conn).serve
|
GOROOT/src/net/http/server.go:2009
|
ts: 1698995839922.7468
|
Attachments
Issue Links
- depends on
-
MB-59525 [TC] [RETRY] Make retry generic on the returned type
- Resolved