influxdb
influxdb copied to clipboard
[0.9.4.1] "runtime error: invalid memory address or nil pointer dereference" when writing with a non-existent retention policy
Test case: curl -G http://localhost:8086/query --data-urlencode "q=CREATE DATABASE _test" curl -XPOST "http://localhost:8086/write?db=_test&rp=fake_retention_policy" --data-binary 'cpu value=61'
Results in:
Oct 4 18:38:17 localhost influxd[869]: 2015/10/04 18:38:17 http: panic serving 127.0.0.1:47166: runtime error: invalid memory address or nil pointer dereference
Oct 4 18:38:17 localhost influxd[869]: goroutine 4519 [running]:
Oct 4 18:38:17 localhost influxd[869]: net/http.(*conn).serve.func1(0xc8200d2000, 0x7f6124955f18, 0xc820116008)
Oct 4 18:38:17 localhost influxd[869]: /home/philip/.gvm/gos/go1.5/src/net/http/server.go:1287 +0xb5
Oct 4 18:38:17 localhost influxd[869]: github.com/influxdb/influxdb/cluster.(*PointsWriter).MapShards(0xc820093080, 0xc820d0c400, 0x9, 0x0, 0x0)
Oct 4 18:38:17 localhost influxd[869]: /tmp/build/src/github.com/influxdb/influxdb/cluster/points_writer.go:179 +0x1f3
Oct 4 18:38:17 localhost influxd[869]: github.com/influxdb/influxdb/cluster.(*PointsWriter).WritePoints(0xc820093080, 0xc820d0c400, 0x0, 0x0)
Oct 4 18:38:17 localhost influxd[869]: /tmp/build/src/github.com/influxdb/influxdb/cluster/points_writer.go:215 +0x1d9
Oct 4 18:38:17 localhost influxd[869]: github.com/influxdb/influxdb/services/httpd.(*Handler).serveWriteLine(0xc820093200, 0x7f6124995d40, 0xc82058a1c0, 0xc820099ea0, 0xc820150400, 0x1e, 0x200, 0x0)
Oct 4 18:38:17 localhost influxd[869]: /tmp/build/src/github.com/influxdb/influxdb/services/httpd/handler.go:524 +0xeb0
Oct 4 18:38:17 localhost influxd[869]: github.com/influxdb/influxdb/services/httpd.(*Handler).serveWrite(0xc820093200, 0x7f6124995d40, 0xc82058a1c0, 0xc820099ea0, 0x0)
Oct 4 18:38:17 localhost influxd[869]: /tmp/build/src/github.com/influxdb/influxdb/services/httpd/handler.go:376 +0x79c
Oct 4 18:38:17 localhost influxd[869]: github.com/influxdb/influxdb/services/httpd.(*Handler).(github.com/influxdb/influxdb/services/httpd.serveWrite)-fm(0x7f6124995d40, 0xc82058a1c0, 0xc820099ea0, 0x0)
Oct 4 18:38:17 localhost influxd[869]: /tmp/build/src/github.com/influxdb/influxdb/services/httpd/handler.go:106 +0x48
Oct 4 18:38:17 localhost influxd[869]: github.com/influxdb/influxdb/services/httpd.authenticate.func1(0x7f6124995d40, 0xc82058a1c0, 0xc820099ea0)
Oct 4 18:38:17 localhost influxd[869]: /tmp/build/src/github.com/influxdb/influxdb/services/httpd/handler.go:673 +0x70
Oct 4 18:38:17 localhost influxd[869]: net/http.HandlerFunc.ServeHTTP(0xc820139c60, 0x7f6124995d40, 0xc82058a1c0, 0xc820099ea0)
Oct 4 18:38:17 localhost influxd[869]: /home/philip/.gvm/gos/go1.5/src/net/http/server.go:1422 +0x3a
Oct 4 18:38:17 localhost influxd[869]: github.com/influxdb/influxdb/services/httpd.gzipFilter.func1(0x7f6124995d40, 0xc82058a1c0, 0xc820099ea0)
Oct 4 18:38:17 localhost influxd[869]: /tmp/build/src/github.com/influxdb/influxdb/services/httpd/handler.go:727 +0xda
Oct 4 18:38:17 localhost influxd[869]: net/http.HandlerFunc.ServeHTTP(0xc820139c80, 0x7f6124995d40, 0xc82058a1c0, 0xc820099ea0)
Oct 4 18:38:17 localhost influxd[869]: /home/philip/.gvm/gos/go1.5/src/net/http/server.go:1422 +0x3a
Oct 4 18:38:17 localhost influxd[869]: github.com/influxdb/influxdb/services/httpd.versionHeader.func1(0x7f6124995d40, 0xc82058a1c0, 0xc820099ea0)
Oct 4 18:38:17 localhost influxd[869]: /tmp/build/src/github.com/influxdb/influxdb/services/httpd/handler.go:743 +0xc0
Oct 4 18:38:17 localhost influxd[869]: net/http.HandlerFunc.ServeHTTP(0xc820139ca0, 0x7f6124995d40, 0xc82058a1c0, 0xc820099ea0)
Oct 4 18:38:17 localhost influxd[869]: /home/philip/.gvm/gos/go1.5/src/net/http/server.go:1422 +0x3a
Oct 4 18:38:17 localhost influxd[869]: github.com/influxdb/influxdb/services/httpd.cors.func1(0x7f6124995d40, 0xc82058a1c0, 0xc820099ea0)
Oct 4 18:38:17 localhost influxd[869]: /tmp/build/src/github.com/influxdb/influxdb/services/httpd/handler.go:776 +0x328
Oct 4 18:38:17 localhost influxd[869]: net/http.HandlerFunc.ServeHTTP(0xc820139cc0, 0x7f6124995d40, 0xc82058a1c0, 0xc820099ea0)
Oct 4 18:38:17 localhost influxd[869]: /home/philip/.gvm/gos/go1.5/src/net/http/server.go:1422 +0x3a
Oct 4 18:38:17 localhost influxd[869]: github.com/influxdb/influxdb/services/httpd.requestID.func1(0x7f6124995d40, 0xc82058a1c0, 0xc820099ea0)
Oct 4 18:38:18 localhost influxd[869]: /tmp/build/src/github.com/influxdb/influxdb/services/httpd/handler.go:786 +0x15d
Oct 4 18:38:18 localhost influxd[869]: net/http.HandlerFunc.ServeHTTP(0xc820139ce0, 0x7f6124995d40, 0xc82058a1c0, 0xc820099ea0)
Oct 4 18:38:18 localhost influxd[869]: /home/philip/.gvm/gos/go1.5/src/net/http/server.go:1422 +0x3a
Oct 4 18:38:18 localhost influxd[869]: github.com/influxdb/influxdb/services/httpd.logging.func1(0x7f6124995d40, 0xc82058a1a0, 0xc820099ea0)
Oct 4 18:38:18 localhost influxd[869]: /tmp/build/src/github.com/influxdb/influxdb/services/httpd/handler.go:794 +0x10b
Oct 4 18:38:18 localhost influxd[869]: net/http.HandlerFunc.ServeHTTP(0xc820139d00, 0x7f6124995d40, 0xc82058a1a0, 0xc820099ea0)
Oct 4 18:38:18 localhost influxd[869]: /home/philip/.gvm/gos/go1.5/src/net/http/server.go:1422 +0x3a
Oct 4 18:38:18 localhost influxd[869]: github.com/influxdb/influxdb/services/httpd.recovery.func1(0x7f6124995d08, 0xc8200d20b0, 0xc820099ea0)
Oct 4 18:38:18 localhost influxd[869]: /tmp/build/src/github.com/influxdb/influxdb/services/httpd/handler.go:804 +0x114
Oct 4 18:38:18 localhost influxd[869]: net/http.HandlerFunc.ServeHTTP(0xc820139d20, 0x7f6124995d08, 0xc8200d20b0, 0xc820099ea0)
Oct 4 18:38:18 localhost influxd[869]: /home/philip/.gvm/gos/go1.5/src/net/http/server.go:1422 +0x3a
Oct 4 18:38:18 localhost influxd[869]: github.com/bmizerany/pat.(*PatternServeMux).ServeHTTP(0xc820028108, 0x7f6124995d08, 0xc8200d20b0, 0xc820099ea0)
Oct 4 18:38:18 localhost influxd[869]: /tmp/build/src/github.com/bmizerany/pat/mux.go:109 +0x244
Oct 4 18:38:18 localhost influxd[869]: github.com/influxdb/influxdb/services/httpd.(*Handler).ServeHTTP(0xc820093200, 0x7f6124995d08, 0xc8200d20b0, 0xc820099ea0)
Oct 4 18:38:18 localhost influxd[869]: /tmp/build/src/github.com/influxdb/influxdb/services/httpd/handler.go:172 +0x357
Oct 4 18:38:18 localhost influxd[869]: net/http.serverHandler.ServeHTTP(0xc820016240, 0x7f6124995d08, 0xc8200d20b0, 0xc820099ea0)
Oct 4 18:38:18 localhost influxd[869]: /home/philip/.gvm/gos/go1.5/src/net/http/server.go:1862 +0x19e
Oct 4 18:38:18 localhost influxd[869]: net/http.(*conn).serve(0xc8200d2000)
Oct 4 18:38:18 localhost influxd[869]: /home/philip/.gvm/gos/go1.5/src/net/http/server.go:1361 +0xbee
Oct 4 18:38:18 localhost influxd[869]: created by net/http.(*Server).Serve
Oct 4 18:38:18 localhost influxd[869]: /home/philip/.gvm/gos/go1.5/src/net/http/server.go:1910 +0x3f6
This works fine for me on master, and I get "retention policy not found".
Please let me know if you can reproduce this. There is some key step missing from this repro.
Sorry for the delayed response. Nope, can't reproduce this in master either. All ok!