"cscli metrics" crashes

Bug #2067506 reported by Marco Gasparini
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
crowdsec (Ubuntu)
New
Undecided
Unassigned

Bug Description

Installed crowdsec on a fresh ubuntu server 24.04.
The issue has been also reported on crowdsec GitHub: https://github.com/crowdsecurity/crowdsec/issues/2866

# cscli metrics
ERRO[29-05-2024 19:35:07] crowdsec - goroutine crowdsec/ShowPrometheus crashed : protobuf tag not enough fields in MetricFamily.state:
ERRO[29-05-2024 19:35:07] please report this error to https://github.com/crowdsecurity/crowdsec/
ERRO[29-05-2024 19:35:07] stacktrace/report is written to /tmp/crowdsec-crash.3340374478.txt : please join it to your issue

# cat /tmp/crowdsec-crash.3340374478.txt
error : protobuf tag not enough fields in MetricFamily.state:
version: v1.4.6-6build1-debian
Codename: alphaga
BuildDate: 2023-08-24_05:13:32
GoVersion: 1.21.0
Platform: linux
goroutine 8 [running]:
runtime/debug.Stack()
        runtime/debug/stack.go:24 +0x5e
github.com/crowdsecurity/crowdsec/pkg/types.WriteStackTrace({0x1233900, 0xc000527b80})
        github.com/crowdsecurity/crowdsec/pkg/types/utils.go:116 +0x245
github.com/crowdsecurity/crowdsec/pkg/types.CatchPanic({0x1434d42, 0x17})
        github.com/crowdsecurity/crowdsec/pkg/types/utils.go:131 +0xeb
panic({0x1233900?, 0xc000527b80?})
        runtime/panic.go:914 +0x21f
github.com/golang/protobuf/proto.(*unmarshalInfo).computeUnmarshalInfo(0xc0004345a0)
        github.com/golang/protobuf/proto/table_unmarshal.go:332 +0x121f
github.com/golang/protobuf/proto.(*unmarshalInfo).unmarshal(0xc0004345a0, {0x13a6400?}, {0xc0000e4900, 0x879, 0x879})
        github.com/golang/protobuf/proto/table_unmarshal.go:136 +0x5b
github.com/golang/protobuf/proto.(*InternalMessageInfo).Unmarshal(0xc0003b9d10?, {0x1653dc8, 0xc0004b5ce0}, {0xc0000e4900?, 0x879?, 0x879?})
        github.com/golang/protobuf/proto/table_unmarshal.go:63 +0xcb
github.com/golang/protobuf/proto.(*Buffer).Unmarshal(0xc0003cfd48, {0x1653dc8, 0xc0004b5ce0})
        github.com/golang/protobuf/proto/decode.go:424 +0x145
github.com/golang/protobuf/proto.Unmarshal({0xc0000e4900, 0x879, 0x879}, {0x1653dc8, 0xc0004b5ce0})
        github.com/golang/protobuf/proto/decode.go:342 +0xdc
github.com/matttproud/golang_protobuf_extensions/pbutil.ReadDelimited({0x747f11584060, 0xc000124100}, {0x1653dc8, 0xc0004b5ce0})
        github.com/matttproud/golang_protobuf_extensions/pbutil/decode.go:74 +0x1a5
github.com/prometheus/prom2json.ParseResponse(0xc0001901b0, 0xc000414ae0)
        github.com/prometheus/prom2json/prom2json.go:181 +0x4c5
github.com/prometheus/prom2json.FetchMetricFamilies({0xc0003a4b00, 0x1d}, 0xc000285110?, {0x164b240, 0xc00053e000})
        github.com/prometheus/prom2json/prom2json.go:167 +0x3d9
main.FormatPrometheusMetrics.func1()
        github.com/crowdsecurity/crowdsec/cmd/crowdsec-cli/metrics.go:36 +0x4b
created by main.FormatPrometheusMetrics in goroutine 1
        github.com/crowdsecurity/crowdsec/cmd/crowdsec-cli/metrics.go:34 +0x127

# lsb_release -rd
No LSB modules are available.
Description: Ubuntu 24.04 LTS
Release: 24.04

# apt-cache policy crowdsec
crowdsec:
  Installed: 1.4.6-6build1
  Candidate: 1.4.6-6build1
  Version table:
 *** 1.4.6-6build1 500
        500 http://it.archive.ubuntu.com/ubuntu noble/universe amd64 Packages
        100 /var/lib/dpkg/status

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.