Trying to start consul in server mode using:
bin/consul agent -server -data-dir /tmp/consul
crashes with this stacktrace:
==> WARNING: It is highly recommended to set GOMAXPROCS higher than 1
==> Starting Consul agent...
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x1 pc=0x81dfb0b]
goroutine 1 [running]:
runtime.panic(0x83e8c20, 0x8952748)
/usr/local/go/src/pkg/runtime/panic.c:266 +0x9a
sync/atomic.StoreUint64(0x18c8c5b4, 0x0, 0x0, 0x825f295)
/usr/local/go/src/pkg/sync/atomic/asm_386.s:196 +0xb
github.com/hashicorp/raft.(_raftState).setCurrentTerm(0x18c8c5b0, 0x0, 0x0)
/home/jwilder/go/src/github.com/hashicorp/raft/state.go:74 +0x42
github.com/hashicorp/raft.(_Raft).setCurrentTerm(0x18c8c5b0, 0x0, 0x0)
/home/jwilder/go/src/github.com/hashicorp/raft/raft.go:1271 +0x135
github.com/hashicorp/raft.NewRaft(0x18c36500, 0xb74ccf98, 0x18c42f80, 0xb74ccfb8, 0x18c9c820, ...)
/home/jwilder/go/src/github.com/hashicorp/raft/raft.go:177 +0x74a
github.com/hashicorp/consul/consul.(_Server).setupRaft(0x18c01e60, 0x0, 0x0)
/home/jwilder/go/src/github.com/hashicorp/consul/consul/server.go:280 +0x55f
github.com/hashicorp/consul/consul.NewServer(0x18c45d20, 0x18c45d20, 0x8359c40, 0x18c90f40)
/home/jwilder/go/src/github.com/hashicorp/consul/consul/server.go:169 +0x49f
github.com/hashicorp/consul/command/agent.(_Agent).setupServer(0x18c4df50, 0x18c8c410, 0x18c0ae10)
/home/jwilder/go/src/github.com/hashicorp/consul/command/agent/agent.go:189 +0x34
github.com/hashicorp/consul/command/agent.Create(0x18c8c410, 0xb74cbe38, 0x18c42bd0, 0x0, 0x806e4f3, ...)
/home/jwilder/go/src/github.com/hashicorp/consul/command/agent/agent.go:103 +0x40b
github.com/hashicorp/consul/command/agent.(_Command).setupAgent(0x18c0ac30, 0x18c8c410, 0xb74cbe38, 0x18c42bd0, 0x18c904c0, ...)
/home/jwilder/go/src/github.com/hashicorp/consul/command/agent/command.go:147 +0x69
github.com/hashicorp/consul/command/agent.(_Command).Run(0x18c0ac30, 0x18c0a010, 0x3, 0x3, 0x0)
/home/jwilder/go/src/github.com/hashicorp/consul/command/agent/command.go:241 +0x4e1
github.com/mitchellh/cli.(*CLI).Run(0x18c31b80, 0x18c31b80, 0x844cae8, 0x9)
/home/jwilder/go/src/github.com/mitchellh/cli/cli.go:69 +0x1d7
main.realMain(0x8058913)
/home/jwilder/go/src/github.com/hashicorp/consul/main.go:36 +0x1e0
main.main()
/home/jwilder/go/src/github.com/hashicorp/consul/main.go:12 +0x1e