cockroachdb / cockroachdb/cockroach
Sentry: panic.go:791: runtime error: invalid memory address or nil pointer dereference (1) attached stack trace -- stack trace: | runtime.gopanic | GOROOT/src/runtime/panic.go:791 | 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/7416726537/?referrer=webhooks_plugin](https://cockroach-labs.sentry.io/issues/7416726537/?referrer=webhooks_plugin)
Panic Message:
```
panic.go:791: runtime error: invalid memory address or nil pointer dereference
(1) attached stack trace
-- stack trace:
| runtime.gopanic
| GOROOT/src/runtime/panic.go:791
| runtime.panicmem
| GOROOT/src/runtime/panic.go:262
| runtime.sigpanic
| GOROOT/src/runtime/signal_unix.go:917
| strings.(*byteStringReplacer).WriteString
| GOROOT/src/strings/replace.go:554
| strings.(*Replacer).WriteString
| GOROOT/src/strings/replace.go:103
| github.com/prometheus/common/expfmt.writeEscapedString
| external/com_github_prometheus_common/expfmt/text_create.go:424
| github.com/prometheus/common/expfmt.writeLabelPairs
| external/com_github_prometheus_common/expfmt/text_create.go:368
| github.com/prometheus/common/expfmt.writeSample
| external/com_github_prometheus_common/expfmt/text_create.go:296
| github.com/prometheus/common/expfmt.MetricFamilyToText
| external/com_github_prometheus_common/expfmt/text_create.go:171
| github.com/prometheus/common/expfmt.NewEncoder.func7
| external/com_github_prometheus_common/expfmt/encode.go:144
| github.com/prometheus/common/expfmt.encoderCloser.Encode
| external/com_github_prometheus_common/expfmt/encode.go:50
| github.com/cockroachdb/cockroach/pkg/util/metric.(*PrometheusExporter).printAsText
| pkg/util/metric/prometheus_exporter.go:222
| github.com/cockroachdb/cockroach/pkg/util/metric.(*PrometheusExporter).ScrapeAndPrintAsText
| pkg/util/metric/prometheus_exporter.go:242
| github.com/cockroachdb/cockroach/pkg/server/status.(*MetricsRecorder).PrintAsText
| recorder.go:402
| github.com/cockroachdb/cockroach/pkg/server.varsHandler.handleVars
| pkg/server/status.go:2493
| net/http.HandlerFunc.ServeHTTP
| GOROOT/src/net/http/server.go:2220
| net/http.(*ServeMux).ServeHTTP
| GOROOT/src/net/http/server.go:2747
| net/http.HandlerFunc.ServeHTTP
| GOROOT/src/net/http/server.go:2220
| github.com/NYTimes/gziphandler.NewGzipLevelAndMinSize.func1.1
| external/com_github_nytimes_gziphandler/gzip.go:253
| net/http.HandlerFunc.ServeHTTP
| GOROOT/src/net/http/server.go:2220
| github.com/cockroachdb/cockroach/pkg/server.(*nodeProxy).nodeProxyHandler
| pkg/server/node_http_router.go:58
| github.com/cockroachdb/cockroach/pkg/server.(*httpServer).baseHandler
| pkg/server/server_http.go:425
| github.com/cockroachdb/cockroach/pkg/server.(*serverController).httpMux
| pkg/server/server_controller_http.go:153
| net/http.HandlerFunc.ServeHTTP
| GOROOT/src/net/http/server.go:2220
| net/http.serverHandler.ServeHTTP
| GOROOT/src/net/http/server.go:3210
| net/http.(*conn).serve
| GOROOT/src/net/http/server.go:2092
| runtime.goexit
| src/runtime/asm_arm64.s:1223
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:791: *withstack.withStack (top exception)
```
Stacktrace (expand for inline code snippets):
[src/runtime/asm_arm64.s#L1222-L1224](src/runtime/asm_arm64.s#L1222-L1224)
[GOROOT/src/net/http/server.go#L2091-L2093](GOROOT/src/net/http/server.go#L2091-L2093)
[GOROOT/src/net/http/server.go#L3209-L3211](GOROOT/src/net/http/server.go#L3209-L3211)
[GOROOT/src/net/http/server.go#L2219-L2221](GOROOT/src/net/http/server.go#L2219-L2221)
[pkg/server/server_controller_http.go#L152-L154](pkg/server/server_controller_http.go#L152-L154)
[pkg/server/server_http.go#L424-L426](pkg/server/server_http.go#L424-L426)
[pkg/server/node_http_router.go#L57-L59](pkg/server/node_http_router.go#L57-L59)
[GOROOT/src/net/http/server.go#L2219-L2221](GOROOT/src/net/http/server.go#L2219-L2221)
[external/com_github_nytimes_gziphandler/gzip.go#L252-L254](external/com_github_nytimes_gziphandler/gzip.go#L252-L254)
[GOROOT/src/net/http/server.go#L2219-L2221](GOROOT/src/net/http/server.go#L2219-L2221)
[GOROOT/src/net/http/server.go#L2746-L2748](GOROOT/src/net/http/server.go#L2746-L2748)
[GOROOT/src/net/http/server.go#L2219-L2221](GOROOT/src/net/http/server.go#L2219-L2221)
[pkg/server/status.go#L2492-L2494](pkg/server/status.go#L2492-L2494)
[recorder.go#L401-L403](recorder.go#L401-L403)
[pkg/util/metric/prometheus_exporter.go#L241-L243](pkg/util/metric/prometheus_exporter.go#L241-L243)
[pkg/util/metric/prometheus_exporter.go#L221-L223](pkg/util/metric/prometheus_exporter.go#L221-L223)
[external/com_github_prometheus_common/expfmt/encode.go#L49-L51](external/com_github_prometheus_common/expfmt/encode.go#L49-L51)
[external/com_github_prometheus_common/expfmt/encode.go#L143-L145](external/com_github_prometheus_common/expfmt/encode.go#L143-L145)
[external/com_github_prometheus_common/expfmt/text_create.go#L170-L172](external/com_github_prometheus_common/expfmt/text_create.go#L170-L172)
[external/com_github_prometheus_common/expfmt/text_create.go#L295-L297](external/com_github_prometheus_common/expfmt/text_create.go#L295-L297)
[external/com_github_prometheus_common/expfmt/text_create.go#L367-L369](external/com_github_prometheus_common/expfmt/text_create.go#L367-L369)
[external/com_github_prometheus_common/expfmt/text_create.go#L423-L425](external/com_github_prometheus_common/expfmt/text_create.go#L423-L425)
[GOROOT/src/strings/replace.go#L102-L104](GOROOT/src/strings/replace.go#L102-L104)
[GOROOT/src/strings/replace.go#L553-L555](GOROOT/src/strings/replace.go#L553-L555)
[GOROOT/src/runtime/signal_unix.go#L916-L918](GOROOT/src/runtime/signal_unix.go#L916-L918)
[GOROOT/src/runtime/panic.go#L261-L263](GOROOT/src/runtime/panic.go#L261-L263)
[GOROOT/src/runtime/panic.go#L790-L792](GOROOT/src/runtime/panic.go#L790-L792)
```
src/runtime/asm_arm64.s in runtime.goexit at line 1223
GOROOT/src/net/http/server.go in net/http.(*conn).serve at line 2092
GOROOT/src/net/http/server.go in net/http.serverHandler.ServeHTTP at line 3210
GOROOT/src/net/http/server.go in net/http.HandlerFunc.ServeHTTP at line 2220
pkg/server/server_controller_http.go in pkg/server.(*serverController).httpMux at line 153
pkg/server/server_http.go in pkg/server.(*httpServer).baseHandler at line 425
pkg/server/node_http_router.go in pkg/server.(*nodeProxy).nodeProxyHandler at line 58
GOROOT/src/net/http/server.go in net/http.HandlerFunc.ServeHTTP at line 2220
external/com_github_nytimes_gziphandler/gzip.go in github.com/NYTimes/gziphandler.NewGzipLevelAndMinSize.func1.1 at line 253
GOROOT/src/net/http/server.go in net/http.HandlerFunc.ServeHTTP at line 2220
GOROOT/src/net/http/server.go in net/http.(*ServeMux).ServeHTTP at line 2747
GOROOT/src/net/http/server.go in net/http.HandlerFunc.ServeHTTP at line 2220
pkg/server/status.go in pkg/server.varsHandler.handleVars at line 2493
recorder.go in pkg/server/status.(*MetricsRecorder).PrintAsText at line 402
pkg/util/metric/prometheus_exporter.go in pkg/util/metric.(*PrometheusExporter).ScrapeAndPrintAsText at line 242
pkg/util/metric/prometheus_exporter.go in pkg/util/metric.(*PrometheusExporter).printAsText at line 222
external/com_github_prometheus_common/expfmt/encode.go in github.com/prometheus/common/expfmt.encoderCloser.Encode at line 50
external/com_github_prometheus_common/expfmt/encode.go in github.com/prometheus/common/expfmt.NewEncoder.func7 at line 144
external/com_github_prometheus_common/expfmt/text_create.go in github.com/prometheus/common/expfmt.MetricFamilyToText at line 171
external/com_github_prometheus_common/expfmt/text_create.go in github.com/prometheus/common/expfmt.writeSample at line 296
external/com_github_prometheus_common/expfmt/text_create.go in github.com/prometheus/common/expfmt.writeLabelPairs at line 368
external/com_github_prometheus_common/expfmt/text_create.go in github.com/prometheus/common/expfmt.writeEscapedString at line 424
GOROOT/src/strings/replace.go in strings.(*Replacer).WriteString at line 103
GOROOT/src/strings/replace.go in strings.(*byteStringReplacer).WriteString at line 554
GOROOT/src/runtime/signal_unix.go in runtime.sigpanic at line 917
GOROOT/src/runtime/panic.go in runtime.panicmem at line 262
GOROOT/src/runtime/panic.go in runtime.gopanic at line 791
```
### Tags
| Tag | Value |
| --- | --- |
| Command | server |
| Environment | v25.4.8 |
| Go Version | go1.23.12 X:nocoverageredesign |
| Platform | linux arm64 |
| Distribution | CCL |
| Cockroach Release | v25.4.8 |
| Cockroach SHA | 466b1cd8cd953daa0c18a38cd32466a5c3dc73a3 |
| # of CPUs | 2 |
| # of Goroutines | 1328 |
Jira issue: CRDB-62964
Contributor guide
Assessment
This issue has not been assessed yet.