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

**URL:** <https://discuss.elastic.co/t/filebeat-fatal-error-concurrent-map-iteration-and-map-write/150736>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [October 2, 2018, 4:34pm UTC](https://discuss.elastic.co/t/filebeat-fatal-error-concurrent-map-iteration-and-map-write/150736 "2018-10-02T16:34:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![shoffmeister](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shoffmeister/32/36086_2.png) [@shoffmeister](https://discuss.elastic.co/u/shoffmeister)\
**Post date:** [October 2, 2018, 4:34pm UTC](https://discuss.elastic.co/t/filebeat-fatal-error-concurrent-map-iteration-and-map-write/150736/1 "2018-10-02T16:34:40Z")

</div>

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](https://discuss.elastic.co/t/filebeat-autodiscover-gives-fatal-error-concurrent-map-iteration-and-map-write/145296/9) 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](http://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](http://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](http://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](http://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](http://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](http://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](http://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](http://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](http://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](http://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.

---

<div class="post-metadata">

**Author:** ![shoffmeister](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shoffmeister/32/36086_2.png) [@shoffmeister](https://discuss.elastic.co/u/shoffmeister)\
**Post date:** [October 2, 2018, 4:44pm UTC](https://discuss.elastic.co/t/filebeat-fatal-error-concurrent-map-iteration-and-map-write/150736/2 "2018-10-02T16:44:37Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![adrisr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/adrisr/32/25423_2.png) [@adrisr](https://discuss.elastic.co/u/adrisr)\
**Post date:** [October 2, 2018, 5:24pm UTC](https://discuss.elastic.co/t/filebeat-fatal-error-concurrent-map-iteration-and-map-write/150736/3 "2018-10-02T17:24:56Z")

</div>

Hi, can you try with 6.4.1?

The fix for this issue [https://github.com/elastic/beats/issues/8040](https://github.com/elastic/beats/issues/8040)

appeared in 6.4.1.

---

<div class="post-metadata">

**Author:** ![shoffmeister](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shoffmeister/32/36086_2.png) [@shoffmeister](https://discuss.elastic.co/u/shoffmeister)\
**Post date:** [October 2, 2018, 6:03pm UTC](https://discuss.elastic.co/t/filebeat-fatal-error-concurrent-map-iteration-and-map-write/150736/4 "2018-10-02T18:03:03Z")

</div>

Will go for 6.4.2 - [https://www.elastic.co/guide/en/beats/libbeat/6.4/release-notes-6.4.2.html](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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 30, 2018, 6:03pm UTC](https://discuss.elastic.co/t/filebeat-fatal-error-concurrent-map-iteration-and-map-write/150736/5 "2018-10-30T18:03:29Z")

</div>

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