Skip to content
This repository has been archived by the owner on May 14, 2020. It is now read-only.

Unable to restore etcd backup v2 #4

Closed
r7vme opened this issue Jul 27, 2017 · 3 comments
Closed

Unable to restore etcd backup v2 #4

r7vme opened this issue Jul 27, 2017 · 3 comments

Comments

@r7vme
Copy link
Contributor

r7vme commented Jul 27, 2017

Restoring v2 snapshot gives following error

etcd2|⇒ etcd -debug -data-dir /home/rs/tmp/etcd2/locallab-etcd-backup-v2-2017-07-27T20-50-05/ -force-new-cluster 
2017-07-27 23:53:08.302419 I | etcdmain: etcd Version: 3.2.0-rc.0+git
2017-07-27 23:53:08.302452 I | etcdmain: Git SHA: Not provided (use ./build instead of go build)
2017-07-27 23:53:08.302458 I | etcdmain: Go Version: go1.8.1
2017-07-27 23:53:08.302463 I | etcdmain: Go OS/Arch: linux/amd64
2017-07-27 23:53:08.302467 I | etcdmain: setting maximum number of CPUs to 4, total number of available CPUs is 4
2017-07-27 23:53:08.302500 N | etcdmain: the server is already initialized as member before, starting as etcd member...
2017-07-27 23:53:08.302861 I | embed: listening for peers on http://localhost:2380
2017-07-27 23:53:08.302979 I | embed: listening for client requests on localhost:2379
2017-07-27 23:53:08.331789 I | etcdserver: recovered store from snapshot at index 39809605
2017-07-27 23:53:08.343783 C | etcdserver: recovering backend from snapshot error: database snapshot file path error: snap: snapshot file doesn't exist
panic: recovering backend from snapshot error: database snapshot file path error: snap: snapshot file doesn't exist
        panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0xb5454c]

goroutine 1 [running]:
github.com/coreos/etcd/cmd/vendor/github.com/coreos/etcd/etcdserver.NewServer.func1(0xc4201b2678, 0xc4201b2470)
        /home/rs/src/go/src/github.com/coreos/etcd/cmd/vendor/github.com/coreos/etcd/etcdserver/server.go:279 +0x3c
panic(0xd67640, 0xc4201d8210)
        /usr/lib/go/src/runtime/panic.go:489 +0x2cf
github.com/coreos/etcd/cmd/vendor/github.com/coreos/pkg/capnslog.(*PackageLogger).Panicf(0xc42016dde0, 0xf3684f, 0x2a, 0xc4201b24e0, 0x1, 0x1)
        /home/rs/src/go/src/github.com/coreos/etcd/cmd/vendor/github.com/coreos/pkg/capnslog/pkg_logger.go:75 +0x15c
github.com/coreos/etcd/cmd/vendor/github.com/coreos/etcd/etcdserver.NewServer(0xc420246000, 0x0, 0x1612180, 0xc42023e060)
        /home/rs/src/go/src/github.com/coreos/etcd/cmd/vendor/github.com/coreos/etcd/etcdserver/server.go:374 +0x2e52
github.com/coreos/etcd/cmd/vendor/github.com/coreos/etcd/embed.StartEtcd(0xc420199180, 0x0, 0x0, 0x0)
        /home/rs/src/go/src/github.com/coreos/etcd/cmd/vendor/github.com/coreos/etcd/embed/etcd.go:147 +0x7c0
github.com/coreos/etcd/cmd/vendor/github.com/coreos/etcd/etcdmain.startEtcd(0xc420199180, 0x6, 0xf132b8, 0x6, 0x1)
        /home/rs/src/go/src/github.com/coreos/etcd/cmd/vendor/github.com/coreos/etcd/etcdmain/etcd.go:186 +0x58
github.com/coreos/etcd/cmd/vendor/github.com/coreos/etcd/etcdmain.startEtcdOrProxyV2()
        /home/rs/src/go/src/github.com/coreos/etcd/cmd/vendor/github.com/coreos/etcd/etcdmain/etcd.go:103 +0x15ba
github.com/coreos/etcd/cmd/vendor/github.com/coreos/etcd/etcdmain.Main()
        /home/rs/src/go/src/github.com/coreos/etcd/cmd/vendor/github.com/coreos/etcd/etcdmain/main.go:39 +0x61
main.main()
        /home/rs/src/go/src/github.com/coreos/etcd/cmd/etcd/main.go:28 +0x20
@r7vme
Copy link
Contributor Author

r7vme commented Jul 28, 2017

Created upstream bug etcd-io/etcd#8331

Also found that in case of successful v2 backup we have both v2 and v3. Tested locally.
etcd-io/etcd#7002 (comment)

@r7vme
Copy link
Contributor Author

r7vme commented Jul 29, 2017

As workaround, before restoration do

touch $BACKUP_DIR/member/snap/db

It's important to use same 3.1.7 version of etcd. With 3.2.0 restoration is not working.

@r7vme
Copy link
Contributor Author

r7vme commented Sep 4, 2017

@r7vme r7vme closed this as completed Sep 4, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant