Closed
Description
Since 0.10.0, when we create a create retention policy on a database that do not exists, instead of returning an error, InfluxDB crash:
2016/02/02 09:17:50 InfluxDB starting, version 0.10.0.n1454400035, branch master, commit fd85ae5b7fada9142aac66603200e6cc124f9aed, built 2016-02-02T08:01:46.972758
[...]
[query] 2016/02/02 09:18:28 CREATE RETENTION POLICY policy_name ON dbname DURATION 1d REPLICATION 1 DEFAULT
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x560abb]
goroutine 57 [running]:
github.com/influxdb/influxdb/services/meta.(*Client).RetentionPolicy(0xc2080ac780, 0xc20800bcf8, 0x6, 0xc20800bce0, 0xb, 0xc20803a260, 0x0, 0x0)
/tmp/tmp.AhbDyY9LRi/src/github.com/influxdb/influxdb/services/meta/client.go:406 +0xeb
github.com/influxdb/influxdb/services/meta.(*Client).CreateRetentionPolicy(0xc2080ac780, 0xc20800bcf8, 0x6, 0xc20808de00, 0xc200000000, 0x0, 0x0)
/tmp/tmp.AhbDyY9LRi/src/github.com/influxdb/influxdb/services/meta/client.go:379 +0x81
github.com/influxdb/influxdb/services/meta.(*StatementExecutor).executeCreateRetentionPolicyStatement(0xc208140170, 0xc2081068c0, 0xc2081068c0)
/tmp/tmp.AhbDyY9LRi/src/github.com/influxdb/influxdb/services/meta/statement_executor.go:256 +0x105
github.com/influxdb/influxdb/services/meta.(*StatementExecutor).ExecuteStatement(0xc208140170, 0x7f8c598dca70, 0xc2081068c0, 0x50)
/tmp/tmp.AhbDyY9LRi/src/github.com/influxdb/influxdb/services/meta/statement_executor.go:81 +0xb7b
github.com/influxdb/influxdb/services/meta.(*Client).ExecuteStatement(0xc2080ac780, 0x7f8c598dca70, 0xc2081068c0, 0x1)
/tmp/tmp.AhbDyY9LRi/src/github.com/influxdb/influxdb/services/meta/client.go:889 +0x40
github.com/influxdb/influxdb/tsdb.func·024()
/tmp/tmp.AhbDyY9LRi/src/github.com/influxdb/influxdb/tsdb/query_executor.go:204 +0x90d
created by github.com/influxdb/influxdb/tsdb.(*QueryExecutor).ExecuteQuery
/tmp/tmp.AhbDyY9LRi/src/github.com/influxdb/influxdb/tsdb/query_executor.go:225 +0x242
This was not the case with 0.9.6.1
The query needed to crash the server seems to be any create retention on unexisting database with duration and replication settings e.g.:
CREATE RETENTION POLICY policy_name ON dbname DURATION 1d REPLICATION 1
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Relationships
Development
No branches or pull requests
Activity
seiflotfy commentedon Feb 2, 2016
Was able to replicate. Fixing it