Block creation fails returning "Unable to create a new block" error

The architecture of EON blockchain is node-centric. Nodes (or peers) perform a variety of tasks including the validation of transactions which earns rewards for their owners. To start one needs to deploy an EON node (also called a masternode) progressing through the steps described in Deploying an EON node.

Once the node has been deployed, it may encounter errors, which may disrupt the process of generating blocks. One of the errors is Unable to create a new block error entry that can be found in docker logs

To create a log file execute the following 2 commands:

Click here to expand...

1. Find a container, from which to extract a log:

docker ps [OPTIONS]

where 'Options':
-a, --all Show all containers (default shows just running)
-f, --filter filter Filter output based on conditions provided
--format string Pretty-print containers using a Go template
--help Print usage
-n, --last int Show n last created containers (includes all states) (default -1)
-l, --latest Show the latest created container (includes all states)
--no-trunc Don't truncate output
-q, --quiet Only display numeric IDs
-s, --size Display total file sizes

2. Execute a log from the container to a file log.txt:

docker logs [OPTIONS] CONTAINER > log.txt

where 'Options':
--details Show extra details provided to logs
-f, --follow Follow log output
--help Print usage
--since string Show logs since timestamp
--tail string Number of lines to show from the end of the logs (default "all")
-t, --timestamps Show timestamps

'Container' is the container found in step 1.

This article describes possible causes and the solutions to this issue.

Cause 1. Blockchain is not synced

The first task a node is performing once deployed is to download the blockchain history. The Unable to create a new block error may indicate that the masternode has not downloaded the full history of previous blocks yet. Here is an example of the warning message:

15:57:41.093 [pool-1-thread-1] WARN com.exscudo.peer.core.importer.tasks.GenerateBlockTask - Unable to create new block.
15:57:41.304 [pool-1-thread-5] INFO com.exscudo.peer.core.env.tasks.PeerConnect Task - The node is connected. "104.238.???.7:9443".
15:57:41.547 [pool-1-thread-11] INFO com.exscudo.peer.core.importer.tasks.SyncSnapshotTask - Snapshot exist, disabling task...
15:57:41.551 [pool-1-thread-11] ERROR com.exscudo.peer.core.importer.tasks.SyncSnapshotTask - Unexpected error has occurred: Disabling SyncSnapshotTask
java.lang.RuntimeException: Disabling SyncSnapshotTask


This error message is usually surrounded by notifications of Block pushing and Block pushed (see below) indicating the blockchain is still being downloaded:

SyncBlockListTask - Block pushing... [21281] EON-B-2LEPL-FXVN5-ET7ZP (tx: 0)-> EON-B-N REPL-FT5Y4-?????
15:57:44.133 [pool-1-thread-10] WARN com.exscudo.peer.core.importer.tasks.GenerateBlockTask - Unable to create new block.
15:57:44.240 [pool-1-thread-2] INFO com.exscudo.peer.core.importer.tasks.SyncBlockListTask - Block pushed: [21281] EON-B-NREPL-FT5Y4-????? CD: 1701135378219
15:57:44.240 [pool-1-thread-2] INFO

Resolution


The synchronization process must be completed. This is indicated by a group of log entries starting with Begining synchronization and ending with The chain of the blocks is synchronized with ... <any peer="" in="" the="" network=""></any>.

SyncBlockListTask - Begining synchronization. Difficulty: [this] 1701134755535, [104.2 38.???.7:9443] 2011821976736.
15:57:43.175 [pool-1-thread-2] INFO com.exscudo.peer.core.importer.tasks.SyncBlockListTask - ShortSyncScheme
15:57:43.450 [pool-1-thread-2] INFO com.exscudo.peer.core.importer.tasks.SyncBlockListTask - LongSyncScheme
15:57:44.084 [pool-1-thread-2] WARN com.exscudo.peer.core.importer.tasks.SyncBlockListTask - Target difficulty 1701193978764 in EON-B-ACGPL-FPDBW-?????

Cause 2. Insufficient funds

To generate blocks and earn rewards, a node must be associated with a corresponding EON ID holding the minimum of 25,000 EONs deposited to it. The amount below 25,000 EON on the node may be another reason for the blocks not being generated. You can check if the required minimum of 25,000 EON is deposited on an associated account by downloading EON desktop client (see Connecting to EON Blockchain Mainnet (Linux) for details) and executing the following command (an example below is from a Windows-based client):

eon.exe state (if EON client is configured locally, that is a seed has been added to config.json file )

or

eon.exe state -r <eon id=""> (for any EON ID)</eon>


Resolution

If this is the case here, to deposit the minimum of EON 25,000 required to participate in block creation, you need to make sure the sum is available on the balance of the account associated with the node (the seed for it was used to deploy the node). Once done, execute one of the following commands:

eon deposit -a 25000

or

eon -s SEED deposit -a 25000

(the latter is used when a seed has not been added to config.json file)

If successful, the account's deposit will be increased by 25,000 EON, allowing the node to generate blocks and earn rewards.

Make sure the deposit is idle (i.e. no deposits or withdrawals are to be made on it) for 24 hours prior to launching the node.
Otherwise, this may lead to additional errors. The error message in logs will contain the 'Invalid Generator' entries in this case.