Metricbeat: fatal error: concurrent map read and map write


(Jun Zhang) #1

metricbeat: 6.4.3
OS: CentOS 7.5
Docker: 18.06-1

metricbeat logs:

2018-11-13T12:22:10.262+0800 ERROR kubernetes/watcher.go:254 kubernetes: Watching API error EOF
2018-11-13T12:22:10.262+0800 INFO kubernetes/watcher.go:238 kubernetes: Watching API for resource events
fatal error: concurrent map read and map write

goroutine 328 [running]:
runtime.throw(0x27b8023, 0x21)
/usr/local/go/src/runtime/panic.go:616 +0x81 fp=0xc420463878 sp=0xc420463858 pc=0x117be91
runtime.mapaccess1_faststr(0x23fef60, 0xc4205f72c0, 0xc431736640, 0x36, 0xc4204639e0)
/usr/local/go/src/runtime/hashmap_fast.go:181 +0x421 fp=0xc4204638e8 sp=0xc420463878 pc=0x115bad1
github.com/elastic/beats/metricbeat/module/kubernetes/util.(*enricher).Enrich(0xc42096f7c0, 0xc422cff500, 0x123, 0x123)
/go/src/github.com/elastic/beats/metricbeat/module/kubernetes/util/kubernetes.go:298 +0xcb fp=0xc420463a78 sp=0xc4204638e8 pc=0x1cc1ccb
github.com/elastic/beats/metricbeat/module/kubernetes/state_container.(*MetricSet).Fetch(0xc4206cdd10, 0xc42da22000, 0xc42da22000, 0xc42da22000, 0xc420463d40, 0xc42200f140)
/go/src/github.com/elastic/beats/metricbeat/module/kubernetes/state_container/state_container.go:120 +0xe5 fp=0xc420463b18 sp=0xc420463a78 pc=0x1ccd3d5
github.com/elastic/beats/metricbeat/mb/module.(*metricSetWrapper).multiEventFetch(0xc420896f20, 0x7fb69f1f9508, 0xc4206cdd10, 0x29319e0, 0xc4202ba030)
/go/src/github.com/elastic/beats/metricbeat/mb/module/wrapper.go:252 +0x52 fp=0xc420463b88 sp=0xc420463b18 pc=0x1aa1ad2
github.com/elastic/beats/metricbeat/mb/module.(*metricSetWrapper).fetch(0xc420896f20, 0x29319e0, 0xc4202ba030)
/go/src/github.com/elastic/beats/metricbeat/mb/module/wrapper.go:232 +0x12f fp=0xc420463c28 sp=0xc420463b88 pc=0x1aa176f
github.com/elastic/beats/metricbeat/mb/module.(*metricSetWrapper).startPeriodicFetching(0xc420896f20, 0x29319e0, 0xc4202ba030)
/go/src/github.com/elastic/beats/metricbeat/mb/module/wrapper.go:219 +0x121 fp=0xc420463d88 sp=0xc420463c28 pc=0x1aa1511
github.com/elastic/beats/metricbeat/mb/module.(*metricSetWrapper).run(0xc420896f20, 0xc42093c240, 0xc420600b40)
/go/src/github.com/elastic/beats/metricbeat/mb/module/wrapper.go:196 +0x5ca fp=0xc420463f58 sp=0xc420463d88 pc=0x1aa0ffa
github.com/elastic/beats/metricbeat/mb/module.(*Wrapper).Start.func1(0xc420892a90, 0xc42093c240, 0xc420600b40, 0xc420896f20)
/go/src/github.com/elastic/beats/metricbeat/mb/module/wrapper.go:137 +0x249 fp=0xc420463fc0 sp=0xc420463f58 pc=0x1aa3c49
runtime.goexit()
/usr/local/go/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc420463fc8 sp=0xc420463fc0 pc=0x11ac031
created by github.com/elastic/beats/metricbeat/mb/module.(*Wrapper).Start
/go/src/github.com/elastic/beats/metricbeat/mb/module/wrapper.go:125 +0x145

goroutine 1 [semacquire, 1019 minutes]:
sync.runtime_Semacquire(0xc4201c423c)
/usr/local/go/src/runtime/sema.go:56 +0x39
sync.(*WaitGroup).Wait(0xc4201c4230)
/usr/local/go/src/sync/waitgroup.go:129 +0x72
github.com/elastic/beats/metricbeat/beater.(*Metricbeat).Run(0xc4202a2690, 0xc4204be400, 0xc420449a60, 0x1)
/go/src/github.com/elastic/beats/metricbeat/beater/metricbeat.go:233 +0x26c
github.com/elastic/beats/libbeat/cmd/instance.(*Beat).launch(0xc4204be400, 0x277c5ed, 0xa, 0x277c5ed, 0xa, 0x0, 0x0, 0x0, 0x0, 0xc4201d80f0, ...)
/go/src/github.com/elastic/beats/libbeat/cmd/instance/beat.go:389 +0x49c
github.com/elastic/beats/libbeat/cmd/instance.Run.func1(0x277c5ed, 0xa, 0x277c5ed, 0xa, 0x0, 0x0, 0x277c5ed, 0xa, 0x277c5ed, 0xa, ...)
/go/src/github.com/elastic/beats/libbeat/cmd/instance/beat.go:194 +0x611
github.com/elastic/beats/libbeat/cmd/instance.Run(0x277c5ed, 0xa, 0x277c5ed, 0xa, 0x0, 0x0, 0x0, 0x0, 0xc4201d80f0, 0x0, ...)
/go/src/github.com/elastic/beats/libbeat/cmd/instance/beat.go:195 +0xbe
github.com/elastic/beats/libbeat/cmd.genRunCmd.func1(0xc42035b680, 0xc420281800, 0x0, 0x3)
/go/src/github.com/elastic/beats/libbeat/cmd/run.go:37 +0x4f
github.com/elastic/beats/vendor/github.com/spf13/cobra.(*Command).execute(0xc42035b680, 0xc42011a050, 0x3, 0x3, 0xc42035b680, 0xc42011a050)
/go/src/github.com/elastic/beats/vendor/github.com/spf13/cobra/command.go:704 +0x2c6
github.com/elastic/beats/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xc42035b680, 0x0, 0x277c5ed, 0xc4202e1440)
/go/src/github.com/elastic/beats/vendor/github.com/spf13/cobra/command.go:785 +0x2e4
github.com/elastic/beats/vendor/github.com/spf13/cobra.(*Command).Execute(0xc42035b680, 0xc42050bf78, 0xc4200fc058)
/go/src/github.com/elastic/beats/vendor/github.com/spf13/cobra/command.go:738 +0x2b
main.main()
/go/src/github.com/elastic/beats/metricbeat/main.go:34 +0x2f


(Jaime Soriano) #2

Hi @Jun_Zhang,

Thanks for reporting this, it looks bad. It seems to happen on a reconnection to the Kubernetes API. Could you please fill a bug report?


(Jun Zhang) #3

Done.


(system) #4

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.