During the last few weeks a common, reoccurring, question seems to be how to get one's blockchain "unstuck". This guide will, hopefully, provide some assistance in doing so.
1 Answer
Note that, if you are stuck on block 1288639
(or block 1400001
) or a few blocks later, you are using a wrong, outdated, version and you should upgrade to the latest version, which can be found here. In addition, this won't require a resync from scratch, as the "new" monerod
will automatically use the blockchain that was used with the previous version and pick up syncing where it left off.
The first step in getting your blockchain unstuck is making sure that no Monero related process is running anymore. Thus, close the GUI by clicking on the x
and make sure to stop the daemon as well. If you're using the CLI, type exit
into both monero-wallet-cli
and monerod
. Thereafter, use your task manager to check whether all Monero related processes are closed. Alternatively, you could simply reboot.
Now that no Monero related processes are running anymore, delete p2pstate.bin
. On Windows it can be found in the following directory:
C:\ProgramData\bitmonero
Note that, by default, the ProgramData directory is hidden. Therefore, use the explorer to manually navigate to aforementioned directory.
On Linux and Mac OS X:
$HOME/.bitmonero
This directory is hidden by default too. On Linux you can use CTRL + H
to unhide directories (note that this might not work on all Linux distributions), whereas on Mac OS X you can use cmd-shift-dot
unhide directories.
After you've deleted p2pstate.bin
you can restart monerod
/ the GUI. If this didn't resolve your issue, please read further and make sure monerod
/ the GUI is closed again.
We're going to add the following flag:
--block-sync-size 10
This will change the batch of fetched blocks from 20 to 10.
You can add the flag as follows:
If you are using the GUI, simply add --block-sync-size 10
as daemon startup flag. You can do this on the Settings
page of the GUI. Note that you'll have to restart the GUI + daemon for the flag to take effect. Thus, add the flag, exit the GUI and stop the daemon as well, and lastly restart the GUI + daemon.
If you are using the CLI, please see below.
On Windows make sure to launch it from the command line. Go to the folder monerod is located and make sure your cursor isn't located on any of the files. Subsequently do SHIFT + right click and it will give you an option to "Open command window here". Lastly, type the following command:
monerod --block-sync-size 10
On Linux and Mac OS X you should use the terminal to launch monerod
. Note that this has to be done from the directory monerod is located in. The command is as follows:
./monerod --block-sync-size 10
If your blockchain is still stuck after adding this flag, please browse again to C:\ProgramData\bitmonero
(Windows) or $HOME/.bitmonero
(Linux and Mac OS X), open bitmonero.log
and check it for any errors. If you see any of these errors (or similar to them), your blockchain is most likely corrupted and you need to resync from scratch.
Error opening database: Failed to query m_blocks: MDB_BAD_TXN: Transaction must abort, has a child, or is invalid
Failed to parse and validate tx from blob
(per MoneroMooo: This can be a corrupt blockchain, if this comes from a block inside the db. However, it's much more likely to be an old version not knowing about a new fork)
This is done by deleting data.mdb
from C:\ProgramData\bitmonero\lmdb
(Windows) or $HOME/.bitmonero/lmdb
(Linux and Mac OS X), which will trigger the resync.
-
2Stuck user here. First, check the logs, they will tell you if there is a problem. I followed all above solutions without checking the logs first and guess what? Half of all entries in the logs says that my db was corrupted. Simply, stopping everything and deleting db solved the issue. When I started again, it started from scratch but at least it's synching again.– sercanCommented Nov 4, 2017 at 14:28
-
I hate getting up in the morning only to find out the block height hasn't moved one bit ... this worked well,
monerod
would get stuck at 144xxxx and would report 100%, deletingp2pstate.bin
got it unstuck. Commented May 10, 2018 at 16:13 -
After couple hours reading blockchain from bootstrap file stuck and I searched for
p2pstate.bin
as described here, but looks like I don't have one, so in my case I never ran monerod after the installation.. so my next step was to run./monerod
which solved the problem for me: synced to 14xxxxx block(in about an hour or so) and then SYNCRONIZATION (496390 blocks bhind)– qpaycmCommented Mar 5, 2019 at 14:18 -
@AlPo - To be clear, the sync is functioning properly now right?– dEBRUYNECommented Mar 5, 2019 at 15:52
-
@dEBRUYNE, worked for me. Don't forget to set
monerod.conf
to tell it where is yourdata-dir
located. For example if your lmdb folder located in /home/user/.bitmonero/lmdb then you should set your data-dir=/home/user/.bitmonero/ Also you can setlog-file=/home/user/monerod.log
– qpaycmCommented Mar 5, 2019 at 16:38