Panic in Redis module

  • 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:

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:

- 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"]

Hi @jwarren116 and welcome :slight_smile:

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

Thanks for reporting!

Thanks for the speedy response and fix!

1 Like

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