eos icon indicating copy to clipboard operation
eos copied to clipboard

Error when starting Nodeos using snapshot.

Open XHQ18 opened this issue 8 years ago • 13 comments

I get snapshot in own chain.

curl http://127.0.0.1:8888/v1/producer/create_snapshot | json_pp
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   220  100   220    0     0    526      0 --:--:-- --:--:-- --:--:--   525
{
   "head_block_id" : "000000e80db33c60505f9a7e012313290a054c38ac376e515ab136d9c858bc6e",
   "snapshot_name" : "/Users/xiehanqing/eoscode/eos/snapshots/snapshot-000000e80db33c60505f9a7e012313290a054c38ac376e515ab136d9c858bc6e.bin"
}

Then I delete blocks.log, blocks.index and reversible. I start nodeos with --snapshot <path to snapshot> command line option ,but fail

error 2018-11-02T10:42:30.915 thread-0  main.cpp:130                  main                 ] 3240000 snapshot_exception: Snapshot exception Binary snapshot has unexpected magic number!

This is start command I usd

//SNAPSHOTDIR is path of snapshot file
./nodeos -e -p eosio --data-dir $DATADIR --config-dir $DATADIR --snapshot $SNAPSHOTDIR

@wanderingbort Looking forward to your reply.Thanks

XHQ18 avatar Nov 04 '18 14:11 XHQ18

Why is snapshot generation ok, but it will give you an error when parsing? Is it the reason to start the command? Or is there a configuration problem? I added four plugins to the configuration file.

plugin = eosio::chain_api_plugin
plugin = eosio::producer_api_plugin
plugin = eosio::history_api_plugin
plugin = eosio::net_api_plugin

XHQ18 avatar Nov 05 '18 03:11 XHQ18

Magic_number is a const variable that writes to the beginning of the snapshot file. Validation also takes the magic_number value from the beginning of the snapshot file. Why is magic_number Error reported?

XHQ18 avatar Nov 05 '18 08:11 XHQ18

What's the file size of /Users/xiehanqing/eoscode/eos/snapshots/snapshot-000000e80db33c60505f9a7e012313290a054c38ac376e515ab136d9c858bc6e.bin?

jgiszczak avatar Nov 29 '18 22:11 jgiszczak

Across your case with me also, are you solved it?

HBrightShow avatar Dec 07 '18 05:12 HBrightShow

Across your case with me also, are you solved it?

ashk012 avatar Jan 03 '19 02:01 ashk012

same issue here.

"What's the file size of .... "

$ ls -rtlh total 1,2G -rw-rw-r-- 1 jj jj 1,2G Jan 10 08:01 snapshot-022f5eccefab3016116f5d069c9849630946133c17a465b8020e7f27ac794b34.bin

ghost avatar Jan 12 '19 20:01 ghost

Update:

  1. removed the "magic" number checkings

void istream_snapshot_reader::validate() const { try { // validate totem auto expected_totem = ostream_snapshot_writer::magic_number; decltype(expected_totem) actual_totem; snapshot.read((char*)&actual_totem, sizeof(actual_totem)); // EOS_ASSERT(actual_totem == expected_totem, snapshot_exception, // "Binary snapshot has unexpected magic number!");

  1. .. and got now the following error.. info 2019-01-12T21:09:24.505 thread-0 chain_plugin.cpp:333 plugin_initialize ] initializing chain plugin warn 2019-01-12T21:09:24.506 thread-0 chain_plugin.cpp:700 plugin_initialize ] 3240000 snapshot_exception: Snapshot exception Binary snapshot validation threw IO exception (basic_ios::clear: iostream error) {"what":"basic_ios::clear: iostream error"} thread-0 snapshot.cpp:224 validate Failed to initialize

ghost avatar Jan 12 '19 21:01 ghost

I am currently having this same issue, do we have a fix for this?

ttruong15 avatar Jan 25 '19 02:01 ttruong15

I am having the same issue. How do one should handle backups?

RomanBelkov avatar Jan 29 '19 13:01 RomanBelkov

Facing the same issue when restoring from snapshot, please help

silvercondor avatar Feb 12 '19 15:02 silvercondor

Facing the same issue when restoring from snapshot, please help

Managed to get it working, node seems to be syncing up now

What I did: Removed data and state folder from /.local/share/eosio/nodeos/data$ folder

download/copy your snapshot into /.local/share/eosio/nodeos/data/snapshots/

./nodeos --delete-all-blocks --snapshot /.local/share/eosio/nodeos/data/snapshots/<snapshotname.bin>

node will freeze for a few minutes after starting up with error saying it needs to resync. just leave it

node should start syncing normally after that. do a curl to your node api to check if chain id is correct and whether head_block_num is recent. if it is then you should be good.

silvercondor avatar Feb 12 '19 15:02 silvercondor

Misleading messages fixed in #6713 and will be in the next release.

jgiszczak avatar Feb 12 '19 17:02 jgiszczak

Facing the same issue when restoring from snapshot, please help

Managed to get it working, node seems to be syncing up now

What I did: Removed data and state folder from /.local/share/eosio/nodeos/data$ folder

download/copy your snapshot into /.local/share/eosio/nodeos/data/snapshots/

./nodeos --delete-all-blocks --snapshot /.local/share/eosio/nodeos/data/snapshots/<snapshotname.bin>

node will freeze for a few minutes after starting up with error saying it needs to resync. just leave it

node should start syncing normally after that. do a curl to your node api to check if chain id is correct and whether head_block_num is recent. if it is then you should be good.

It works for me.

dudebing99 avatar Mar 05 '20 06:03 dudebing99