Mayur Sharma:
root@cluster3-master1:~# ETCDCTL_API=3 etcdctl --endpoints 127.0.0.1:2379 snapshot restore /tmp/etcd-backup.db --data-dir=/var/lib/etcd-from-backup3
Error: expected sha256 [218 93 64 172 68 166 36 95 53 240 6 120 136 168 101 33 131 95 103 2 118 210 59 109 176 176 10 185 223 32 11 129], got [132 55 87 192 0 151 168 17 77 248 45 185 30 90 152 182 250 26 252 59 163 40 162 58 199 5 163 227 229 62 228 38]
How to get this solve?
Malayamanas Panda:
@Mayur Sharma http://gitlab.cncf.ci/etcd-io/etcd/commit/798718c49ba86e8f03eb586456e01909a8969653
Snapshot integrity may be optionally verified at restore time. If the snapshot is taken with etcdctl snapshot save
, it will have an integrity hash that is checked by etcdctl snapshot restore
. If the snapshot is copied from the data directory, there is no integrity hash and it will only restore by using --skip-hash-check
.
Mayur Sharma:
@Malayamanas Panda: I have taken snapshot from ‘etcdctl snapshot save’. As per this, I should add --skip-hash-check=true .
we did not add any such property during lab test, do you know why
Malayamanas Panda:
@Mayur Sharma It says that you have directly copied etcd from path, then user --skip-hash-check . Otherwise, if ‘etcdctl snapshot save’ is used , then ideally , ‘etcdctl snapshot restore’ would do a hash integrity check. If these are not working as per the documentation of etcd, then please raise a bug and pursue it.
Sanjay Kumar:
Can you try passing the - - cacert, - -cert and - -key while doing the restore ?
SaidBen:
it seems that you are missing many flags etcdctl snapshot restore -h
Ramit Sharma:
why are you giving --endpoints in restore command. Its not required. Try without it and you should be good.
Mayur Sharma:
@Sanjay Kumar @SaidBen had tried with endpoints, cacert and cert and key options also, but same result