[Bug 276639] net-mgmt/vmutils: crashes due to go issue (panic: BUG: unexpected runtimemetrics.KindBad)

From: <bugzilla-noreply_at_freebsd.org>
Date: Fri, 26 Jan 2024 11:49:34 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=276639

            Bug ID: 276639
           Summary: net-mgmt/vmutils: crashes due to go issue (panic: BUG:
                    unexpected runtimemetrics.KindBad)
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
               URL: https://github.com/VictoriaMetrics/metrics/issues/59
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: danfe@FreeBSD.org
          Reporter: madpilot@FreeBSD.org
        Depends on: 275828
             Flags: maintainer-feedback?(danfe@FreeBSD.org)
          Assignee: danfe@FreeBSD.org
             Flags: merge-quarterly?

Hi,

I recently noticed my vmagent instances are failing to scrape metrics due to
frequent crashes.

I'm putting the crash message at the end of this comment.


Some analysis with a friend (Lapo Luchini) uncovered a related go bug report:

https://github.com/VictoriaMetrics/metrics/issues/59


It looks like victoriametrics 1.93.9 uses "github.com/VictoriaMetrics/metrics
v1.25.3" while the new 1.93.10 uses v1.25.4 which fixes the issue, adding code
to handle the new metrics value.

So I think it is urgent to update victoriametrics to the newer version.

I see bug #275828 contains an update, but also contains other changes.

I'm going to test a more simple update consisting only in a version bump that
maybe can be integrated faster.


----

Crash message:

panic: BUG: unexpected runtimemetrics.KindBad for
sample.Name="/gc/gomemlimit:bytes"

goroutine 133 [running]:
github.com/VictoriaMetrics/VictoriaMetrics/lib/httpserver.handlerWrapper.func1()
       
/wrkdirs/usr/ports/net-mgmt/vmutils/work/VictoriaMetrics-1.93.9/lib/httpserver/httpserver.go:235
+0x65
panic({0x994520, 0x84c414dc0})
        /usr/local/go120/src/runtime/panic.go:890 +0x263
github.com/VictoriaMetrics/metrics.writeRuntimeMetric({0xbb22c0, 0x84c0985d0},
{0xa4260e?, 0x1?}, 0x18?)
       
/wrkdirs/usr/ports/net-mgmt/vmutils/work/VictoriaMetrics-1.93.9/vendor/github.com/VictoriaMetrics/metrics/go_metrics.go:97
+0x1d7
github.com/VictoriaMetrics/metrics.writeRuntimeMetrics({0xbb22c0, 0x84c0985d0})
       
/wrkdirs/usr/ports/net-mgmt/vmutils/work/VictoriaMetrics-1.93.9/vendor/github.com/VictoriaMetrics/metrics/go_metrics.go:90
+0x139
github.com/VictoriaMetrics/metrics.writeGoMetrics({0xbb22c0, 0x84c0985d0})
       
/wrkdirs/usr/ports/net-mgmt/vmutils/work/VictoriaMetrics-1.93.9/vendor/github.com/VictoriaMetrics/metrics/go_metrics.go:26
+0x46
github.com/VictoriaMetrics/metrics.WriteProcessMetrics({0xbb22c0, 0x84c0985d0})
       
/wrkdirs/usr/ports/net-mgmt/vmutils/work/VictoriaMetrics-1.93.9/vendor/github.com/VictoriaMetrics/metrics/metrics.go:213
+0x25
github.com/VictoriaMetrics/metrics.WritePrometheus({0xbb22c0, 0x84c0985d0},
0x1)
       
/wrkdirs/usr/ports/net-mgmt/vmutils/work/VictoriaMetrics-1.93.9/vendor/github.com/VictoriaMetrics/metrics/metrics.go:88
+0x299
github.com/VictoriaMetrics/VictoriaMetrics/lib/appmetrics.writePrometheusMetrics({0xbb22c0,
0x84c0985d0})
       
/wrkdirs/usr/ports/net-mgmt/vmutils/work/VictoriaMetrics-1.93.9/lib/appmetrics/appmetrics.go:46
+0x45
github.com/VictoriaMetrics/VictoriaMetrics/lib/appmetrics.WritePrometheusMetrics({0x3efbfa7df1f8,
0x84c0240a0})
       
/wrkdirs/usr/ports/net-mgmt/vmutils/work/VictoriaMetrics-1.93.9/lib/appmetrics/appmetrics.go:29
+0xba
github.com/VictoriaMetrics/VictoriaMetrics/lib/httpserver.handlerWrapper(0x84c3ba760,
{0xbb65b0?, 0x84c0240a0}, 0x84c41e000, 0xb21688)
       
/wrkdirs/usr/ports/net-mgmt/vmutils/work/VictoriaMetrics-1.93.9/lib/httpserver/httpserver.go:306
+0xa67
github.com/VictoriaMetrics/VictoriaMetrics/lib/httpserver.gzipHandler.func1({0xbb65b0?,
0x84c0240a0?}, 0x84c444000?)
       
/wrkdirs/usr/ports/net-mgmt/vmutils/work/VictoriaMetrics-1.93.9/lib/httpserver/httpserver.go:196
+0x37
net/http.HandlerFunc.ServeHTTP(0xee6c00?, {0xbb65b0?, 0x84c0240a0?}, 0x4?)
        /usr/local/go120/src/net/http/server.go:2122 +0x2f
github.com/klauspost/compress/gzhttp.NewWrapper.func1.1({0xbb64c0,
0x84c444000}, 0x9be080?)
       
/wrkdirs/usr/ports/net-mgmt/vmutils/work/VictoriaMetrics-1.93.9/vendor/github.com/klauspost/compress/gzhttp/compress.go:495
+0x35a
net/http.HandlerFunc.ServeHTTP(0x0?, {0xbb64c0?, 0x84c444000?}, 0x46b26e?)
        /usr/local/go120/src/net/http/server.go:2122 +0x2f
net/http.serverHandler.ServeHTTP({0x84c52d020?}, {0xbb64c0, 0x84c444000},
0x84c41e000)
        /usr/local/go120/src/net/http/server.go:2936 +0x316
net/http.(*conn).serve(0x84c0002d0, {0xbb6928, 0x84c52cf90})
        /usr/local/go120/src/net/http/server.go:1995 +0x612
created by net/http.(*Server).Serve
        /usr/local/go120/src/net/http/server.go:3089 +0x5ed


Referenced Bugs:

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=275828
[Bug 275828] net-mgmt/victoria-metrics: Update to 1.93.10, switch to GO_MODULE
and add a cluster version
-- 
You are receiving this mail because:
You are the assignee for the bug.