panic: invalid page type
- Dominant language
- Go
- Stars
- 30.1k
- Forks
- 4.6k
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 39
Description
bootstrap_expect > 0: expecting 3 servers
```
==> Starting Consul agent...
Version: 'v1.6.0-rc1 (71f98661d)'
Node ID: 'cbdab978-4df9-b604-0553-5cd6a00cf812'
Node name: 'consul-0'
Datacenter: 'dc1' (Segment: '')
Server: true (Bootstrap: false)
Client Addr: [0.0.0.0] (HTTP: 8500, HTTPS: -1, gRPC: -1, DNS: 8600)
Cluster Addr: 100.101.219.34 (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: invalid page type: 3404: 10
goroutine 1 [running]:
github.com/boltdb/bolt.(*Cursor).search(0xc0007d0108, 0x4f860f0, 0x4, 0x4, 0xd4c)
/go/pkg/mod/github.com/boltdb/bolt@v1.3.1/cursor.go:256 +0x354
github.com/boltdb/bolt.(*Cursor).seek(0xc0007d0108, 0x4f860f0, 0x4, 0x4, 0x0, 0x0, 0x0, 0x0, 0xc0007d01b8, 0x146aeda, ...)
/go/pkg/mod/github.com/boltdb/bolt@v1.3.1/cursor.go:159 +0x7e
github.com/boltdb/bolt.(*Bucket).CreateBucket(0xc00004c1d8, 0x4f860f0, 0x4, 0x4, 0xc0007d0228, 0x42c48f, 0xc0000fc300)
/go/pkg/mod/github.com/boltdb/bolt@v1.3.1/bucket.go:172 +0xf0
github.com/boltdb/bolt.(*Bucket).CreateBucketIfNotExists(0xc00004c1d8, 0x4f860f0, 0x4, 0x4, 0x0, 0x20, 0x29bb4c0)
/go/pkg/mod/github.com/boltdb/bolt@v1.3.1/bucket.go:206 +0x4d
github.com/boltdb/bolt.(*Tx).CreateBucketIfNotExists(...)
/go/pkg/mod/github.com/boltdb/bolt@v1.3.1/tx.go:115
github.com/hashicorp/raft-boltdb.(*BoltStore).initialize(0xc000105ec0, 0x0, 0x0)
/go/pkg/mod/github.com/hashicorp/raft-boltdb@v0.0.0-20171010151810-6e5ba93211ea/bolt_store.go:98 +0xba
github.com/hashicorp/raft-boltdb.New(0xc000376780, 0x19, 0x0, 0xc000376700, 0x19, 0x0, 0x0)
/go/pkg/mod/github.com/hashicorp/raft-boltdb@v0.0.0-20171010151810-6e5ba93211ea/bolt_store.go:81 +0xfe
github.com/hashicorp/raft-boltdb.NewBoltStore(...)
/go/pkg/mod/github.com/hashicorp/raft-boltdb@v0.0.0-20171010151810-6e5ba93211ea/bolt_store.go:60
github.com/hashicorp/consul/agent/consul.(*Server).setupRaft(0xc00054e380, 0x0, 0x0)
/home/circleci/project/consul/agent/consul/server.go:630 +0xa36
github.com/hashicorp/consul/agent/consul.NewServerLogger(0xc0001ae000, 0xc0002bf4a0, 0xc00045c800, 0xc000452050, 0x0, 0x0, 0x0)
/home/circleci/project/consul/agent/consul/server.go:431 +0xafe
github.com/hashicorp/consul/agent.(*Agent).Start(0xc0004146c0, 0x0, 0x0)
/home/circleci/project/consul/agent/agent.go:380 +0x56e
github.com/hashicorp/consul/command/agent.(*cmd).run(0xc000125200, 0xc0000f8020, 0xc, 0xc, 0x0)
/home/circleci/project/consul/command/agent/agent.go:280 +0xf5b
github.com/hashicorp/consul/command/agent.(*cmd).Run(0xc000125200, 0xc0000f8020, 0xc, 0xc, 0xc000105b00)
/home/circleci/project/consul/command/agent/agent.go:75 +0x4d
github.com/mitchellh/cli.(*CLI).Run(0xc00014af00, 0xc00014af00, 0x80, 0xc000105b80)
/go/pkg/mod/github.com/mitchellh/cli@v1.0.0/cli.go:255 +0x1f1
main.realMain(0xc0000ce058)
/home/circleci/project/consul/main.go:53 +0x393
main.main()
/home/circleci/project/consul/main.go:20 +0x22
```
Contributor guide
Research direction
Start with the panic trace in github.com/boltdb/bolt/cursor.go and follow the call into github.com/hashicorp/raft-boltdb/bolt_store.go and agent/consul/server.go:630 during setupRaft. Reproduce startup with bootstrap_expect > 0 and determine why the Bolt store reports an invalid page type; done means the agent no longer panics in this setup and the failure has regression coverage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100