{"action":"created","issue":{"url":"https://api.github.com/repos/influxdb/influxdb/issues/4088","labels_url":"https://api.github.com/repos/influxdb/influxdb/issues/4088/labels{/name}","comments_url":"https://api.github.com/repos/influxdb/influxdb/issues/4088/comments","events_url":"https://api.github.com/repos/influxdb/influxdb/issues/4088/events","html_url":"https://github.com/influxdb/influxdb/issues/4088","id":106164695,"number":4088,"title":"Influxdb stop fails with runtime error if configured graphite DB does not exist","user":{"login":"aheusingfeld","id":534272,"avatar_url":"https://avatars.githubusercontent.com/u/534272?v=3","gravatar_id":"","url":"https://api.github.com/users/aheusingfeld","html_url":"https://github.com/aheusingfeld","followers_url":"https://api.github.com/users/aheusingfeld/followers","following_url":"https://api.github.com/users/aheusingfeld/following{/other_user}","gists_url":"https://api.github.com/users/aheusingfeld/gists{/gist_id}","starred_url":"https://api.github.com/users/aheusingfeld/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aheusingfeld/subscriptions","organizations_url":"https://api.github.com/users/aheusingfeld/orgs","repos_url":"https://api.github.com/users/aheusingfeld/repos","events_url":"https://api.github.com/users/aheusingfeld/events{/privacy}","received_events_url":"https://api.github.com/users/aheusingfeld/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-09-12T14:46:28Z","updated_at":"2015-09-17T04:08:29Z","closed_at":null,"body":"It seems that a new \"feature\" in 0.9.3 is that InfluxDB refuses to start if the configured database for the graphite plugin does not exist. Apart from complicating the initialization process e.g. of a docker based deployment (see https://github.com/tutumcloud/influxdb/tree/master/0.9), the error handling in this scenario looks a bit strange so I thought I'd let you know.\r\n\r\nI tested with the following `config.toml` locally and within the docker container:\r\n```\r\nreporting-disabled = false\r\n[meta]\r\n  dir = \"/root/.influxdb/meta\"\r\n  hostname = \"localhost\"\r\n  bind-address = \":8088\"\r\n  retention-autocreate = true\r\n  election-timeout = \"1s\"\r\n  heartbeat-timeout = \"1s\"\r\n  leader-lease-timeout = \"500ms\"\r\n  commit-timeout = \"50ms\"\r\n  cluster-tracing = false\r\n\r\n[data]\r\n  dir = \"/root/.influxdb/db\"\r\n  max-wal-size = 104857600 # Maximum size the WAL can reach before a flush. Defaults to 100MB.\r\n  wal-flush-interval = \"10m\" # Maximum time data can sit in WAL before a flush.\r\n  wal-partition-flush-delay = \"2s\" # The delay time between each WAL partition being flushed.\r\n  wal-dir = \"/root/.influxdb/wal\"\r\n  wal-enable-logging = true\r\n  wal-ready-series-size = 30720\r\n  wal-compaction-threshold = 0.5\r\n  wal-max-series-size = 1048576\r\n  wal-flush-cold-interval = \"5m0s\"\r\n  wal-partition-size-threshold = 20971520\r\n\r\n[cluster]\r\n  force-remote-mapping = false\r\n  write-timeout = \"5s\" # The time within which a write operation must complete on the cluster.\r\n  shard-writer-timeout = \"5s\" # The time within which a shard must respond to write.\r\n  shard-mapper-timeout = \"5s\"\r\n\r\n[retention]\r\n  enabled = true\r\n  check-interval = \"10m\"\r\n\r\n[shard-precreation]\r\n  enabled = true\r\n  check-interval = \"10m0s\"\r\n  advance-period = \"30m0s\"\r\n\r\n[admin]\r\n  enabled = true\r\n  bind-address = \":8083\"\r\n  https-enabled = false\r\n  https-certificate = \"/etc/ssl/influxdb.pem\"\r\n\r\n[http]\r\n  enabled = true\r\n  bind-address = \":8086\"\r\n  auth-enabled = false\r\n  log-enabled = true\r\n  write-tracing = false\r\n  pprof-enabled = false\r\n  https-enabled = false\r\n  https-certificate = \"/etc/ssl/influxdb.pem\"\r\n\r\n[[graphite]]\r\n  enabled = true\r\n  bind-address = \":2003\"\r\n  protocol = \"udp\"\r\n  consistency-level = \"one\"\r\n  name-separator = \".\"\r\n  database = \"graphite\"\r\n  batch-size = 1000\r\n  batch-timeout = \"1s\"\r\n  name-schema = \"application.instance.profile.measurement*\"\r\n  ignore-unnamed = true\r\n\r\n[collectd]\r\n  enabled = false\r\n\r\n[opentsdb]\r\n  enabled = false\r\n\r\n[[udp]]\r\n  enabled = false\r\n\r\n[monitoring]\r\n  enabled = false\r\n  write-interval = \"24h\"\r\n\r\n[continuous_queries]\r\n  log-enabled = true\r\n  enabled = true\r\n  recompute-previous-n = 2\r\n  recompute-no-older-than = \"10m\"\r\n  compute-runs-per-interval = 10\r\n  compute-no-more-than = \"2m\"\r\n\r\n[hinted-handoff]\r\n  enabled = true\r\n  dir = \"/root/.influxdb/hh\"\r\n  max-size = 1073741824\r\n  max-age = \"168h\"\r\n  retry-rate-limit = 0\r\n  retry-interval = \"1s\"\r\n```\r\nthis resulted in the following (shortened) log output:\r\n```\r\n[graphite] 2015/09/12 16:29:29 Failed to ensure target database graphite exists: rpc FetchData failed: short read: got 0, exp 16\r\n[snapshot] 2015/09/12 16:29:29 snapshot listener closed\r\n[tcp] 2015/09/12 16:29:29 cluster service accept error: network connection closed\r\n[shard-precreation] 2015/09/12 16:29:29 Precreation service terminating\r\n[continuous_querier] 2015/09/12 16:29:29 continuous query service terminating\r\n[retention] 2015/09/12 16:29:29 retention policy enforcement terminating\r\npanic: runtime error: invalid memory address or nil pointer dereference\r\n[signal 0xb code=0x1 addr=0x50 pc=0x1cdf58]\r\n\r\ngoroutine 1 [running]:\r\ngithub.com/influxdb/influxdb/tsdb.(*PointBatcher).Stop(0x0)\r\n\t/private/tmp/influxdb20150827-14196-z5nyki/influxdb-0.9.3/src/github.com/influxdb/influxdb/tsdb/batcher.go:109 +0x18\r\ngithub.com/influxdb/influxdb/services/graphite.(*Service).Close(0xc8201500c0, 0x0, 0x0)\r\n\t/private/tmp/influxdb20150827-14196-z5nyki/influxdb-0.9.3/src/github.com/influxdb/influxdb/services/graphite/service.go:129 +0x60\r\ngithub.com/influxdb/influxdb/cmd/influxd/run.(*Server).Close(0xc82012c380, 0x0, 0x0)\r\n\t/private/tmp/influxdb20150827-14196-z5nyki/influxdb-0.9.3/src/github.com/influxdb/influxdb/cmd/influxd/run/server.go:372 +0x141\r\ngithub.com/influxdb/influxdb/cmd/influxd/run.(*Server).Open(0xc82012c380, 0x0, 0x0)\r\n\t/private/tmp/influxdb20150827-14196-z5nyki/influxdb-0.9.3/src/github.com/influxdb/influxdb/cmd/influxd/run/server.go:348 +0x55\r\ngithub.com/influxdb/influxdb/cmd/influxd/run.(*Command).Run(0xc820134100, 0xc82000a430, 0x1, 0x1, 0x0, 0x0)\r\n\t/private/tmp/influxdb20150827-14196-z5nyki/influxdb-0.9.3/src/github.com/influxdb/influxdb/cmd/influxd/run/command.go:112 +0x992\r\nmain.(*Main).Run(0xc820101f00, 0xc82000a430, 0x1, 0x1, 0x0, 0x0)\r\n\t/private/tmp/influxdb20150827-14196-z5nyki/influxdb-0.9.3/src/github.com/influxdb/influxdb/cmd/influxd/main.go:81 +0x67e\r\nmain.main()\r\n\t/private/tmp/influxdb20150827-14196-z5nyki/influxdb-0.9.3/src/github.com/influxdb/influxdb/cmd/influxd/main.go:42 +0x29b\r\n\r\ngoroutine 17 [syscall, locked to thread]:\r\nruntime.goexit()\r\n\t/usr/local/Cellar/go/1.5/libexec/src/runtime/asm_amd64.s:1696 +0x1\r\n\r\ngoroutine 5 [syscall]:\r\nos/signal.loop()\r\n\t/usr/local/Cellar/go/1.5/libexec/src/os/signal/signal_unix.go:22 +0x18\r\ncreated by os/signal.init.1\r\n\t/usr/local/Cellar/go/1.5/libexec/src/os/signal/signal_unix.go:28 +0x37\r\n\r\ngoroutine 27 [sleep]:\r\ntime.Sleep(0x3b9aca00)\r\n\t/usr/local/Cellar/go/1.5/libexec/src/runtime/time.go:59 +0xf9\r\ngithub.com/influxdb/influxdb/meta.(*Store).syncNodeInfo(0xc82012a280, 0x0, 0x0)\r\n\t/private/tmp/influxdb20150827-14196-z5nyki/influxdb-0.9.3/src/github.com/influxdb/influxdb/meta/store.go:292 +0x82\r\ncreated by github.com/influxdb/influxdb/meta.(*Store).Open\r\n\t/private/tmp/influxdb20150827-14196-z5nyki/influxdb-0.9.3/src/github.com/influxdb/influxdb/meta/store.go:253 +0x540\r\n\r\ngoroutine 28 [select]:\r\ngithub.com/influxdb/influxdb/cmd/influxd/run.(*Server).monitorErrorChan(0xc82012c380, 0xc82011e6c0)\r\n\t/private/tmp/influxdb20150827-14196-z5nyki/influxdb-0.9.3/src/github.com/influxdb/influxdb/cmd/influxd/run/server.go:442 +0x145\r\ncreated by github.com/influxdb/influxdb/cmd/influxd/run.(*Server).Open.func1\r\n\t/private/tmp/influxdb20150827-14196-z5nyki/influxdb-0.9.3/src/github.com/influxdb/influxdb/cmd/influxd/run/server.go:319 +0xbff\r\n\r\ngoroutine 527 [chan receive]:\r\ngithub.com/influxdb/influxdb/meta.proxy(0xc820118270, 0xc820224240, 0x0, 0x0)\r\n\t/private/tmp/influxdb20150827-14196-z5nyki/influxdb-0.9.3/src/github.com/influxdb/influxdb/meta/proxy.go:42 +0x29a\r\ngithub.com/influxdb/influxdb/meta.(*rpc).proxyLeader(0xc82017d780, 0xc820224240)\r\n\t/private/tmp/influxdb20150827-14196-z5nyki/influxdb-0.9.3/src/github.com/influxdb/influxdb/meta/rpc.go:66 +0x440\r\ngithub.com/influxdb/influxdb/meta.(*rpc).handleRPCConn(0xc82017d780, 0x1b640b0, 0xc820224240)\r\n\t/private/tmp/influxdb20150827-14196-z5nyki/influxdb-0.9.3/src/github.com/influxdb/influxdb/meta/rpc.go:80 +0x1e6\r\ngithub.com/influxdb/influxdb/meta.(*Store).serveRPCListener.func1(0xc82012a280, 0x1b640b0, 0xc820224240)\r\n\t/private/tmp/influxdb20150827-14196-z5nyki/influxdb-0.9.3/src/github.com/influxdb/influxdb/meta/store.go:737 +0x75\r\ncreated by github.com/influxdb/influxdb/meta.(*Store).serveRPCListener\r\n\t/private/tmp/influxdb20150827-14196-z5nyki/influxdb-0.9.3/src/github.com/influxdb/influxdb/meta/store.go:738 +0x29f\r\n\r\ngoroutine 578 [chan send]:\r\ngithub.com/influxdb/influxdb/meta.broker(0x1b640b0, 0xc820224240, 0x1b640b0, 0xc820118270, 0xc8202d27e0, 0xc8202d28a0)\r\n\t/private/tmp/influxdb20150827-14196-z5nyki/influxdb-0.9.3/src/github.com/influxdb/influxdb/meta/proxy.go:56 +0xfa\r\ncreated by github.com/influxdb/influxdb/meta.proxy\r\n\t/private/tmp/influxdb20150827-14196-z5nyki/influxdb-0.9.3/src/github.com/influxdb/influxdb/meta/proxy.go:16 +0x1d7\r\n```"},"comment":{"url":"https://api.github.com/repos/influxdb/influxdb/issues/comments/140965031","html_url":"https://github.com/influxdb/influxdb/issues/4088#issuecomment-140965031","issue_url":"https://api.github.com/repos/influxdb/influxdb/issues/4088","id":140965031,"user":{"login":"otoolep","id":536312,"avatar_url":"https://avatars.githubusercontent.com/u/536312?v=3","gravatar_id":"","url":"https://api.github.com/users/otoolep","html_url":"https://github.com/otoolep","followers_url":"https://api.github.com/users/otoolep/followers","following_url":"https://api.github.com/users/otoolep/following{/other_user}","gists_url":"https://api.github.com/users/otoolep/gists{/gist_id}","starred_url":"https://api.github.com/users/otoolep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/otoolep/subscriptions","organizations_url":"https://api.github.com/users/otoolep/orgs","repos_url":"https://api.github.com/users/otoolep/repos","events_url":"https://api.github.com/users/otoolep/events{/privacy}","received_events_url":"https://api.github.com/users/otoolep/received_events","type":"User","site_admin":false},"created_at":"2015-09-17T04:08:28Z","updated_at":"2015-09-17T04:08:28Z","body":"@aheusingfeld -- are you still having issues?"}}