# Panic in Redis module

**URL:** <https://discuss.elastic.co/t/panic-in-redis-module/197253>\
**Category:** Beats\
**Created:** [August 29, 2019, 4:07am UTC](https://discuss.elastic.co/t/panic-in-redis-module/197253 "2019-08-29T04:07:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jwarren116](https://avatars.discourse-cdn.com/v4/letter/j/7bcc69/32.png) [@jwarren116](https://discuss.elastic.co/u/jwarren116)\
**Post date:** [August 29, 2019, 4:07am UTC](https://discuss.elastic.co/t/panic-in-redis-module/197253/1 "2019-08-29T04:07:39Z")

</div>

- Version: Metricbeat 6.8.2
- Operating System: Ubuntu 16.04

I'm regularly seeing this panic in the Redis module. Metricbeat seems to recover and continue running based on logs, but no further metrics are shipped to my output. The error log is:

```auto
ERROR runtime/hashmap_fast.go:696 recovered from panic while fetching 'redis/key' for host 'xxxxxxxxx:6379'. Recovering, but please report this. {"panic": "assignment to entry in nil map", "stack": "github.com/elastic/beats/libbeat/logp.Recover
  /go/src/github.com/elastic/beats/libbeat/logp/global.go:105
runtime.call32
  /usr/local/go/src/runtime/asm_amd64.s:573
runtime.gopanic
  /usr/local/go/src/runtime/panic.go:502
runtime.mapassign_faststr
  /usr/local/go/src/runtime/hashmap_fast.go:696
github.com/elastic/beats/metricbeat/module/redis/key.eventMapping
  /go/src/github.com/elastic/beats/metricbeat/module/redis/key/data.go:28
github.com/elastic/beats/metricbeat/module/redis/key.(*MetricSet).Fetch
  /go/src/github.com/elastic/beats/metricbeat/module/redis/key/key.go:98
github.com/elastic/beats/metricbeat/mb/module.(*metricSetWrapper).fetch
  /go/src/github.com/elastic/beats/metricbeat/mb/module/wrapper.go:238
github.com/elastic/beats/metricbeat/mb/module.(*metricSetWrapper).startPeriodicFetching
  /go/src/github.com/elastic/beats/metricbeat/mb/module/wrapper.go:219
github.com/elastic/beats/metricbeat/mb/module.(*metricSetWrapper).run
  /go/src/github.com/elastic/beats/metricbeat/mb/module/wrapper.go:196
github.com/elastic/beats/metricbeat/mb/module.(*Wrapper).Start.func1
  /go/src/github.com/elastic/beats/metricbeat/mb/module/wrapper.go:137"}

```

My config for the Redis module looks something like this:

```auto
- module: redis
  metricsets: ["key"]
  key.patterns:
    - pattern: '*'
  period: 5s

  processors:
    - drop_event:
        when:
          contains:
            redis.key.name: "_kombu"
    - drop_event:
        when:
          contains:
            redis.key.name: "unack"
    - drop_fields:
        fields: ["event"]
  hosts: ["{{ redis_host }}:6379"]

```

---

<div class="post-metadata">

**Author:** ![jsoriano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsoriano/32/27920_2.png) [@jsoriano](https://discuss.elastic.co/u/jsoriano)\
**Post date:** [August 29, 2019, 8:41pm UTC](https://discuss.elastic.co/t/panic-in-redis-module/197253/2 "2019-08-29T20:41:26Z")

</div>

Hi @jwarren116 and welcome 🙂

I have been taking a look to the code and I think that there is actually a bug , I have open a pull request to fix it: [https://github.com/elastic/beats/pull/13426](https://github.com/elastic/beats/pull/13426)

Thanks for reporting!

---

<div class="post-metadata">

**Author:** ![jwarren116](https://avatars.discourse-cdn.com/v4/letter/j/7bcc69/32.png) [@jwarren116](https://discuss.elastic.co/u/jwarren116)\
**Post date:** [August 29, 2019, 9:07pm UTC](https://discuss.elastic.co/t/panic-in-redis-module/197253/3 "2019-08-29T21:07:19Z")

</div>

Thanks for the speedy response and fix!

---

<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:** [September 26, 2019, 11:07pm UTC](https://discuss.elastic.co/t/panic-in-redis-module/197253/4 "2019-09-26T23:07:22Z")

</div>

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