cockroachdb / cockroachdb/cockroach
Sentry: panic.go:783: runtime error: invalid memory address or nil pointer dereference (1) attached stack trace -- stack trace: | runtime.gopanic | GOROOT/src/runtime/panic.go:783 | runtime.p...
- Dominant language
- Go
- Stars
- 32.5k
- Forks
- 4.1k
- PR merge metrics
- PR metrics pending
Description
This issue was auto filed by Sentry. It represents a crash or reported error on a live cluster with telemetry enabled.
Sentry Link: [https://cockroach-labs.sentry.io/issues/7499581027/?referrer=webhooks_plugin](https://cockroach-labs.sentry.io/issues/7499581027/?referrer=webhooks_plugin)
Panic Message:
```
panic.go:783: runtime error: invalid memory address or nil pointer dereference
(1) attached stack trace
-- stack trace:
| runtime.gopanic
| GOROOT/src/runtime/panic.go:783
| runtime.panicmem
| GOROOT/src/runtime/panic.go:262
| runtime.sigpanic
| GOROOT/src/runtime/signal_unix.go:925
| github.com/cockroachdb/cockroach/pkg/server.(*statusServer).redactRangesResponse
| status.go:2543
| github.com/cockroachdb/cockroach/pkg/server.(*systemStatusServer).Ranges
| status.go:2533
| github.com/cockroachdb/cockroach/pkg/server/serverpb._Status_Ranges_Handler.func1
| bazel-out/k8-opt/bin/pkg/server/serverpb/serverpb_go_proto_/github.com/cockroachdb/cockroach/pkg/server/serverpb/status.pb.go:9871
| github.com/cockroachdb/cockroach/pkg/rpc.NewServerEx.ServerInterceptor.func12
| pkg/util/tracing/grpcinterceptor/grpc_interceptor.go:68
| google.golang.org/grpc.getChainUnaryHandler.func1.getChainUnaryHandler.1
| external/org_golang_google_grpc/server.go:1177
| github.com/cockroachdb/cockroach/pkg/rpc.NewServerEx.func3
| pkg/rpc/context.go:181
| google.golang.org/grpc.getChainUnaryHandler.func1
| external/org_golang_google_grpc/server.go:1177
| github.com/cockroachdb/cockroach/pkg/rpc.gatewayRequestRecoveryInterceptor
| pkg/rpc/metrics.go:554
| google.golang.org/grpc.getChainUnaryHandler.func1.getChainUnaryHandler.1
| external/org_golang_google_grpc/server.go:1177
| github.com/cockroachdb/cockroach/pkg/server.newGRPCServer.NewRequestMetricsInterceptor.func4
| pkg/rpc/metrics.go:472
| google.golang.org/grpc.getChainUnaryHandler.func1
| external/org_golang_google_grpc/server.go:1177
| github.com/cockroachdb/cockroach/pkg/rpc.NewServerEx.func1.1
| pkg/rpc/context.go:138
| github.com/cockroachdb/cockroach/pkg/util/stop.(*Stopper).RunTaskWithErr
| pkg/util/stop/stopper.go:358
| github.com/cockroachdb/cockroach/pkg/rpc.NewServerEx.func1
| pkg/rpc/context.go:136
| google.golang.org/grpc.NewServer.chainUnaryServerInterceptors.chainUnaryInterceptors.func1
| external/org_golang_google_grpc/server.go:1168
| github.com/cockroachdb/cockroach/pkg/server/serverpb._Status_Ranges_Handler
| bazel-out/k8-opt/bin/pkg/server/serverpb/serverpb_go_proto_/github.com/cockroachdb/cockroach/pkg/server/serverpb/status.pb.go:9873
| google.golang.org/grpc.(*Server).processUnaryRPC
| external/org_golang_google_grpc/server.go:1358
| google.golang.org/grpc.(*Server).handleStream
| external/org_golang_google_grpc/server.go:1735
| google.golang.org/grpc.(*Server).serveStreams.func1.1
| external/org_golang_google_grpc/server.go:970
| runtime.goexit
| src/runtime/asm_arm64.s:1268
Wraps: (2) runtime error: invalid memory address or nil pointer dereference
Error types: (1) *withstack.withStack (2) runtime.errorString
-- report composition:
runtime.errorString
panic.go:783: *withstack.withStack (top exception)
```
Stacktrace (expand for inline code snippets):
[src/runtime/asm_arm64.s#L1267-L1269](src/runtime/asm_arm64.s#L1267-L1269)
[external/org_golang_google_grpc/server.go#L969-L971](external/org_golang_google_grpc/server.go#L969-L971)
[external/org_golang_google_grpc/server.go#L1734-L1736](external/org_golang_google_grpc/server.go#L1734-L1736)
[external/org_golang_google_grpc/server.go#L1357-L1359](external/org_golang_google_grpc/server.go#L1357-L1359)
[bazel-out/k8-opt/bin/pkg/server/serverpb/serverpb_go_proto_/https://github.com/cockroachdb/cockroach/blob/87953f064653dfa86d766ecfc6f475e78a59fead/pkg/server/serverpb/status.pb.go#L9872-L9874](bazel-out/k8-opt/bin/pkg/server/serverpb/serverpb_go_proto_/https://github.com/cockroachdb/cockroach/blob/87953f064653dfa86d766ecfc6f475e78a59fead/pkg/server/serverpb/status.pb.go#L9872-L9874)
[external/org_golang_google_grpc/server.go#L1167-L1169](external/org_golang_google_grpc/server.go#L1167-L1169)
[pkg/rpc/context.go#L135-L137](pkg/rpc/context.go#L135-L137)
[pkg/util/stop/stopper.go#L357-L359](pkg/util/stop/stopper.go#L357-L359)
[pkg/rpc/context.go#L137-L139](pkg/rpc/context.go#L137-L139)
[external/org_golang_google_grpc/server.go#L1176-L1178](external/org_golang_google_grpc/server.go#L1176-L1178)
[pkg/rpc/metrics.go#L471-L473](pkg/rpc/metrics.go#L471-L473)
[external/org_golang_google_grpc/server.go#L1176-L1178](external/org_golang_google_grpc/server.go#L1176-L1178)
[pkg/rpc/metrics.go#L553-L555](pkg/rpc/metrics.go#L553-L555)
[external/org_golang_google_grpc/server.go#L1176-L1178](external/org_golang_google_grpc/server.go#L1176-L1178)
[pkg/rpc/context.go#L180-L182](pkg/rpc/context.go#L180-L182)
[external/org_golang_google_grpc/server.go#L1176-L1178](external/org_golang_google_grpc/server.go#L1176-L1178)
[pkg/util/tracing/grpcinterceptor/grpc_interceptor.go#L67-L69](pkg/util/tracing/grpcinterceptor/grpc_interceptor.go#L67-L69)
[bazel-out/k8-opt/bin/pkg/server/serverpb/serverpb_go_proto_/https://github.com/cockroachdb/cockroach/blob/87953f064653dfa86d766ecfc6f475e78a59fead/pkg/server/serverpb/status.pb.go#L9870-L9872](bazel-out/k8-opt/bin/pkg/server/serverpb/serverpb_go_proto_/https://github.com/cockroachdb/cockroach/blob/87953f064653dfa86d766ecfc6f475e78a59fead/pkg/server/serverpb/status.pb.go#L9870-L9872)
[status.go#L2532-L2534](status.go#L2532-L2534)
[status.go#L2542-L2544](status.go#L2542-L2544)
[GOROOT/src/runtime/signal_unix.go#L924-L926](GOROOT/src/runtime/signal_unix.go#L924-L926)
[GOROOT/src/runtime/panic.go#L261-L263](GOROOT/src/runtime/panic.go#L261-L263)
[GOROOT/src/runtime/panic.go#L782-L784](GOROOT/src/runtime/panic.go#L782-L784)
```
src/runtime/asm_arm64.s in runtime.goexit at line 1268
external/org_golang_google_grpc/server.go in google.golang.org/grpc.(*Server).serveStreams.func1.1 at line 970
external/org_golang_google_grpc/server.go in google.golang.org/grpc.(*Server).handleStream at line 1735
external/org_golang_google_grpc/server.go in google.golang.org/grpc.(*Server).processUnaryRPC at line 1358
bazel-out/k8-opt/bin/pkg/server/serverpb/serverpb_go_proto_/github.com/cockroachdb/cockroach/pkg/server/serverpb/status.pb.go in pkg/server/serverpb._Status_Ranges_Handler at line 9873
external/org_golang_google_grpc/server.go in google.golang.org/grpc.NewServer.chainUnaryServerInterceptors.chainUnaryInterceptors.func1 at line 1168
pkg/rpc/context.go in pkg/rpc.NewServerEx.func1 at line 136
pkg/util/stop/stopper.go in pkg/util/stop.(*Stopper).RunTaskWithErr at line 358
pkg/rpc/context.go in pkg/rpc.NewServerEx.func1.1 at line 138
external/org_golang_google_grpc/server.go in google.golang.org/grpc.getChainUnaryHandler.func1 at line 1177
pkg/rpc/metrics.go in pkg/server.newGRPCServer.NewRequestMetricsInterceptor.func4 at line 472
external/org_golang_google_grpc/server.go in google.golang.org/grpc.getChainUnaryHandler.func1.getChainUnaryHandler.1 at line 1177
pkg/rpc/metrics.go in pkg/rpc.gatewayRequestRecoveryInterceptor at line 554
external/org_golang_google_grpc/server.go in google.golang.org/grpc.getChainUnaryHandler.func1 at line 1177
pkg/rpc/context.go in pkg/rpc.NewServerEx.func3 at line 181
external/org_golang_google_grpc/server.go in google.golang.org/grpc.getChainUnaryHandler.func1.getChainUnaryHandler.1 at line 1177
pkg/util/tracing/grpcinterceptor/grpc_interceptor.go in pkg/rpc.NewServerEx.ServerInterceptor.func12 at line 68
bazel-out/k8-opt/bin/pkg/server/serverpb/serverpb_go_proto_/github.com/cockroachdb/cockroach/pkg/server/serverpb/status.pb.go in pkg/server/serverpb._Status_Ranges_Handler.func1 at line 9871
status.go in pkg/server.(*systemStatusServer).Ranges at line 2533
status.go in pkg/server.(*statusServer).redactRangesResponse at line 2543
GOROOT/src/runtime/signal_unix.go in runtime.sigpanic at line 925
GOROOT/src/runtime/panic.go in runtime.panicmem at line 262
GOROOT/src/runtime/panic.go in runtime.gopanic at line 783
```
### Tags
| Tag | Value |
| --- | --- |
| Command | server |
| Environment | v26.1.4 |
| Go Version | go1.25.5 |
| Platform | darwin arm64 |
| Distribution | CCL |
| Cockroach Release | v26.1.4 |
| Cockroach SHA | 87953f064653dfa86d766ecfc6f475e78a59fead |
| # of CPUs | 8 |
| # of Goroutines | 548 |
Jira issue: CRDB-64180
Contributor guide
Research direction
Start in pkg/server/status.go at systemStatusServer.Ranges and statusServer.redactRangesResponse, using the Sentry stack trace and the reported v26.1.4 commit as context. Determine which nil state reaches the redaction path, then verify that the Ranges endpoint no longer panics under that condition and run the relevant server tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api, backend, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100