erigon icon indicating copy to clipboard operation
erigon copied to clipboard

Stuck with syncing

Open leafyoung opened this issue 4 years ago • 44 comments

System information

Erigon version: erigon version 2022.99.99-dev

OS & Version: Linux

Commit hash : 10aee02e2e9b7fdc160dae0712b0f0bba72a75dd

Expected behaviour

I have finished the initial full sync and expected erigon will repeat the cycle of staged sync for new blocks.

Actual behaviour

But it has ever stuck with block=14378699. The screen output is

INFO[03-16|10:12:23.974] Build info                               git_branch=devel git_tag=v2022.03.01 git_commit=10aee02e2e9b7fdc160dae0712b0f0bba72a75dd
INFO[03-16|10:12:23.974] Starting Erigon on Ethereum mainnet...
INFO[03-16|10:12:23.975] Maximum peer count                       ETH=100 total=100
INFO[03-16|10:12:23.975] Set global gas cap                       cap=50000000
INFO[03-16|10:12:23.997] Opening Database                         label=chaindata path=/mnt/Erigon/eth/mainnet/chaindata
INFO[03-16|10:12:23.998] Initialised chain configuration          config="{ChainID: 1 Homestead: 1150000 DAO: 1920000 DAOSupport: true EIP150: 2463000 EIP155: 2675000 EIP158: 2675000 Byzantium: 4370000 Constantinople: 7280000 Petersburg: 7280000 Istanbul: 9069000, Muir Glacier: 9200000, Berlin: 12244000, London: 12965000, Arrow Glacier: 13773000, Terminal Total Difficulty: <nil>, Engine: ethash}" genesis=0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3
INFO[03-16|10:12:23.998] Disk storage enabled for ethash DAGs     dir=/mnt/Erigon/eth/mainnet/ethash-dags count=2
INFO[03-16|10:12:23.998] Initialising Ethereum protocol           network=1
INFO[03-16|10:12:23.998] Effective                                prune_flags="--prune=" snapshot_flags=
INFO[03-16|10:12:24.236] Starting private RPC server              on=0.0.0.0:9090
INFO[03-16|10:12:24.243] Started P2P networking                   version=66 self=enode://c52224f9072bae0c07c9b0464379ece6d8f647ae61dbb0fabcd12accd931c9cce6200058e5f87e160a89ce308dded0d550efc488e5403ade31272667596d8b83@127.0.0.1:30303 name=erigon/v2022.99.99-dev-10aee02e/linux-amd64/go1.16.15
INFO[03-16|10:12:24.248] [1/16 Headers] Waiting for headers...    from=14378699
INFO[03-16|10:12:24.273] Mapped network port                      proto=tcp extport=30303 intport=30303 interface=NAT-PMP(192.168.68.1)
INFO[03-16|10:12:24.293] Mapped network port                      proto=udp extport=30303 intport=30303 interface=NAT-PMP(192.168.68.1)
INFO[03-16|10:12:54.248] [1/16 Headers] Wrote block headers       number=14378699 blk/second=0.000 alloc="71.54 MiB" sys="141.46 MiB"
INFO[03-16|10:13:24.248] [1/16 Headers] Wrote block headers       number=14378699 blk/second=0.000 alloc="99.85 MiB" sys="142.05 MiB"
INFO[03-16|10:13:54.249] [1/16 Headers] Wrote block headers       number=14378699 blk/second=0.000 alloc="83.76 MiB" sys="142.61 MiB"
...

I noticed that mbox file was last modified a few days ago. It was not updated.

-rwxrwx--- 1 erigon yangye 2063731785728 Mar 14 15:02 mdbx.dat
-rwxrwx--- 1 erigon yangye       1028096 Mar 16 10:14 mdbx.lck

Steps to reproduce the behaviour

I would like to provide more information as requested. Thanks.

Backtrace

[backtrace]

leafyoung avatar Mar 16 '22 02:03 leafyoung

  1. Do you see 0 "GoodPeers" in logs? Probably not
  2. then it means - by some reason we have peers but have no incoming headers... not sure what it means... we will investigate
  3. as the hotfix you can do:
make integration
./build/bin/integration state_stages --datadir=<your_datadir> --unwind=100 --integrity.fast=false
./build/bin/integration stage_bodies --datadir=<your_datadir> --unwind=100 
./build/bin/integration stage_headers --datadir=<your_datadir> --unwind=100
# start Erigon as usually

AskAlexSharov avatar Mar 16 '22 02:03 AskAlexSharov

Same issue:

INFO[03-16|07:47:00.869] Build info                               git_branch=devel git_tag=v2022.03.01 git_commit=2785a57d1cad9581f2a76982595baad3c71c4a21
INFO[03-16|07:47:00.870] Starting Erigon on Ethereum mainnet... 
INFO[03-16|07:47:00.870] Maximum peer count                       ETH=100 total=100
INFO[03-16|07:47:00.870] Set global gas cap                       cap=50000000
INFO[03-16|07:47:00.909] Opening Database                         label=chaindata path=/home/mcs/.local/share/erigon/chaindata
INFO[03-16|07:47:00.911] Initialised chain configuration          config="{ChainID: 1 Homestead: 1150000 DAO: 1920000 DAOSupport: true EIP150: 2463000 EIP155: 2675000 EIP158: 2675000 Byzantium: 4370000 Constantinople: 7280000 Petersburg: 7280000 Istanbul: 9069000, Muir Glacier: 9200000, Berlin: 12244000, London: 12965000, Arrow Glacier: 13773000, Terminal Total Difficulty: <nil>, Engine: ethash}" genesis=0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3
INFO[03-16|07:47:00.911] Disk storage enabled for ethash DAGs     dir=/home/mcs/.local/share/erigon/ethash-dags count=2
INFO[03-16|07:47:00.911] Initialising Ethereum protocol           network=1
INFO[03-16|07:47:00.911] Effective                                prune_flags="--prune=" snapshot_flags=
INFO[03-16|07:47:01.307] Starting private RPC server              on=127.0.0.1:9090
INFO[03-16|07:47:01.310] Started P2P networking                   version=66 self=enode://12ac8f731adf2e3db95663d29d52b872573f923d066191b752f55e2e0a4680283cd5312bb56d7d2519740d3036b569458669b2a6aee9f1ffb86427bc4c15301f@127.0.0.1:30303 name=erigon/v2022.99.99-dev-2785a57d/linux-amd64/go1.18
INFO[03-16|07:47:01.318] [1/16 Headers] Waiting for headers...    from=14394401
INFO[03-16|07:47:31.318] [1/16 Headers] Wrote block headers       number=14394401 blk/second=0.000 alloc="49.93 MiB" sys="73.39 MiB"
INFO[03-16|07:48:01.319] [1/16 Headers] Wrote block headers       number=14394401 blk/second=0.000 alloc="193.89 MiB" sys="233.72 MiB"
INFO[03-16|07:48:31.319] [1/16 Headers] Wrote block headers       number=14394401 blk/second=0.000 alloc="202.50 MiB" sys="233.72 MiB"
INFO[03-16|07:49:00.912] [p2p] GoodPeers                          eth66=4
INFO[03-16|07:49:01.318] [1/16 Headers] Wrote block headers       number=14394401 blk/second=0.000 alloc="212.55 MiB" sys="237.72 MiB"
INFO[03-16|07:49:31.318] [1/16 Headers] Wrote block headers       number=14394401 blk/second=0.000 alloc="224.73 MiB" sys="249.72 MiB"
INFO[03-16|07:50:01.318] [1/16 Headers] Wrote block headers       number=14394401 blk/second=0.000 alloc="199.80 MiB" sys="261.72 MiB"
INFO[03-16|07:50:31.318] [1/16 Headers] Wrote block headers       number=14394401 blk/second=0.000 alloc="222.36 MiB" sys="261.97 MiB"
INFO[03-16|07:51:00.912] [p2p] GoodPeers                          eth66=14
INFO[03-16|07:51:01.318] [1/16 Headers] Wrote block headers       number=14394401 blk/second=0.000 alloc="211.48 MiB" sys="357.25 MiB"
INFO[03-16|07:51:31.319] [1/16 Headers] Wrote block headers       number=14394401 blk/second=0.000 alloc="267.42 MiB" sys="357.38 MiB"

ghost avatar Mar 16 '22 07:03 ghost

./build/bin/integration state_stages --datadir=~/.local/share/erigon --unwind=100 --integrity.fast=false

INFO[03-16|07:54:18.532] Re-Opening DB in exclusive mode to apply DB migrations 
INFO[03-16|07:54:18.532] database closed                          label=chaindata
INFO[03-16|07:54:18.533] Apply migration                          name=db_schema_version5
INFO[03-16|07:54:18.533] Applied migration                        name=db_schema_version5
INFO[03-16|07:54:18.533] Apply migration                          name=txs_begin_end
INFO[03-16|07:54:18.534] Applied migration                        name=txs_begin_end
INFO[03-16|07:54:18.534] Updated DB schema to                     version=6.0.0
INFO[03-16|07:54:18.534] database closed                          label=chaindata
INFO[03-16|07:54:18.704] Writing custom genesis block             hash=0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3
INFO[03-16|07:54:18.705] Initialised chain configuration          config="{ChainID: 1 Homestead: 1150000 DAO: 1920000 DAOSupport: true EIP150: 2463000 EIP155: 2675000 EIP158: 2675000 Byzantium: 4370000 Constantinople: 7280000 Petersburg: 7280000 Istanbul: 9069000, Muir Glacier: 9200000, Berlin: 12244000, London: 12965000, Arrow Glacier: 13773000, Terminal Total Difficulty: <nil>, Engine: ethash}"
INFO[03-16|07:54:18.743] database closed                          label=chaindata
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x48 pc=0x11ab91d]

goroutine 1 [running]:
github.com/ledgerwatch/erigon/turbo/snapshotsync.(*RoSnapshots).Cfg(...)
	github.com/ledgerwatch/erigon/turbo/snapshotsync/block_snapshots.go:349
github.com/ledgerwatch/erigon/cmd/integration/commands.newSync({0x231cd40, 0xc000760c40}, {0x2320220, 0xc00077dcc0}, 0xc00061fbe8)
	github.com/ledgerwatch/erigon/cmd/integration/commands/stages.go:1130 +0xb9d
github.com/ledgerwatch/erigon/cmd/integration/commands.syncBySmallSteps({0x2320220, 0xc00077dcc0}, {0x0, 0x0, 0x0, {0x0, 0x0, 0x0, 0x0, 0x0, ...}, ...}, ...)
	github.com/ledgerwatch/erigon/cmd/integration/commands/state_stages.go:150 +0xab
github.com/ledgerwatch/erigon/cmd/integration/commands.glob..func23(0x2c0bfa0?, {0x14db1b3?, 0x3?, 0x3?})
	github.com/ledgerwatch/erigon/cmd/integration/commands/state_stages.go:65 +0x208
github.com/spf13/cobra.(*Command).execute(0x2c0bfa0, {0xc000776660, 0x3, 0x3})
	github.com/spf13/[email protected]/command.go:856 +0x67c
github.com/spf13/cobra.(*Command).ExecuteC(0x2c0d3a0)
	github.com/spf13/[email protected]/command.go:974 +0x3b4
github.com/spf13/cobra.(*Command).Execute(...)
	github.com/spf13/[email protected]/command.go:902
github.com/spf13/cobra.(*Command).ExecuteContext(...)
	github.com/spf13/[email protected]/command.go:895
main.main()
	github.com/ledgerwatch/erigon/cmd/integration/main.go:15 +0x112

ghost avatar Mar 16 '22 07:03 ghost

./build/bin/integration stage_bodies --datadir=~/.local/share/erigon --unwind=100

INFO[03-16|07:56:04.385] Initialised chain configuration          config="{ChainID: 1 Homestead: 1150000 DAO: 1920000 DAOSupport: true EIP150: 2463000 EIP155: 2675000 EIP158: 2675000 Byzantium: 4370000 Constantinople: 7280000 Petersburg: 7280000 Istanbul: 9069000, Muir Glacier: 9200000, Berlin: 12244000, London: 12965000, Arrow Glacier: 13773000, Terminal Total Difficulty: <nil>, Engine: ethash}"
INFO[03-16|07:56:04.425] database closed                          label=chaindata
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x48 pc=0x11ab91d]

goroutine 1 [running]:
github.com/ledgerwatch/erigon/turbo/snapshotsync.(*RoSnapshots).Cfg(...)
	github.com/ledgerwatch/erigon/turbo/snapshotsync/block_snapshots.go:349
github.com/ledgerwatch/erigon/cmd/integration/commands.newSync({0x231cd40, 0xc000978c00}, {0x2320220, 0xc0009f3360}, 0x0)
	github.com/ledgerwatch/erigon/cmd/integration/commands/stages.go:1130 +0xb9d
github.com/ledgerwatch/erigon/cmd/integration/commands.stageBodies({0x2320220?, 0xc0009f3360}, {0x231cd40?, 0xc000978c00})
	github.com/ledgerwatch/erigon/cmd/integration/commands/stages.go:467 +0x6f
github.com/ledgerwatch/erigon/cmd/integration/commands.glob..func9(0x2c0a6a0?, {0x14db1b3?, 0x2?, 0x2?})
	github.com/ledgerwatch/erigon/cmd/integration/commands/stages.go:70 +0xd8
github.com/spf13/cobra.(*Command).execute(0x2c0a6a0, {0xc000483fc0, 0x2, 0x2})
	github.com/spf13/[email protected]/command.go:856 +0x67c
github.com/spf13/cobra.(*Command).ExecuteC(0x2c0d3a0)
	github.com/spf13/[email protected]/command.go:974 +0x3b4
github.com/spf13/cobra.(*Command).Execute(...)
	github.com/spf13/[email protected]/command.go:902
github.com/spf13/cobra.(*Command).ExecuteContext(...)
	github.com/spf13/[email protected]/command.go:895
main.main()
	github.com/ledgerwatch/erigon/cmd/integration/main.go:15 +0x112

ghost avatar Mar 16 '22 07:03 ghost

./build/bin/integration stage_headers --datadir=~/.local/share/erigon --unwind=100

EROR[03-16|07:58:10.271] Error                                    err="cannot unwind past 0"
INFO[03-16|07:58:10.271] database closed                          label=chaindata
Error: cannot unwind past 0
Usage:
  integration stage_headers [flags]

Flags:
      --bor.heimdall string      URL of Heimdall service (default "http://localhost:1317")
      --chain string             pick a chain to assume (mainnet, ropsten, etc.)
      --chaindata string         path to the db
      --database.verbosity int   Enabling internal db logs. Very high verbosity levels may require recompile db. Default: 2, means warning (default 2)
      --datadir string           data directory for temporary ELT files (default "/home/mcs/.local/share/erigon")
      --experimental.snapshot    
  -h, --help                     help for stage_headers
      --unwind uint              how much blocks unwind on each iteration

Global Flags:
      --log.json                  Format logs with JSON
      --metrics                   Enable metrics collection and reporting
      --metrics.addr string       Enable stand-alone metrics HTTP server listening interface (default "127.0.0.1")
      --metrics.expensive         Enable expensive metrics collection and reporting
      --metrics.port int          Metrics HTTP server listening port (default 6060)
      --pprof                     Enable the pprof HTTP server
      --pprof.addr string         pprof HTTP server listening interface (default "127.0.0.1")
      --pprof.cpuprofile string   Write CPU profile to the given file
      --pprof.port int            pprof HTTP server listening port (default 6060)
      --trace string              Write execution trace to the given file
      --verbosity int             Logging verbosity: 0=silent, 1=error, 2=warn, 3=info, 4=debug, 5=detail (default 3)

cannot unwind past 0

ghost avatar Mar 16 '22 08:03 ghost

Will check first error today

AskAlexSharov avatar Mar 16 '22 11:03 AskAlexSharov

Hi.

I am experiencing the same exact problem running the same version and the same symptoms and build up to the stuck indexing. I have run the commands suggested and have the same output as above apart from the second one:

INFO[03-16|18:45:22.240] Initialised chain configuration          config="{ChainID: 1 Homestead: 1150000 DAO: 1920000 DAOSupport: true EIP150: 2463000 EIP155: 2675000 EIP158: 2675000 Byzantium: 4370000 Constantinople: 7280000 Petersburg: 7280000 Istanbul: 9069000, Muir Glacier: 9200000, Berlin: 12244000, London: 12965000, Arrow Glacier: 13773000, Terminal Total Difficulty: <nil>, Engine: ethash}"
EROR[03-16|18:45:22.300] Error                                    err="cannot unwind past 0"
INFO[03-16|18:45:22.301] database closed                          label=chaindata
Error: cannot unwind past 0
Usage:
  integration stage_bodies [flags]

IanBarnesZa avatar Mar 16 '22 19:03 IanBarnesZa

First nil pointer dereference fixed by https://github.com/ledgerwatch/erigon/pull/3723

AskAlexSharov avatar Mar 17 '22 01:03 AskAlexSharov

Also, if you have list of 3 commands and first one failed - I don't advise you run second. It may lead to unexpected result.

AskAlexSharov avatar Mar 17 '22 01:03 AskAlexSharov

@IanBarnesZa show ./build/bin/integration print_stages --datadir=<your_datadir>

AskAlexSharov avatar Mar 17 '22 01:03 AskAlexSharov

./build/bin/integration state_stages --datadir=~/.local/share/erigon

INFO[03-17|03:22:02.143] Initialised chain configuration          config="{ChainID: 1 Homestead: 1150000 DAO: 1920000 DAOSupport: true EIP150: 2463000 EIP155: 2675000 EIP158: 2675000 Byzantium: 4370000 Constantinople: 7280000 Petersburg: 7280000 Istanbul: 9069000, Muir Glacier: 9200000, Berlin: 12244000, London: 12965000, Arrow Glacier: 13773000, Terminal Total Difficulty: <nil>, Engine: ethash}"
INFO[03-17|03:22:02.184] database closed                          label=chaindata

ghost avatar Mar 17 '22 03:03 ghost

./build/bin/integration state_stages --datadir=~/.local/share/erigon --unwind=100 --integrity.fast=false

INFO[03-17|03:23:52.137] Initialised chain configuration          config="{ChainID: 1 Homestead: 1150000 DAO: 1920000 DAOSupport: true EIP150: 2463000 EIP155: 2675000 EIP158: 2675000 Byzantium: 4370000 Constantinople: 7280000 Petersburg: 7280000 Istanbul: 9069000, Muir Glacier: 9200000, Berlin: 12244000, London: 12965000, Arrow Glacier: 13773000, Terminal Total Difficulty: <nil>, Engine: ethash}"
INFO[03-17|03:23:52.178] database closed                          label=chaindata

ghost avatar Mar 17 '22 03:03 ghost

./build/bin/integration stage_bodies --datadir=~/.local/share/erigon --unwind=100

INFO[03-17|03:24:05.867] Initialised chain configuration          config="{ChainID: 1 Homestead: 1150000 DAO: 1920000 DAOSupport: true EIP150: 2463000 EIP155: 2675000 EIP158: 2675000 Byzantium: 4370000 Constantinople: 7280000 Petersburg: 7280000 Istanbul: 9069000, Muir Glacier: 9200000, Berlin: 12244000, London: 12965000, Arrow Glacier: 13773000, Terminal Total Difficulty: <nil>, Engine: ethash}"
EROR[03-17|03:24:05.911] Error                                    err="cannot unwind past 0"
INFO[03-17|03:24:05.912] database closed                          label=chaindata
Error: cannot unwind past 0
Usage:
  integration stage_bodies [flags]
...

ghost avatar Mar 17 '22 03:03 ghost

@mcseemk print_stages please

AskAlexSharov avatar Mar 17 '22 03:03 AskAlexSharov

./build/bin/integration print_stages --datadir=~/.local/share/erigon

Note: prune_at doesn't mean 'all data before were deleted' - it just mean stage.Prune function were run to this block. Because 1 stage may prune multiple data types to different prune distance.

 			 stage_at 	 prune_at
Headers 		 0 		 0
BlockHashes 		 0 		 0
Bodies 			 0 		 0
Senders 		 0 		 0
Execution 		 0 		 0
Translation 		 0 		 0
HashState 		 0 		 0
IntermediateHashes 	 0 		 0
AccountHistoryIndex 	 0 		 0
StorageHistoryIndex 	 0 		 0
LogIndex 		 0 		 0
CallTraces 		 0 		 0
TxLookup 		 0 		 0
Finish 			 0 		 0
--
prune distance: --prune=

INFO[03-17|04:17:34.412] database closed                          label=chaindata

ghost avatar Mar 17 '22 04:03 ghost

@mcseemk - you have no data. or your datadir is wrong - try manually resolve ~. or nothing were synced - show erigon logs.

AskAlexSharov avatar Mar 17 '22 05:03 AskAlexSharov

The database was fully synced before upgrade from erigon 2022.02.04-beta.

The datadir is correct.

$ cd ~/.local/share/erigon/ $ pwd /home/mcs/.local/share/erigon

Erigon logs:

INFO[03-17|05:44:57.994] Build info                               git_branch=devel git_tag=v2022.03.01 git_commit=426d97235603097b1810978abf9ed9ace382e750
INFO[03-17|05:44:57.994] Starting Erigon on Ethereum mainnet... 
INFO[03-17|05:44:57.995] Maximum peer count                       ETH=100 total=100
INFO[03-17|05:44:57.995] Set global gas cap                       cap=50000000
INFO[03-17|05:44:58.034] Opening Database                         label=chaindata path=/home/mcs/.local/share/erigon/chaindata
INFO[03-17|05:44:58.035] Initialised chain configuration          config="{ChainID: 1 Homestead: 1150000 DAO: 1920000 DAOSupport: true EIP150: 2463000 EIP155: 2675000 EIP158: 2675000 Byzantium: 4370000 Constantinople: 7280000 Petersburg: 7280000 Istanbul: 9069000, Muir Glacier: 9200000, Berlin: 12244000, London: 12965000, Arrow Glacier: 13773000, Terminal Total Difficulty: <nil>, Engine: ethash}" genesis=0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3
INFO[03-17|05:44:58.035] Disk storage enabled for ethash DAGs     dir=/home/mcs/.local/share/erigon/ethash-dags count=2
INFO[03-17|05:44:58.035] Initialising Ethereum protocol           network=1
INFO[03-17|05:44:58.035] Effective                                prune_flags="--prune=" snapshot_flags=
INFO[03-17|05:44:58.429] Starting private RPC server              on=127.0.0.1:9090
INFO[03-17|05:44:58.432] Started P2P networking                   version=66 self=enode://a757aeb175240040f3ed89a37fe727f4becada434d7fc67943afb481169f7a96f73cb1d5e51bc5b58286e2fc351501e7294183d9a62527bf3ddbb5376c1af6b8@127.0.0.1:30303 name=erigon/v2022.99.99-dev-426d9723/linux-amd64/go1.18
INFO[03-17|05:44:58.440] [1/16 Headers] Waiting for headers...    from=14394401
INFO[03-17|05:45:28.440] [1/16 Headers] Wrote block headers       number=14394401 blk/second=0.000 alloc="54.17 MiB" sys="73.20 MiB"
INFO[03-17|05:45:58.440] [1/16 Headers] Wrote block headers       number=14394401 blk/second=0.000 alloc="43.86 MiB" sys="73.45 MiB"
INFO[03-17|05:46:28.440] [1/16 Headers] Wrote block headers       number=14394401 blk/second=0.000 alloc="207.60 MiB" sys="239.65 MiB"
INFO[03-17|05:46:58.035] [p2p] GoodPeers                          eth66=2
INFO[03-17|05:46:58.440] [1/16 Headers] Wrote block headers       number=14394401 blk/second=0.000 alloc="206.85 MiB" sys="239.65 MiB"
INFO[03-17|05:47:28.440] [1/16 Headers] Wrote block headers       number=14394401 blk/second=0.000 alloc="253.15 MiB" sys="277.97 MiB"
INFO[03-17|05:47:58.440] [1/16 Headers] Wrote block headers       number=14394401 blk/second=0.000 alloc="278.33 MiB" sys="307.00 MiB"
INFO[03-17|05:48:28.440] [1/16 Headers] Wrote block headers       number=14394401 blk/second=0.000 alloc="327.87 MiB" sys="361.17 MiB"
INFO[03-17|05:48:58.035] [p2p] GoodPeers                          eth66=12
INFO[03-17|05:48:58.440] [1/16 Headers] Wrote block headers       number=14394401 blk/second=0.000 alloc="258.16 MiB" sys="369.55 MiB"
INFO[03-17|05:49:28.440] [1/16 Headers] Wrote block headers       number=14394401 blk/second=0.000 alloc="312.14 MiB" sys="369.92 MiB"

ghost avatar Mar 17 '22 05:03 ghost

  1. Do you see 0 "GoodPeers" in logs? Probably not

    1. then it means - by some reason we have peers but have no incoming headers... not sure what it means... we will investigate

    2. as the hotfix you can do:

make integration
./build/bin/integration state_stages --datadir=<your_datadir> --unwind=100 --integrity.fast=false
./build/bin/integration stage_bodies --datadir=<your_datadir> --unwind=100 
./build/bin/integration stage_headers --datadir=<your_datadir> --unwind=100
# start Erigon as usually

Thanks. This fix worked partially.

  1. The unwinding of the bodies didn't work but Erigon has resumed syncing after unwinding the stages and headers.

The unwind bodies output is shown below. It was stuck with 14378699. The stages and headers unwinding had shown it went back 100 blocks earlier to 14378599.

./integration stage_bodies --datadir=/mnt/Erigon/eth/mainnet --unwind=200
INFO[03-17|15:14:45.415] Initialised chain configuration          config="{ChainID: 1 Homestead: 1150000 DAO: 1920000 DAOSupport: true EIP150: 2463000 EIP155: 2675000 EIP158: 2675000 Byzantium: 4370000 Constantinople: 7280000 Petersburg: 7280000 Istanbul: 9069000, Muir Glacier: 9200000, Berlin: 12244000, London: 12965000, Arrow Glacier: 13773000, Terminal Total Difficulty: <nil>, Engine: ethash}"
INFO[03-17|15:14:45.628] Progress                                 bodies=14378699
INFO[03-17|15:14:45.634] database closed                          label=chaindata
  1. After resuming, I got a few errors with mdb
EROR[03-17|15:34:33.173] Staged Sync                              err="[4/16 Bodies] writing block body: failed to WriteRawTransactions: bucket: BlockTransaction, mdbx_cursor_put: MDBX_EKEYMISMATCH: The given key value is mismatched to the current cursor position"
INFO[03-17|15:34:33.358] [4/16 Bodies] Processing bodies...       from=14378499 to=14402693
INFO[03-17|15:34:34.539] [p2p] GoodPeers                          eth66=8
EROR[03-17|15:34:40.532] Staged Sync                              err="[4/16 Bodies] writing block body: failed to WriteRawTransactions: bucket: BlockTransaction, mdbx_cursor_put: MDBX_EKEYMISMATCH: The given key value is mismatched to the current cursor position"
INFO[03-17|15:34:40.719] [4/16 Bodies] Processing bodies...       from=14378499 to=14402693
EROR[03-17|15:34:52.396] Staged Sync                              err="[4/16 Bodies] writing block body: failed to WriteRawTransactions: bucket: BlockTransaction, mdbx_cursor_put: MDBX_EKEYMISMATCH: The given key value is mismatched to the current cursor position"
INFO[03-17|15:34:52.576] [4/16 Bodies] Processing bodies...       from=14378499 to=14402693
EROR[03-17|15:34:59.662] Staged Sync                              err="[4/16 Bodies] writing block body: failed to WriteRawTransactions: bucket: BlockTransaction, mdbx_cursor_put: MDBX_EKEYMISMATCH: The given key value is mismatched to the current cursor position"

leafyoung avatar Mar 17 '22 07:03 leafyoung

@mcseemk "try manually resolve ~": `./build/bin/integration print_stages --datadir=/home/mcs/.local/share/erigon"

AskAlexSharov avatar Mar 17 '22 07:03 AskAlexSharov

./build/bin/integration print_stages --datadir=/home/mcs/.local/share/erigon

mdbx_setup_dxb:15225 filesize mismatch (expect 2120749670400b/517761150p, have 2121713844224b/517996544p)
Note: prune_at doesn't mean 'all data before were deleted' - it just mean stage.Prune function were run to this block. Because 1 stage may prune multiple data types to different prune distance.

 			 stage_at 	 prune_at
Headers 		 14394401 	 0
BlockHashes 		 14394401 	 0
Bodies 			 14394401 	 0
Senders 		 14394401 	 0
Execution 		 14394401 	 14394401
Translation 		 0 		 0
HashState 		 14394401 	 0
IntermediateHashes 	 14394401 	 14394401
AccountHistoryIndex 	 14394401 	 0
StorageHistoryIndex 	 14394401 	 0
LogIndex 		 14394401 	 0
CallTraces 		 14394401 	 14394401
TxLookup 		 14394401 	 0
Finish 			 14394401 	 0
--
prune distance: --prune=

INFO[03-17|08:10:37.945] database closed                          label=chaindata

ghost avatar Mar 17 '22 08:03 ghost