Closed priyankub closed 4 weeks ago
@priyankub: Thanks for opening an issue, it is currently awaiting triage.
In the meantime, you can:
cat crowdsec-crash.1254139945.txt error: runtime error: invalid memory address or nil pointer dereference version: v1.6.3-4851945a BuildDate: 2024-09-12_09:37:12 GoVersion: 1.22.6 Platform: docker goroutine 189 [running]: runtime/debug.Stack() runtime/debug/stack.go:24 +0x5e github.com/crowdsecurity/go-cs-lib/trace.(*traceKeeper).writeStackTrace(0x382a180, {0x1e6c060, 0x3808360}) github.com/crowdsecurity/go-cs-lib@v0.0.15/trace/trace.go:152 +0x173 github.com/crowdsecurity/go-cs-lib/trace.(*traceKeeper).catchPanic(0x382a180, {0x21676aa, 0x17}) github.com/crowdsecurity/go-cs-lib@v0.0.15/trace/trace.go:168 +0x13d github.com/crowdsecurity/go-cs-lib/trace.CatchPanic(...) github.com/crowdsecurity/go-cs-lib@v0.0.15/trace/trace.go:37 panic({0x1e6c060?, 0x3808360?}) runtime/panic.go:770 +0x132 github.com/crowdsecurity/crowdsec/pkg/apiserver.(*apic).SendUsageMetrics(0xc000aea000) github.com/crowdsecurity/crowdsec/pkg/apiserver/apic_metrics.go:371 +0x28e github.com/crowdsecurity/crowdsec/pkg/apiserver.(*APIServer).Run.func6() github.com/crowdsecurity/crowdsec/pkg/apiserver/apiserver.go:373 +0x1b gopkg.in/tomb%2ev2.(*Tomb).run(0xc000aea0f0, 0x0?) gopkg.in/tomb.v2@v2.0.0-20161208151619-d5d1b5820637/tomb.go:163 +0x2b created by gopkg.in/tomb%2ev2.(*Tomb).Go in goroutine 155 gopkg.in/tomb.v2@v2.0.0-20161208151619-d5d1b5820637/tomb.go:159 +0xe5
cat crowdsec-crash.3536834419.txt error: runtime error: invalid memory address or nil pointer dereference version: v1.6.3-4851945a BuildDate: 2024-09-12_09:37:12 GoVersion: 1.22.6 Platform: docker goroutine 203 [running]: runtime/debug.Stack() runtime/debug/stack.go:24 +0x5e github.com/crowdsecurity/go-cs-lib/trace.(*traceKeeper).writeStackTrace(0x382a180, {0x1e6c060, 0x3808360}) github.com/crowdsecurity/go-cs-lib@v0.0.15/trace/trace.go:152 +0x173 github.com/crowdsecurity/go-cs-lib/trace.(*traceKeeper).catchPanic(0x382a180, {0x21676aa, 0x17}) github.com/crowdsecurity/go-cs-lib@v0.0.15/trace/trace.go:168 +0x13d github.com/crowdsecurity/go-cs-lib/trace.CatchPanic(...) github.com/crowdsecurity/go-cs-lib@v0.0.15/trace/trace.go:37 panic({0x1e6c060?, 0x3808360?}) runtime/panic.go:770 +0x132 github.com/crowdsecurity/crowdsec/pkg/apiserver.(*apic).SendUsageMetrics(0xc000b8e000) github.com/crowdsecurity/crowdsec/pkg/apiserver/apic_metrics.go:371 +0x28e github.com/crowdsecurity/crowdsec/pkg/apiserver.(*APIServer).Run.func6() github.com/crowdsecurity/crowdsec/pkg/apiserver/apiserver.go:373 +0x1b gopkg.in/tomb%2ev2.(*Tomb).run(0xc000b8e0f0, 0x0?) gopkg.in/tomb.v2@v2.0.0-20161208151619-d5d1b5820637/tomb.go:163 +0x2b created by gopkg.in/tomb%2ev2.(*Tomb).Go in goroutine 128 gopkg.in/tomb.v2@v2.0.0-20161208151619-d5d1b5820637/tomb.go:159 +0xe5
error: runtime error: invalid memory address or nil pointer dereference version: v1.6.3-4851945a BuildDate: 2024-09-12_09:37:12 GoVersion: 1.22.6 Platform: docker goroutine 169 [running]: runtime/debug.Stack() runtime/debug/stack.go:24 +0x5e github.com/crowdsecurity/go-cs-lib/trace.(traceKeeper).writeStackTrace(0x382a180, {0x1e6c060, 0x3808360}) github.com/crowdsecurity/go-cs-lib@v0.0.15/trace/trace.go:152 +0x173 github.com/crowdsecurity/go-cs-lib/trace.(traceKeeper).catchPanic(0x382a180, {0x21676aa, 0x17}) github.com/crowdsecurity/go-cs-lib@v0.0.15/trace/trace.go:168 +0x13d github.com/crowdsecurity/go-cs-lib/trace.CatchPanic(...) github.com/crowdsecurity/go-cs-lib@v0.0.15/trace/trace.go:37 panic({0x1e6c060?, 0x3808360?}) runtime/panic.go:770 +0x132 github.com/crowdsecurity/crowdsec/pkg/apiserver.(apic).SendUsageMetrics(0xc0009faa80) github.com/crowdsecurity/crowdsec/pkg/apiserver/apic_metrics.go:371 +0x28e github.com/crowdsecurity/crowdsec/pkg/apiserver.(APIServer).Run.func6() github.com/crowdsecurity/crowdsec/pkg/apiserver/apiserver.go:373 +0x1b gopkg.in/tomb%2ev2.(Tomb).run(0xc0009fab70, 0xc000810000?) gopkg.in/tomb.v2@v2.0.0-20161208151619-d5d1b5820637/tomb.go:163 +0x2b created by gopkg.in/tomb%2ev2.(Tomb).Go in goroutine 179 gopkg.in/tomb.v2@v2.0.0-20161208151619-d5d1b5820637/tomb.go:159 +0xe5
Command from inside the container to test reachability to api.crowdsec.net
ad90c0accb7c:/# cscli version
version: v1.6.3-4851945a
Codename: alphaga
BuildDate: 2024-09-12_09:39:08
GoVersion: 1.22.6
Platform: docker
libre2: C++
User-Agent: crowdsec/v1.6.3-4851945a-docker
Constraint_parser: >= 1.0, <= 3.0
Constraint_scenario: >= 1.0, <= 3.0
Constraint_api: v1
Constraint_acquis: >= 1.0, < 2.0
ad90c0accb7c:/# ping api.crowdsec.net
PING api.crowdsec.net (18.245.96.48): 56 data bytes
64 bytes from 18.245.96.48: seq=0 ttl=247 time=19.355 ms
64 bytes from 18.245.96.48: seq=1 ttl=247 time=22.070 ms
64 bytes from 18.245.96.48: seq=2 ttl=247 time=15.487 ms
^C
--- api.crowdsec.net ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 15.487/18.970/22.070 ms
Hey 👋🏻
Thank you for the report and I can see the nil ref straight away.
@blotus @mmetc
The error returns but the resp is nil, on the upper scope we check the resp status but its a nil object.
Fix has been merged, however, wont be released to GA until 1.6.4
if you wish to use the fix for now you can point the docker tag to :dev
for now.
Hey, it crashed again recently. Here's the trace
error: runtime error: invalid memory address or nil pointer dereference version: v1.6.3-rc4-83-g5d414f58 BuildDate: 2024-11-08_14:13:15 GoVersion: 1.23.3 Platform: docker goroutine 254 [running]: runtime/debug.Stack() runtime/debug/stack.go:26 +0x5e github.com/crowdsecurity/go-cs-lib/trace.(*traceKeeper).writeStackTrace(0x35fa580, {0x1eb7bc0, 0x35d8400}) github.com/crowdsecurity/go-cs-lib@v0.0.15/trace/trace.go:152 +0x16e github.com/crowdsecurity/go-cs-lib/trace.(*traceKeeper).catchPanic(0x35fa580, {0x21bdfe0, 0x17}) github.com/crowdsecurity/go-cs-lib@v0.0.15/trace/trace.go:168 +0x134 github.com/crowdsecurity/go-cs-lib/trace.CatchPanic(...) github.com/crowdsecurity/go-cs-lib@v0.0.15/trace/trace.go:37 panic({0x1eb7bc0?, 0x35d8400?}) runtime/panic.go:785 +0x132 github.com/crowdsecurity/crowdsec/pkg/apiserver.(*apic).SendUsageMetrics(0xc000d66000, {0x25ebeb8, 0x36d95e0}) github.com/crowdsecurity/crowdsec/pkg/apiserver/apic_metrics.go:371 +0x2be github.com/crowdsecurity/crowdsec/pkg/apiserver.(*APIServer).initAPIC.func5() github.com/crowdsecurity/crowdsec/pkg/apiserver/apiserver.go:364 +0x25 gopkg.in/tomb%2ev2.(*Tomb).run(0xc000d660f0, 0x544547223a226575?) gopkg.in/tomb.v2@v2.0.0-20161208151619-d5d1b5820637/tomb.go:163 +0x2b created by gopkg.in/tomb%2ev2.(*Tomb).Go in goroutine 243 gopkg.in/tomb.v2@v2.0.0-20161208151619-d5d1b5820637/tomb.go:159 +0xdb
Hey, it crashed again recently. Here's the trace
error: runtime error: invalid memory address or nil pointer dereference version: v1.6.3-rc4-83-g5d414f58 BuildDate: 2024-11-08_14:13:15 GoVersion: 1.23.3 Platform: docker goroutine 254 [running]: runtime/debug.Stack() runtime/debug/stack.go:26 +0x5e github.com/crowdsecurity/go-cs-lib/trace.(*traceKeeper).writeStackTrace(0x35fa580, {0x1eb7bc0, 0x35d8400}) github.com/crowdsecurity/go-cs-lib@v0.0.15/trace/trace.go:152 +0x16e github.com/crowdsecurity/go-cs-lib/trace.(*traceKeeper).catchPanic(0x35fa580, {0x21bdfe0, 0x17}) github.com/crowdsecurity/go-cs-lib@v0.0.15/trace/trace.go:168 +0x134 github.com/crowdsecurity/go-cs-lib/trace.CatchPanic(...) github.com/crowdsecurity/go-cs-lib@v0.0.15/trace/trace.go:37 panic({0x1eb7bc0?, 0x35d8400?}) runtime/panic.go:785 +0x132 github.com/crowdsecurity/crowdsec/pkg/apiserver.(*apic).SendUsageMetrics(0xc000d66000, {0x25ebeb8, 0x36d95e0}) github.com/crowdsecurity/crowdsec/pkg/apiserver/apic_metrics.go:371 +0x2be github.com/crowdsecurity/crowdsec/pkg/apiserver.(*APIServer).initAPIC.func5() github.com/crowdsecurity/crowdsec/pkg/apiserver/apiserver.go:364 +0x25 gopkg.in/tomb%2ev2.(*Tomb).run(0xc000d660f0, 0x544547223a226575?) gopkg.in/tomb.v2@v2.0.0-20161208151619-d5d1b5820637/tomb.go:163 +0x2b created by gopkg.in/tomb%2ev2.(*Tomb).Go in goroutine 243 gopkg.in/tomb.v2@v2.0.0-20161208151619-d5d1b5820637/tomb.go:159 +0xdb
From the panic output you are still using an older version. If you are running on docker can you pull the latest :dev
image and redeploy.
That's what it's pulling in :dev With:latest, it runs on 1.6.3 built in September, not the November build in my trace log
This is running latest :
cscli version version: v1.6.3-4851945a Codename: alphaga BuildDate: 2024-09-12_09:39:08 GoVersion: 1.22.6 Platform: docker libre2: C++ User-Agent: crowdsec/v1.6.3-4851945a-docker Constraint_parser: >= 1.0, <= 3.0 Constraint_scenario: >= 1.0, <= 3.0 Constraint_api: v1 Constraint_acquis: >= 1.0, < 2.0
This is running:dev
cscli version version: v1.6.3-rc4-83-g5d414f58 Codename: alphaga BuildDate: 2024-11-08_14:14:15 GoVersion: 1.23.3 Platform: docker libre2: C++ User-Agent: crowdsec/v1.6.3-rc4-83-g5d414f58-docker Constraint_parser: >= 1.0, <= 3.0 Constraint_scenario: >= 1.0, <= 3.0 Constraint_api: v1 Constraint_acquis: >= 1.0, < 2.0 Built-in optional components: cscli_setup, datasource_appsec, datasource_cloudwatch, datasource_docker, datasource_file, datasource_http, datasource_journalctl, datasource_k8s-audit, datasource_kafka, datasource_kinesis, datasource_loki, datasource_s3, datasource_syslog, datasource_wineventlog
What happened?
Crowdsec crashed.
What did you expect to happen?
It to not crash. Its been running stable for more than a year now
How can we reproduce it (as minimally and precisely as possible)?
Not sure
Anything else we need to know?
time="2024-10-23T17:51:51-04:00" level=error msg="capi metrics: failed: Post \"https://api.crowdsec.net/v3/metrics/\": performing jwt auth: dial tcp: lookup api.crowdsec.net on 127.0.0.11:53: read udp 127.0.0.1:46180->127.0.0.11:53: i/o timeout" time="2024-10-23T18:34:39-04:00" level=error msg="capi pull top: get stream: Get \"https://api.crowdsec.net/v3/decisions/stream?\": performing jwt auth: dial tcp: lookup api.crowdsec.net on 127.0.0.11:53: read udp 127.0.0.1:43876->127.0.0.11:53: i/o timeout" time="2024-10-23T19:22:03-04:00" level=error msg="capi metrics: failed: Post \"https://api.crowdsec.net/v3/metrics/\": performing jwt auth: dial tcp: lookup api.crowdsec.net on 127.0.0.11:53: read udp 127.0.0.1:33450->127.0.0.11:53: i/o timeout" time="2024-10-23T19:59:51-04:00" level=error msg="unable to send usage metrics: Post \"https://api.crowdsec.net/v3/usage-metrics\": performing jwt auth: dial tcp: lookup api.crowdsec.net on 127.0.0.11:53: read udp 127.0.0.1:37044->127.0.0.11:53: i/o timeout" time="2024-10-23T19:59:51-04:00" level=error msg="crowdsec - goroutine lapi/usageMetricsToAPIC crashed: runtime error: invalid memory address or nil pointer dereference" time="2024-10-23T19:59:51-04:00" level=error msg="please report this error to https://github.com/crowdsecurity/crowdsec/issues" time="2024-10-23T19:59:51-04:00" level=error msg="stacktrace/report is written to /var/lib/crowdsec/data/trace/crowdsec-crash.3536834419.txt: please join it to your issue" time="2024-10-23T19:59:51-04:00" level=fatal msg="crowdsec stopped" time="2024-10-24T00:49:21-04:00" level=debug msg="starting plugin" args="[/usr/
Crowdsec version
OS version
Docker on Unraid
Enabled collections and parsers
Acquisition config
Config show
Prometheus metrics
Related custom configs versions (if applicable) : notification plugins, custom scenarios, parsers etc.