9

The daemon worked until a few days ago. Now when I start it up it shuts down with this message:

2017-11-27 21:25:56.989 3056    INFO    logging contrib/epee/src/mlog.cpp:148   New log categories: *:WARNING,net:FATAL,net.p2p:FATAL,net.cn:FATAL,global:INFO,verify:FATAL,stacktrace:INFO,logging:INFO,msgwriter:INFO
2017-11-27 21:25:57.013 3056    INFO    global  src/daemon/main.cpp:279 Monero 'Helium Hydra' (v0.11.0.0-release)
2017-11-27 21:25:57.015 3056    INFO    global  src/daemon/protocol.h:55    Initializing cryptonote protocol...
2017-11-27 21:25:57.015 3056    INFO    global  src/daemon/protocol.h:60    Cryptonote protocol initialized OK
2017-11-27 21:25:57.021 3056    INFO    global  src/daemon/p2p.h:63 Initializing p2p server...
2017-11-27 21:26:00.317 3056    INFO    global  src/daemon/p2p.h:68 P2p server initialized OK
2017-11-27 21:26:00.332 3056    INFO    global  src/daemon/rpc.h:58 Initializing core rpc server...
2017-11-27 21:26:00.359 3056    INFO    global  contrib/epee/include/net/http_server_impl_base.h:70 Binding on 127.0.0.1:18081
2017-11-27 21:26:00.360 3056    INFO    global  src/daemon/rpc.h:63 Core rpc server initialized OK on port: 18081
2017-11-27 21:26:00.360 3056    INFO    global  src/daemon/core.h:73    Initializing core...
2017-11-27 21:26:00.362 3056    INFO    global  src/cryptonote_core/cryptonote_core.cpp:323 Loading blockchain from folder C:\ProgramData\bitmonero\lmdb ...
2017-11-27 21:26:00.492 3056    WARN    blockchain.db.lmdb  src/blockchain_db/lmdb/db_lmdb.cpp:72   Failed to query m_blocks: MDB_BAD_TXN: Transaction must abort, has a child, or is invalid
2017-11-27 21:26:00.498 3056    ERROR   cn  src/cryptonote_core/cryptonote_core.cpp:399 Error opening database: Failed to query m_blocks: MDB_BAD_TXN: Transaction must abort, has a child, or is invalid
2017-11-27 21:26:00.498 3056    INFO    global  src/daemon/rpc.h:90 Deinitializing rpc server...
2017-11-27 21:26:00.498 3056    INFO    global  src/daemon/p2p.h:90 Deinitializing p2p...
2017-11-27 21:26:00.503 3056    INFO    global  src/daemon/core.h:89    Deinitializing core...
2017-11-27 21:26:00.507 3056    ERROR   daemon  src/daemon/core.h:94    Failed to deinitialize core...
2017-11-27 21:26:00.507 3056    INFO    global  src/daemon/protocol.h:77    Stopping cryptonote protocol...
2017-11-27 21:26:00.507 3056    INFO    global  src/daemon/protocol.h:81    Cryptonote protocol stopped successfully

Is my database corrupted and do I need to start from scratch? If so is there a source from which I can download it faster?
Many thanks for any help with this.

1
  • Did your machine/OS crash before it started doing this ? It looks like your blockchain is corrupted.
    – user36303
    Commented Nov 27, 2017 at 23:17

1 Answer 1

9

2017-11-27 21:26:00.492 3056 WARN blockchain.db.lmdb src/blockchain_db/lmdb/db_lmdb.cpp:72 Failed to query m_blocks: MDB_BAD_TXN: Transaction must abort, has a child, or is invalid

This indicates that your blockchain is corrupted. You can first try to fix this as follows:

Windows

  1. Browse to the directory monerod.exe is located.

  2. Open a new command prompt. This is done by first making sure your cursor isn't located on any of the files and subsequently doing SHIFT + right click. It will give you an option to "Open command window here". If you're using Windows 10, it'll likely give you an option to open the Powershell.

  3. Now type monerod.exe --db-salvage

  4. If you're using the Powershell, type .\monerod.exe --db-salvage

  5. If that doesn't work, type ./monerod.exe --db-salvage

  6. If that doesn't work you, unfortunately, have to resync from scratch. This is done by deleting data.mdb from C:\ProgramData\bitmonero\lmdb, which will trigger the resync.

  7. Note that C:\ProgramData\bitmonero\lmdb is a hidden directory. Thus, you have to manually use the explorer to navigate to it.

Linux and Mac OS X:

  1. Browse to the directory monerod is located.

  2. Open a new terminal.

  3. Now type ./monerod --db-salvage

  4. If that doesn't work you, unfortunately, have to resync from scratch. This is done by deleting data.mdb from ~/.bitmonero, which will trigger the resync.

  5. Note that ~/.bitmonero is, by default, a hidden directory. On Mac OS X you can typically use cmd+shift+. to unhide directories, whereas on Linux you can typically use ctrl+H to unhide directories.


Lastly, as a general piece of advice, if you need to shut down your PC, first shut down monerod gracefully by typing exit (if you're using the CLI) or click on the x (right top) if you're using the GUI. Otherwise, you might corrupt the blockchain again and you'd have to start all over again.

Not the answer you're looking for? Browse other questions tagged or ask your own question.