The following CLI command:
$ bitcoin-cli getblockcount
Gives the following error message:
error code: -28 error message: Activating best chain...
Any idea what is
error code: -28?
Bitcoin Stack Exchange is a question and answer site for Bitcoin crypto-currency enthusiasts. It only takes a minute to sign up.Sign up to join this community
Error -28 is defined as
RPC_IN_WARMUP, see https://github.com/bitcoin/bitcoin/blob/master/src/rpc/protocol.h.
bitcoind server has just started and is still processing its stored blockchain data to figure out what it has. It can take several minutes.
Activating best chain is one stage of this, where the daemon looks at the blocks it knows so far and determines which fork is the best chain. So it cannot yet tell you the number of blocks (in the best chain), because it doesn't yet know what the best chain is.
If you try the call again in a few minutes, it should succeed.
This would be normal if you just started your bitcoind service and it is still verifying downloaded blocks.
It can be a result that bitcoind did not had time enough to write changes to disk last time it was used or that it downloaded blocks but didn't prozess them jet.
Just let bitcoind run a bit longer and try the command again.
Here is a similar answer that goes a bit into more detail: What does "Activating Best Chain" mean?