Tag Archives: boltdb

[Solved] Consul Error: github.com/boltdb/bolt github.com/boltdb/bolt github.com/hashicorp/raft-boltdb

Consumer startup error:

BootstrapExpect is set to 1; this is the same as Bootstrap mode.
bootstrap = true: do not enable unless necessary
==> Starting Consul agent...
           Version: 'v1.5.3'
           Node ID: '63816065-24d9-8715-0986-cb25587fb459'
         Node name: 'node0'
        Datacenter: 'dc1' (Segment: '<all>')
            Server: true (Bootstrap: true)
       Client Addr: [192.168.8.136] (HTTP: 8500, HTTPS: -1, gRPC: -1, DNS: 8600)
      Cluster Addr: 192.168.8.136 (LAN: 8301, WAN: 8302)
           Encrypt: Gossip: false, TLS-Outgoing: false, TLS-Incoming: false, Auto-Encrypt-TLS: false

==> Log data will now stream in as it occurs:

panic: cannot free page 0 or 1: 0

goroutine 1 [running]:
github.com/boltdb/bolt.(*freelist).free(0xc00080f950, 0xbbdd, 0x7f9cd5354000)
	/go/pkg/mod/github.com/boltdb/[email protected]/freelist.go:113 +0x336
github.com/boltdb/bolt.(*Tx).Commit(0xc0001ea7e0, 0x4f2d0f4, 0x4)
	/go/pkg/mod/github.com/boltdb/[email protected]/tx.go:176 +0x1b7
github.com/hashicorp/raft-boltdb.(*BoltStore).initialize(0xc000248660, 0x0, 0x0)
	/go/pkg/mod/github.com/hashicorp/[email protected]/bolt_store.go:105 +0x137
github.com/hashicorp/raft-boltdb.New(0xc00017fc80, 0x17, 0x0, 0xc00017fc00, 0x17, 0x0, 0x10e7fb3900)
	/go/pkg/mod/github.com/hashicorp/[email protected]/bolt_store.go:81 +0xfe
github.com/hashicorp/raft-boltdb.NewBoltStore(...)
	/go/pkg/mod/github.com/hashicorp/[email protected]/bolt_store.go:60
github.com/hashicorp/consul/agent/consul.(*Server).setupRaft(0xc0006a2380, 0x0, 0x0)
	/home/circleci/project/consul/agent/consul/server.go:627 +0xa36
github.com/hashicorp/consul/agent/consul.NewServerLogger(0xc0006a2000, 0xc0000a0a50, 0xc0006b0680, 0xc0000a0c30, 0x0, 0x0, 0x0)
	/home/circleci/project/consul/agent/consul/server.go:428 +0xafe
github.com/hashicorp/consul/agent.(*Agent).Start(0xc0000b5680, 0x0, 0x0)
	/home/circleci/project/consul/agent/agent.go:411 +0x56e
github.com/hashicorp/consul/command/agent.(*cmd).run(0xc0004e9500, 0xc00004c0e0, 0xa, 0xa, 0x0)
	/home/circleci/project/consul/command/agent/agent.go:280 +0xf5b
github.com/hashicorp/consul/command/agent.(*cmd).Run(0xc0004e9500, 0xc00004c0e0, 0xa, 0xa, 0xc0004e4ca0)
	/home/circleci/project/consul/command/agent/agent.go:75 +0x4d
github.com/mitchellh/cli.(*CLI).Run(0xc0003b3cc0, 0xc0003b3cc0, 0x80, 0xc0004e51e0)
	/go/pkg/mod/github.com/mitchellh/[email protected]/cli.go:255 +0x1f1
main.realMain(0xc000094058)
	/home/circleci/project/consul/main.go:53 +0x393
main.main()
	/home/circleci/project/consul/main.go:20 +0x22

Solution reference: https://github.com/hashicorp/consul/issues/2933

Solution:
find raft. DB on the server where consumer is deployed; Use RM - f to delete all raft. DB ; Restart consumer