Filebeat "fatal error: concurrent map iteration and map write"


(shoffmeister) #1

Hi,

on startup of the filebeat 6.4.0 docker image I get "fatal error: concurrent map iteration and map write"

I am aware of the thread Filebeat Autodiscover gives fatal error: concurrent map iteration and map write which was concluded with "6.4.0 fixes that". It doesn't for me.

Complete details:

docker image ls --digests

docker.elastic.co/beats/filebeat 6.4.0 sha256:739453f83c8c707c589d4e28c7a749581ea9d0511fd1ba2e3c97ae015800e103

Stack trace (trimmed because of post size limit):

2018-10-02T16:21:33.139Z INFO instance/beat.go:273 Setup Beat: filebeat; Version: 6.4.0
2018-10-02T16:21:33.139Z INFO pipeline/module.go:98 Beat name: a4af3701a762
2018-10-02T16:21:33.140Z INFO [monitoring] log/log.go:114 Starting metrics logging every 30s
2018-10-02T16:21:33.140Z INFO instance/beat.go:367 filebeat start running.
2018-10-02T16:21:33.140Z INFO registrar/registrar.go:134 Loading registrar data from /usr/share/filebeat/data/registry
2018-10-02T16:21:33.141Z INFO registrar/registrar.go:141 States Loaded from registrar: 3
2018-10-02T16:21:33.141Z WARN beater/filebeat.go:371 Filebeat is unable to load the Ingest Node pipelines for the configured modules because the Elasticsearch output is not configured/enabled. If you have already loaded the Ingest Node pipelines or are using Logstash pipelines, you can ignore this warning.
2018-10-02T16:21:33.141Z INFO crawler/crawler.go:72 Loading Inputs: 1
2018-10-02T16:21:33.141Z WARN [cfgwarn] docker/input.go:46 EXPERIMENTAL: Docker input is enabled.
2018-10-02T16:21:33.147Z INFO log/input.go:138 Configured paths: [/var/lib/docker/containers//.log]
2018-10-02T16:21:33.147Z INFO input/input.go:114 Starting input of type: docker; ID: 11885013443042902335
2018-10-02T16:21:33.147Z INFO crawler/crawler.go:106 Loading and starting Inputs completed. Enabled inputs: 1
2018-10-02T16:21:33.148Z INFO log/harvester.go:251 Harvester started for file: /var/lib/docker/containers/04b2003030503d2becbc602e0c38029efaba0109336f80aa1600551dd91b4a9a/04b2003030503d2becbc602e0c38029efaba0109336f80aa1600551dd91b4a9a-json.log
2018-10-02T16:21:33.150Z INFO log/harvester.go:251 Harvester started for file: /var/lib/docker/containers/a4af3701a762fcdb71305ed58ed73e621899a097b257ee4110397de3b4f71b65/a4af3701a762fcdb71305ed58ed73e621899a097b257ee4110397de3b4f71b65-json.log
2018-10-02T16:21:33.151Z INFO log/harvester.go:251 Harvester started for file: /var/lib/docker/containers/cb065c747068aeeacc16ab2919e3670cba9dd6e011b9ff3c613b2817ffa320aa/cb065c747068aeeacc16ab2919e3670cba9dd6e011b9ff3c613b2817ffa320aa-json.log
fatal error: concurrent map iteration and map write

goroutine 11 [running]:
runtime.throw(0x15dce10, 0x26)
/usr/local/go/src/runtime/panic.go:616 +0x81 fp=0xc421f1d5e8 sp=0xc421f1d5c8 pc=0x9b11b1
runtime.mapiternext(0xc421f1d6d8)
/usr/local/go/src/runtime/hashmap.go:747 +0x55c fp=0xc421f1d678 sp=0xc421f1d5e8 pc=0x98f17c
runtime.mapiterinit(0x1442a20, 0xc420289e90, 0xc421f1d6d8)
/usr/local/go/src/runtime/hashmap.go:737 +0x1f1 fp=0xc421f1d6a0 sp=0xc421f1d678 pc=0x98eb31
github.com/elastic/beats/vendor/github.com/elastic/go-structform/gotype.foldMapInterface(0xc4202c0330, 0x1442a20, 0xc420289e90, 0xc420289e90, 0x160db90)
/go/src/github.com/elastic/beats/vendor/github.com/elastic/go-structform/gotype/fold_map.go:34 +0xda fp=0xc421f1d748 sp=0xc421f1d6a0 pc=0xda0eaa
github.com/elastic/beats/vendor/github.com/elastic/go-structform/gotype.foldInterfaceValue(0xc4202c0330, 0x1541280, 0xc420289e90, 0x0, 0x0)
/go/src/github.com/elastic/beats/vendor/github.com/elastic/go-structform/gotype/fold.go:89 +0x15b fp=0xc421f1d7c0 sp=0xc421f1d748 pc=0xd9ef4b
github.com/elastic/beats/vendor/github.com/elastic/go-structform/gotype.foldMapInlineInterface(0xc4202c0330, 0x1541280, 0xc42140a530, 0x95, 0x1541280, 0xc42140a530)
/go/src/github.com/elastic/beats/vendor/github.com/elastic/go-structform/gotype/fold_map_inline.generated.go:44 +0x153 fp=0xc421f1d878 sp=0xc421f1d7c0 pc=0xda1a43
github.com/elastic/beats/vendor/github.com/elastic/go-structform/gotype.makeFieldInlineFold.func1(0xc4202c0330, 0x14d00e0, 0xc42140a4e0, 0x99, 0x0, 0x0)
/go/src/github.com/elastic/beats/vendor/github.com/elastic/go-structform/gotype/fold_reflect.go:292 +0x86 fp=0xc421f1d8c8 sp=0xc421f1d878 pc=0xdf5116
github.com/elastic/beats/vendor/github.com/elastic/go-structform/gotype.makeFieldsFold.func1(0xc4202c0330, 0x14d00e0, 0xc42140a4e0, 0x99, 0x0, 0x14d00e0)
/go/src/github.com/elastic/beats/vendor/github.com/elastic/go-structform/gotype/fold_reflect.go:177 +0x88 fp=0xc421f1d920 sp=0xc421f1d8c8 pc=0xdf4f38
github.com/elastic/beats/vendor/github.com/elastic/go-structform/gotype.makeStructFold.func1(0xc4202c0330, 0x14d00e0, 0xc42140a4e0, 0x99, 0x0, 0x0)
/go/src/github.com/elastic/beats/vendor/github.com/elastic/go-structform/gotype/fold_reflect.go:167 +0x95 fp=0xc421f1d968 sp=0xc421f1d920 pc=0xdf4e35
github.com/elastic/beats/vendor/github.com/elastic/go-structform/gotype.foldAnyReflect(0xc4202c0330, 0x14d00e0, 0xc42140a4e0, 0x99, 0x99, 0x1f5f500)
/go/src/github.com/elastic/beats/vendor/github.com/elastic/go-structform/gotype/fold_reflect.go:511 +0xb9 fp=0xc421f1d9a8 sp=0xc421f1d968 pc=0xda6b99
github.com/elastic/beats/vendor/github.com/elastic/go-structform/gotype.foldInterfaceValue(0xc4202c0330, 0x14d00e0, 0xc42140a4e0, 0xc42140a4e0, 0xc42140a4e0)
/go/src/github.com/elastic/beats/vendor/github.com/elastic/go-structform/gotype/fold.go:92 +0x1c9 fp=0xc421f1da20 sp=0xc421f1d9a8 pc=0xd9efb9
github.com/elastic/beats/vendor/github.com/elastic/go-structform/gotype.(*Iterator).Fold(0xc4202c0330, 0x14d00e0, 0xc42140a4e0, 0xc42140a4e0, 0x4)
/go/src/github.com/elastic/beats/vendor/github.com/elastic/go-structform/gotype/fold.go:69 +0x41 fp=0xc421f1da58 sp=0xc421f1da20 pc=0xd9edc1

...

filebeat.yml

filebeat:
inputs:
- type: "docker"
combine_partial: true
fields_under_root: true
containers:
ids:
- "*"
processors:
- add_docker_metadata: ~
- add_host_metadata: ~
- rename:
fields:
- from: "docker.container.name"
to: "fields.container_name"
- from: "docker.container.image"
to: "fields.container_image"
ignore_missing: false
fail_on_error: true

output:
logstash:
hosts: ["extra_hosts_graylog:5044"]

The re-mapping gets those fields into logstash / graylog.


(shoffmeister) #2

I just removed add_docker_metadata and add_host_metadata - at least the shipper comes up now.

Need to check whether my lovely docker.container.* are still present (which is what I care about at this time)


(Adrian Serrano) #3

Hi, can you try with 6.4.1?

The fix for this issue https://github.com/elastic/beats/issues/8040

appeared in 6.4.1.


(shoffmeister) #4

Will go for 6.4.2 - https://www.elastic.co/guide/en/beats/libbeat/6.4/release-notes-6.4.2.html

One additional learning is that this is due to add_host_metadata, which, I believe, I do not make use of anyway.


(system) #5

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