# Beats - fatal error: concurrent map iteration and map write

**URL:** <https://discuss.elastic.co/t/beats-fatal-error-concurrent-map-iteration-and-map-write/203489>\
**Category:** Beats\
**Created:** [October 14, 2019, 4:12pm UTC](https://discuss.elastic.co/t/beats-fatal-error-concurrent-map-iteration-and-map-write/203489 "2019-10-14T16:12:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vishnug](https://avatars.discourse-cdn.com/v4/letter/v/34f0e0/32.png) [@vishnug](https://discuss.elastic.co/u/vishnug)\
**Post date:** [October 14, 2019, 4:12pm UTC](https://discuss.elastic.co/t/beats-fatal-error-concurrent-map-iteration-and-map-write/203489/1 "2019-10-14T16:12:54Z")

</div>

Hi

I was following this [doc](https://www.elastic.co/guide/en/beats/devguide/6.8/index.html) to create a custom beat. I was able to build and run the beat.I encountered an error while running it

```
 fatal error: concurrent map iteration and map write

goroutine 1 [running]:
runtime.throw(0x17b90e3, 0x26)
    /usr/local/go/src/runtime/panic.go:774 +0x72 fp=0xc00023e6a8 sp=0xc00023e678 pc=0xac0b42
runtime.mapiternext(0xc0004213e0)
    /usr/local/go/src/runtime/map.go:858 +0x579 fp=0xc00023e730 sp=0xc00023e6a8 pc=0xaa0f19
reflect.mapiternext(0xc0004213e0)
    /usr/local/go/src/runtime/map.go:1347 +0x2b fp=0xc00023e748 sp=0xc00023e730 pc=0xaa1f2b
reflect.Value.MapKeys(0x1712220, 0xc0008b4e70, 0x15, 0x0, 0xa9f96b, 0xc00023e8a8)
    /usr/local/go/src/reflect/value.go:1214 +0x10a fp=0xc00023e7d8 sp=0xc00023e748 pc=0xb5a23a
encoding/json.mapEncoder.encode(0xc000436d50, 0xc0001af180, 0x1712220, 0xc0008b4e70, 0x15, 0x1710100)
    /usr/local/go/src/encoding/json/encode.go:690 +0xff fp=0xc00023e920 sp=0xc00023e7d8 pc=0xb9f0af
encoding/json.mapEncoder.encode-fm(0xc0001af180, 0x1712220, 0xc0008b4e70, 0x15, 0x100)
    /usr/local/go/src/encoding/json/encode.go:682 +0x64 fp=0xc00023e960 sp=0xc00023e920 pc=0xbaad44
encoding/json.(*encodeState).reflectValue(0xc0001af180, 0x1712220, 0xc0008b4e70, 0x15, 0x100)
    /usr/local/go/src/encoding/json/encode.go:337 +0x82 fp=0xc00023e998 sp=0xc00023e960 pc=0xb9c5a2
encoding/json.(*encodeState).marshal(0xc0001af180, 0x1712220, 0xc0008b4e70, 0x1000000000100, 0x0, 0x0)
    /usr/local/go/src/encoding/json/encode.go:309 +0x10b fp=0xc00023ea18 sp=0xc00023e998 pc=0xb9c04b

```

Thanks in advance

---

<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:** [November 11, 2019, 6:12pm UTC](https://discuss.elastic.co/t/beats-fatal-error-concurrent-map-iteration-and-map-write/203489/2 "2019-11-11T18:12:58Z")

</div>

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