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

Latest version fails to save last block on shutdown #1361

Closed
samlavery opened this issue Jun 30, 2015 · 4 comments
Closed

Latest version fails to save last block on shutdown #1361

samlavery opened this issue Jun 30, 2015 · 4 comments

Comments

@samlavery
Copy link

A single ctrl-c to a happily running node results in the db being corrupted. Any attempt to start any version of geth again results in this:

I0629 21:09:17.132215 18805 backend.go:291] Protocol Version: 60, Network Id: 0
I0629 21:09:17.132273 18805 backend.go:301] Blockchain DB Version: 3
F0629 21:09:17.135264 18805 chain_manager.go:240] Fatal. LastBlock not found. Please run removedb and resync

Not a disk space issue at all.

@obscuren
Copy link
Contributor

Please provide previous full logs. I somehow doubt you only pressed ctrl-c once.

@0xc1c4da
Copy link
Contributor

0xc1c4da commented Jul 2, 2015

I got the same problem

I0630 16:40:23.259122    7390 ethash.go:230] Still generating DAG: 91%
I0630 16:40:31.309031    7390 ethash.go:230] Still generating DAG: 92%
I0630 16:40:40.043224    7390 ethash.go:230] Still generating DAG: 93%
I0630 16:40:48.400996    7390 ethash.go:230] Still generating DAG: 94%
I0630 16:40:57.671441    7390 ethash.go:230] Still generating DAG: 95%
I0630 16:41:06.602453    7390 ethash.go:230] Still generating DAG: 96%
I0630 16:41:14.907732    7390 ethash.go:230] Still generating DAG: 97%
I0630 16:41:23.383988    7390 ethash.go:230] Still generating DAG: 98%
I0630 16:41:31.582855    7390 ethash.go:230] Still generating DAG: 99%
I0630 16:41:39.996997    7390 ethash.go:230] Still generating DAG: 100%
I0630 16:41:39.999533    7390 ethash.go:219] Done generating DAG for epoch 25, it took 14m24.171367069s
I0630 23:55:05.094062    7390 worker.go:252] 🔨  Mined block (#742508 / 1c6d4d99). Wait 5 blocks for confirmation
I0630 23:55:05.147163    7390 worker.go:442] commit new work on block 742509 with 1 txs & 0 uncles. Took 52.951958ms
I0701 02:41:40.097491    7390 backend.go:620] checking DAG (ethash dir: /root/.ethash)
I0701 12:41:40.199056    7390 backend.go:620] checking DAG (ethash dir: /root/.ethash)
I0701 13:56:36.255867    7390 worker.go:252] 🔨  Mined block (#742509 / 22f635ac). Wait 5 blocks for confirmation
I0701 13:56:36.276032    7390 worker.go:442] commit new work on block 742510 with 2 txs & 0 uncles. Took 19.978971ms
I0701 15:33:56.364511    7390 worker.go:252] 🔨  Mined block (#742510 / 61851b9d). Wait 5 blocks for confirmation
I0701 15:33:56.497109    7390 worker.go:442] commit new work on block 742511 with 0 txs & 0 uncles. Took 132.526518ms
I0701 17:43:54.125440    7390 worker.go:252] 🔨  Mined block (#742511 / 5ed4d45b). Wait 5 blocks for confirmation
I0701 17:43:54.187224    7390 worker.go:442] commit new work on block 742512 with 0 txs & 0 uncles. Took 61.691898ms
I0701 22:41:40.227748    7390 backend.go:620] checking DAG (ethash dir: /root/.ethash)
I0701 23:12:57.989606    7390 worker.go:252] 🔨  Mined block (#742512 / 712120e2). Wait 5 blocks for confirmation
I0701 23:12:58.008809    7390 worker.go:442] commit new work on block 742513 with 0 txs & 0 uncles. Took 19.006468ms
I0702 07:01:25.463311    7390 chain_manager.go:723] imported 1 block(s) (0 queued 0 ignored) including 12 txs in 212.804705ms. #742508 [b6eb882a / b6eb882a]
I0702 07:01:25.663082    7390 chain_manager.go:723] imported 2 block(s) (0 queued 0 ignored) including 3 txs in 27.019573ms. #742510 [dbd6e4ef / dc4e724d]
I0702 07:01:26.035063    7390 downloader.go:224] Synchronisation failed: block downloading canceled (requested)
I0702 07:02:38.243750    7390 downloader.go:224] Synchronisation failed: block downloading canceled (requested)
I0702 07:04:22.041942    7390 downloader.go:224] Synchronisation failed: block downloading canceled (requested)
I0702 07:04:51.254246    7390 downloader.go:224] Synchronisation failed: block downloading canceled (requested)
I0702 07:05:56.523350    7390 downloader.go:224] Synchronisation failed: block downloading canceled (requested)
I0702 07:06:26.179978    7390 downloader.go:224] Synchronisation failed: block downloading canceled (requested)
I0702 07:08:57.247224    7390 downloader.go:224] Synchronisation failed: block downloading canceled (requested)
I0702 07:09:27.197301    7390 downloader.go:224] Synchronisation failed: block downloading canceled (requested)
I0702 07:10:07.371585    7390 downloader.go:224] Synchronisation failed: block downloading canceled (requested)
I0702 07:11:15.195895    7390 downloader.go:224] Synchronisation failed: block downloading canceled (requested)
I0702 07:28:18.159476    7390 downloader.go:224] Synchronisation failed: block downloading canceled (requested)
I0702 07:29:57.402975    7390 downloader.go:224] Synchronisation failed: block downloading canceled (requested)
I0702 07:30:38.459644    7390 downloader.go:224] Synchronisation failed: block downloading canceled (requested)
I0702 07:30:58.508044    7390 downloader.go:224] Synchronisation failed: block downloading canceled (requested)
I0702 07:31:37.213363    7390 downloader.go:224] Synchronisation failed: block downloading canceled (requested)
I0702 07:32:48.307393    7390 downloader.go:224] Synchronisation failed: block downloading canceled (requested)
I0702 07:33:18.152768    7390 downloader.go:224] Synchronisation failed: block downloading canceled (requested)
I0702 07:33:47.532787    7390 downloader.go:224] Synchronisation failed: block downloading canceled (requested)
I0702 07:34:18.905639    7390 downloader.go:224] Synchronisation failed: block downloading canceled (requested)
I0702 07:41:59.124744    7390 downloader.go:224] Synchronisation failed: block downloading canceled (requested)
I0702 07:45:17.325419    7390 downloader.go:224] Synchronisation failed: block downloading canceled (requested)
I0702 08:28:37.733159    7390 downloader.go:224] Synchronisation failed: block downloading canceled (requested)
I0702 08:29:06.444048    7390 downloader.go:224] Synchronisation failed: block downloading canceled (requested)
I0702 08:29:39.819762    7390 downloader.go:224] Synchronisation failed: block downloading canceled (requested)
I0702 08:30:19.732476    7390 downloader.go:224] Synchronisation failed: block downloading canceled (requested)
I0702 08:30:47.343900    7390 downloader.go:224] Synchronisation failed: block downloading canceled (requested)
I0702 08:31:19.434447    7390 downloader.go:224] Synchronisation failed: block downloading canceled (requested)
I0702 08:32:31.926606    7390 downloader.go:224] Synchronisation failed: block downloading canceled (requested)
I0702 08:32:58.764714    7390 downloader.go:224] Synchronisation failed: block downloading canceled (requested)
I0702 08:37:42.087385    7390 downloader.go:224] Synchronisation failed: block downloading canceled (requested)
I0702 08:41:40.267407    7390 backend.go:620] checking DAG (ethash dir: /root/.ethash)
I0702 08:44:32.771175    7390 downloader.go:224] Synchronisation failed: block downloading canceled (requested)
I0702 08:45:10.568906    7390 downloader.go:224] Synchronisation failed: block downloading canceled (requested)
I0702 08:48:41.126996    7390 downloader.go:224] Synchronisation failed: block downloading canceled (requested)
I0702 08:50:10.735122    7390 downloader.go:224] Synchronisation failed: block downloading canceled (requested)
I0702 08:50:40.427730    7390 downloader.go:224] Synchronisation failed: block downloading canceled (requested)
I0702 08:51:09.032957    7390 downloader.go:224] Synchronisation failed: block downloading canceled (requested)
I0702 08:51:40.961278    7390 downloader.go:224] Synchronisation failed: block downloading canceled (requested)
I0702 08:52:20.503467    7390 downloader.go:224] Synchronisation failed: block downloading canceled (requested)
I0702 08:52:50.772957    7390 downloader.go:224] Synchronisation failed: block downloading canceled (requested)
I0702 08:53:22.357080    7390 downloader.go:224] Synchronisation failed: block downloading canceled (requested)
I0702 08:53:58.385453    7390 downloader.go:224] Synchronisation failed: block downloading canceled (requested)
I0702 08:55:00.118857    7390 downloader.go:224] Synchronisation failed: block downloading canceled (requested)
I0702 08:58:08.193093    7390 downloader.go:224] Synchronisation failed: block downloading canceled (requested)
I0702 08:58:41.973061    7390 downloader.go:224] Synchronisation failed: block downloading canceled (requested)
^C
I0702 10:15:27.749388    7390 chain_manager.go:502] Chain manager stopped
I0702 10:15:27.749426    7390 handler.go:141] Stopping ethereum protocol handler...
I0702 10:15:27.749447    7390 handler.go:151] Ethereum protocol handler stopped
I0702 10:15:27.749463    7390 transaction_pool.go:122] TX Pool stopped
I0702 10:15:27.749946    7390 backend.go:667] Automatic pregeneration of ethash DAG OFF (ethash dir: /root/.ethash)
I0702 10:15:27.841431    7390 database.go:118] flushed and closed db: /eth/blockchain
I0702 10:15:27.842133    7390 database.go:118] flushed and closed db: /eth/state
I0702 10:15:27.842361    7390 database.go:118] flushed and closed db: /eth/extra
[root@localhost go-ethereum]# git pull; make geth
remote: Counting objects: 252, done.
remote: Compressing objects: 100% (37/37), done.
remote: Total 252 (delta 163), reused 150 (delta 150), pack-reused 65
Receiving objects: 100% (252/252), 103.11 KiB | 0 bytes/s, done.
Resolving deltas: 100% (182/182), completed with 55 local objects.
From https://github.com/ethereum/go-ethereum
   b047f05..9f6016e  develop    -> origin/develop
   7625b07..a2ce7b9  master     -> origin/master
 * [new tag]         v0.9.34-1  -> v0.9.34-1
Merge made by the 'recursive' strategy.
 cmd/evm/main.go                   |   6 +--
 cmd/geth/main.go                  |  49 ++++++++++++++++++++++-
 cmd/utils/flags.go                |   6 ---
 core/block_processor.go           |  15 ++++---
 core/canary.go                    |   8 ++--
 core/chain_makers.go              |   2 +-
 core/chain_manager.go             | 186 +++++++++++++++++++++++++-------------------------------------------------------------
 core/chain_manager_test.go        |   3 +-
 core/chain_util.go                |  98 ++++++++++++++++++++++++++++++++++++++++++++++
 core/state_transition.go          |   6 ---
 core/transaction_pool.go          |  79 ++++++++++++++++++++++++-------------
 core/transaction_pool_test.go     |   2 +
 core/types/block.go               |   2 +-
 core/types/block_test.go          |   2 +-
 core/vm/environment.go            |   2 +-
 core/vm/vm.go                     |   2 +-
 core/vm_env.go                    |   2 +-
 eth/backend.go                    |  62 ++++++++++++++++-------------
 eth/downloader/downloader.go      | 417 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------
 eth/downloader/downloader_test.go | 293 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----------------------------
 eth/downloader/peer.go            |  26 +++++++-----
 eth/downloader/queue.go           |  28 +++++++------
 eth/handler.go                    | 188 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------
 eth/metrics.go                    |  28 +++++++++++++
 eth/peer.go                       | 178 +++++++++++++++++++++++++++++++++++++++++++++++-----------------------------------
 eth/protocol.go                   |  38 +++++++++++++++---
 eth/protocol_test.go              |  10 ++---
 eth/sync.go                       |  10 +----
 miner/worker.go                   |   8 ++--
 rpc/api/api_test.go               |   5 ++-
 rpc/api/eth.go                    |  58 ++++++++++++++++++++++++---
 rpc/api/eth_args.go               | 178 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 rpc/api/eth_js.go                 |  15 +++++++
 rpc/api/mergedapi.go              |   2 +-
 rpc/api/txpool.go                 |   5 ++-
 rpc/api/utils.go                  |   4 +-
 tests/util.go                     |   6 +--
 xeth/types.go                     |   5 ++-
 xeth/xeth.go                      |   9 ++++-
 39 files changed, 1526 insertions(+), 517 deletions(-)
 create mode 100644 core/chain_util.go
 create mode 100644 eth/metrics.go
build/env.sh go install -v -ldflags '-X main.gitCommit a821f76b3f157fab49da41ba680e11947160c4bc' ./cmd/geth
github.com/ethereum/go-ethereum/core/types
github.com/ethereum/go-ethereum/core/vm
github.com/ethereum/go-ethereum/pow
github.com/ethereum/ethash
github.com/ethereum/go-ethereum/core
github.com/ethereum/go-ethereum/eth/downloader
ithub.com/ethereum/go-ethereum/event/filter                                                                                                                                                                                       [4/1865]
github.com/ethereum/go-ethereum/whisper
github.com/ethereum/go-ethereum/miner
github.com/ethereum/go-ethereum/eth
github.com/ethereum/go-ethereum/xeth
github.com/ethereum/go-ethereum/tests
github.com/ethereum/go-ethereum/rpc/api
github.com/ethereum/go-ethereum/common/natspec
github.com/ethereum/go-ethereum/cmd/utils
github.com/ethereum/go-ethereum/cmd/geth
Done building.
Run "build/bin/geth" to launch geth.
[root@localhost go-ethereum]# /root/go-ethereum/build/bin/geth --datadir /eth/ --mine --identity="HopeNode" --rpc --rpcaddr "127.0.0.1" --rpcport "8545" console
I0702 10:17:01.242700   19366 backend.go:304] Protocol Versions: [61 60], Network Id: 0
I0702 10:17:01.242891   19366 backend.go:314] Blockchain DB Version: 3
I0702 10:17:01.246650   19366 chain_manager.go:218] LastBlock (712120e212da55d730151b8f191f629d9e79787f4d72808de1b3fda95ed33a96) not found. Recovering...
F0702 10:17:01.246719   19366 chain_manager.go:222] Recover failed. Please report
[root@localhost go-ethereum]# /root/go-ethereum/build/bin/geth --datadir /eth/ --mine --identity="HopeNode" --rpc --rpcaddr "127.0.0.1" --rpcport "8545" console
I0702 10:17:06.753958   19377 backend.go:304] Protocol Versions: [61 60], Network Id: 0
I0702 10:17:06.754148   19377 backend.go:314] Blockchain DB Version: 3
I0702 10:17:06.757228   19377 chain_manager.go:218] LastBlock (712120e212da55d730151b8f191f629d9e79787f4d72808de1b3fda95ed33a96) not found. Recovering...
F0702 10:17:06.757277   19377 chain_manager.go:222] Recover failed. Please report
[root@localhost go-ethereum]# /root/go-ethereum/build/bin/geth --datadir /eth/ --mine --identity="HopeNode" --rpc --rpcaddr "127.0.0.1" --rpcport "8545" console
I0702 10:18:05.085580   19432 backend.go:304] Protocol Versions: [61 60], Network Id: 0
I0702 10:18:05.085805   19432 backend.go:314] Blockchain DB Version: 3
I0702 10:18:05.089143   19432 chain_manager.go:218] LastBlock (712120e212da55d730151b8f191f629d9e79787f4d72808de1b3fda95ed33a96) not found. Recovering...
F0702 10:18:05.089186   19432 chain_manager.go:222] Recover failed. Please report
[root@localhost go-ethereum]# /root/go-ethereum/build/bin/geth --datadir /eth/ --mine --identity="HopeNode" --rpc --rpcaddr "127.0.0.1" --rpcport "8545" console^C
[root@localhost go-ethereum]# git pull; make geth^C
[root@localhost go-ethereum]# /root/go-ethereum/build/bin/geth
I0702 10:24:29.026607   19669 backend.go:304] Protocol Versions: [61 60], Network Id: 0
I0702 10:24:29.026765   19669 backend.go:314] Blockchain DB Version: 3
I0702 10:24:29.029691   19669 chain_manager.go:232] Last block (#0) fd4af92a79c7fc2fd8bf0d342f2e832e1d4f485c85b9152d2039e03bc604fdca TD=131072
I0702 10:24:29.036528   19669 cmd.go:148] Starting Geth/v0.9.35-a821f76b/linux/go1.4.2
I0702 10:24:29.036710   19669 server.go:294] Starting Server
I0702 10:24:31.121424   19669 udp.go:189] Listening, enode://28cbdf88b5f8a74cb71538015776c218e7e8ee2f66ede3544934108e6370b4e41665cf32a6ce456c6e9a100deab27bf1d248d57dde7611c4e222646eb11cb1b0@[::]:30303
I0702 10:24:31.121962   19669 backend.go:528] Server started
I0702 10:24:31.121995   19669 server.go:531] Listening on [::]:30303
I0702 10:24:31.122649   19669 ipc_unix.go:60] IPC service started (/root/.ethereum/geth.ipc)
^CI0702 10:24:31.216703   19669 cmd.go:60] Shutting down (interrupt) ...
I0702 10:24:31.217039   19669 chain_manager.go:455] Chain manager stopped
I0702 10:24:31.217314   19669 handler.go:147] Stopping ethereum protocol handler...
I0702 10:24:31.217388   19669 handler.go:157] Ethereum protocol handler stopped
I0702 10:24:31.217409   19669 transaction_pool.go:122] TX Pool stopped
I0702 10:24:31.217439   19669 backend.go:669] Automatic pregeneration of ethash DAG OFF (ethash dir: /root/.ethash)
I0702 10:24:31.217756   19669 database.go:118] flushed and closed db: /root/.ethereum/blockchain
I0702 10:24:31.217906   19669 database.go:118] flushed and closed db: /root/.ethereum/state
I0702 10:24:31.218051   19669 database.go:118] flushed and closed db: /root/.ethereum/extra
[root@localhost go-ethereum]# /root/go-ethereum/build/bin/geth --datadir /eth/ --mine --identity="HopeNode" --rpc --rpcaddr "127.0.0.1" --rpcport "8545" console
I0702 10:24:34.727497   19681 backend.go:304] Protocol Versions: [61 60], Network Id: 0
I0702 10:24:34.727666   19681 backend.go:314] Blockchain DB Version: 3
I0702 10:24:34.730744   19681 chain_manager.go:218] LastBlock (712120e212da55d730151b8f191f629d9e79787f4d72808de1b3fda95ed33a96) not found. Recovering...
F0702 10:24:34.730784   19681 chain_manager.go:222] Recover failed. Please report
[root@localhost go-ethereum]# /root/go-ethereum/build/bin/geth --datadir /eth/ --mine --identity="HopeNode" --rpc --rpcaddr "127.0.0.1" --rpcport "8545" upgradedb
I0702 10:26:48.856064   19776 chaincmd.go:121] Upgrading blockchain database
I0702 10:26:49.166280   19776 chain_manager.go:218] LastBlock (712120e212da55d730151b8f191f629d9e79787f4d72808de1b3fda95ed33a96) not found. Recovering...
F0702 10:26:49.166343   19776 chain_manager.go:222] Recover failed. Please report

@0xc1c4da
Copy link
Contributor

0xc1c4da commented Jul 6, 2015

is there no way to recover from this?

@obscuren
Copy link
Contributor

obscuren commented Jul 6, 2015

Make absolute sure you're on the latest develop. You can use geth recover hash_or_#number

maoueh pushed a commit to streamingfast/go-ethereum that referenced this issue Apr 10, 2023
* add ip ratelimit

* update

* update

* update explorer adddress

* updae recapcha

* remove binance

* cmd/faucet: fix conn to wrapped wsconn

* cmd/faucet: keystore updated to save and load one same addres once

* clean: remove btcd v0.20.1-beta and avoid to ambiguous import (#1)

* ci: fix truffle test (ethereum#1384)

---------

Co-authored-by: fudongbai <296179868@qq.com>
Co-authored-by: Nathan <galaxystroller@gmail.com>
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

No branches or pull requests

3 participants