SHOW TAG VALUES throws invalid memory address or nil pointer dereference

Hi,
I’m running grafana (v4.6.3) and influxdb (1.5.0) on two docker containers.
I’ve created a dashboard on Grafana with a template that queries Influx for tag values.
SHOW TAG VALUES WITH KEY=“action.primaryOssName” where “action.primaryVendor” =~ /^$vendor$/

Sometimes, I can’t quite point out when, the template will stop show options and return:
{"results":[{"statement_id":-1,"error":"SHOW TAG VALUES WITH KEY = \"action.primaryOssName\" WHERE \"action.primaryVendor\" =~ /^.*$/ [panic:runtime error: invalid memory address or nil pointer dereference]"}]}

I ran ‘docker logs’ on the influxdb container and found the following error logs:

ts=2018-03-18T05:41:51.130106Z lvl=info msg="Executing query" log_id=06uNqYgl000 service=query query="SHOW TAG VALUES ON cellwize WITH KEY = \"action.primaryOssName\" WHERE (\"action.primaryVendor\" =~ /^.*$/) AND (_tagKey = 'action.primaryOssName')"

ts=2018-03-18T05:41:51.130412Z lvl=error msg="SHOW TAG VALUES WITH KEY = \"action.primaryOssName\" WHERE \"action.primaryVendor\" =~ /^.*$/ [panic:runtime error: invalid memory address or nil pointer dereference] goroutine 3125843 [running]:
runtime/debug.Stack(0xc5d867d2a0, 0xc5b6d76960, 0x59)
/usr/local/go/src/runtime/debug/stack.go:24 +0xa7
github.com/influxdata/influxdb/query.(*QueryExecutor).recover(0xc42018d7a0, 0xc5d867d2a0, 0xc5b6f04ea0)
/go/src/github.com/influxdata/influxdb/query/query_executor.go:451 +0xaf
panic(0xce4120, 0x1302970)
/usr/local/go/src/runtime/panic.go:491 +0x283
github.com/influxdata/influxdb/tsdb.(*MeasurementFields).HasField(0x0, 0xc508eaef00, 0x14, 0x10)
/go/src/github.com/influxdata/influxdb/tsdb/shard.go:1408 +0x26
github.com/influxdata/influxdb/tsdb.IndexSet.seriesByBinaryExprIterator(0xc52455ad80, 0x1, 0x8, 0xc4201913b0, 0xc428833080, 0xc, 0x10, 0xc421a21a10, 0x0, 0x0, ...)
/go/src/github.com/influxdata/influxdb/tsdb/index.go:1833 +0xdd2
github.com/influxdata/influxdb/tsdb.IndexSet.seriesByExprIterator(0xc52455ad80, 0x1, 0x8, 0xc4201913b0, 0xc428833080, 0xc, 0x10, 0x12cae00, 0xc421a21a10, 0x0, ...)
/go/src/github.com/influxdata/influxdb/tsdb/index.go:1786 +0x476
github.com/influxdata/influxdb/tsdb.IndexSet.tagValuesByKeyAndExpr(0xc52455ad80, 0x1, 0x8, 0xc4201913b0, 0x12ce9c0, 0x1336238, 0xc428833080, 0xc, 0x10, 0xc617b143f0, ...)
/go/src/github.com/influxdata/influxdb/tsdb/index.go:2144 +0x1a0
github.com/influxdata/influxdb/tsdb.IndexSet.MeasurementTagKeyValuesByExpr(0xc52455ad80, 0x1, 0x8, 0xc4201913b0, 0x12ce9c0, 0x1336238, 0xc428833080, 0xc, 0x10, 0xc617b143f0, ...)
/go/src/github.com/influxdata/influxdb/tsdb/index.go:2293 +0xca1
github.com/influxdata/influxdb/tsdb.(*Store).TagValues(0xc42017e300, 0x12ce9c0, 0x1336238, 0xc62992b040, 0x8, 0x8, 0x12cae00, 0xc421a218c0, 0x8, 0x20, ...)
/go/src/github.com/influxdata/influxdb/tsdb/store.go:1517 +0x946
github.com/influxdata/influxdb/coordinator.LocalTSDBStore.TagValues(0xc42017e300, 0x12ce9c0, 0x1336238, 0xc62992b040, 0x8, 0x8, 0x12cae00, 0xc421a218c0, 0x32f2d7fe, 0x109d537404, ...)
<autogenerated>:1 +0x97
github.com/influxdata/influxdb/coordinator.(*StatementExecutor).executeShowTagValues(0xc420238a80, 0xc52455ab80, 0xc6977b9c48, 0xdf7588, 0xf)
/go/src/github.com/influxdata/influxdb/coordinator/statement_executor.go:1066 +0x840
github.com/influxdata/influxdb/coordinator.(*StatementExecutor).ExecuteStatement(0xc420238a80, 0x12ce780, 0xc52455ab80, 0x0, 0x19dc, 0xc72df8b3b0, 0xc5b6f04ea0, 0xc5b6d768a0, 0xc45257d5ee, 0x8, ...)
/go/src/github.com/influxdata/influxdb/coordinator/statement_executor.go:194 +0x2937
github.com/influxdata/influxdb/query.(*QueryExecutor).executeQuery(0xc42018d7a0, 0xc5d867d2a0, 0xc45257d5ee, 0x8, 0x12ce9c0, 0x1336238, 0x2710, 0x1, 0x0, 0x0, ...)
/go/src/github.com/influxdata/influxdb/query/query_executor.go:389 +0xae8
created by github.com/influxdata/influxdb/query.(*QueryExecutor).ExecuteQuery
/go/src/github.com/influxdata/influxdb/query/query_executor.go:285 +0xc3
" log_id=06uNqYgl000 service=query

This will be fixed in 1.5.1: nil pointer dereference with certain SHOW TAG VALUES qeuries · Issue #9548 · influxdata/influxdb · GitHub

We have updated our influx to 1.5.2 and still see the error. Couldn’t paste the error message here as there is a limit for a new user :frowning:

Can you paste the error into a gist or put it on a pastebin/whatever and link it back here?

1 Like

Sorry Mark. False alarm. After upgrade to 1.5.2, failed to restart influxdb.