Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Null pointer panic #1698

Closed
aderouineau opened this issue Feb 23, 2024 · 7 comments · Fixed by #1700
Closed

Null pointer panic #1698

aderouineau opened this issue Feb 23, 2024 · 7 comments · Fixed by #1700

Comments

@aderouineau
Copy link

What version are you running?

8.21.1

Are you using Docker or Kubernetes to run your system?

Np

Are you running a single node or a cluster?

2-node cluster

What did you do?

  1. Start node 1 with 10+ GB SQLite database
  2. Start node 2, let the transfer and restore complete
  3. Stop node 2 (without removing it from the cluster)
  4. Start node 2 again
  5. Run .nodes all before node 2 is restored

What did you expect to happen?

I expected node 2 to not panic.

What happened instead?

[store] 2024/02/23 15:19:33 opening store with node ID 2, listening on localhost:4012
[store] 2024/02/23 15:19:33 ensuring data directory exists at /home/derouin/rqlite/data2
[store] 2024/02/23 15:19:33 old snapshot directory /home/derouin/rqlite/data2/snapshots does not exist, nothing to upgrade
[snapshot-store] 2024/02/23 15:19:33 store initialized using /home/derouin/rqlite/data2/rsnapshots
[snapshot-store] 2024/02/23 15:19:33 checking consistency of snapshot store at /home/derouin/rqlite/data2/rsnapshots
[snapshot-store] 2024/02/23 15:19:33 check complete
[store] 2024/02/23 15:19:33 1 preexisting snapshots present
[store] 2024/02/23 15:19:33 first log index: 4, last log index: 4, last applied index: 4, last command log index: 0:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0xf4a0e4]

goroutine 72 [running]:
github.com/hashicorp/raft.(*Raft).CommitIndex(...)
        /tmp/tmp.RHSvXLaim1/pkg/mod/github.com/hashicorp/raft@v1.6.1/api.go:1212
github.com/rqlite/rqlite/v8/store.(*Store).CommitIndex(0xc0000b0e60?)
        /tmp/tmp.RHSvXLaim1/src/github.com/rqlite/rqlite/store/store.go:859 +0x4
github.com/rqlite/rqlite/v8/cluster.(*Service).handleConn(0xc0001ba090, {0x18764d0?, 0xc00016cd90})
        /tmp/tmp.RHSvXLaim1/src/github.com/rqlite/rqlite/cluster/service.go:291 +0x207
created by github.com/rqlite/rqlite/v8/cluster.(*Service).serve in goroutine 14
        /tmp/tmp.RHSvXLaim1/src/github.com/rqlite/rqlite/cluster/service.go:228 +0x25
@otoolep
Copy link
Member

otoolep commented Feb 23, 2024

When you run .nodes which node is rqlite connected to?

@aderouineau
Copy link
Author

aderouineau commented Feb 23, 2024

It's connected to node 1, but I'm not sure it makes a difference?

@otoolep
Copy link
Member

otoolep commented Feb 23, 2024

Got it, thanks. I believe #1699 will fix this -- there should be more checks of the Store state in place.

@otoolep otoolep linked a pull request Feb 23, 2024 that will close this issue
@otoolep
Copy link
Member

otoolep commented Feb 23, 2024

I'll aim to make a release with the fix in place within the next day or so.

@otoolep
Copy link
Member

otoolep commented Feb 23, 2024

If you want to patch your own tree, and build locally, the linked PR will show you basically what you need to do.

@aderouineau
Copy link
Author

No rush. So far I've just been messing around with rqlite and putting it through its paces, so-to-speak :)

@otoolep
Copy link
Member

otoolep commented Feb 23, 2024

All good -- your work on rqlite has been very helpful.

@otoolep otoolep linked a pull request Feb 23, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants