Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Unhandled rejection while syncing #6550

Closed
ishantiw opened this issue Jul 2, 2021 · 1 comment
Closed

Unhandled rejection while syncing #6550

ishantiw opened this issue Jul 2, 2021 · 1 comment
Assignees
Milestone

Comments

@ishantiw
Copy link
Contributor

ishantiw commented Jul 2, 2021

Expected behavior

Unhandled rejections should be handled

Actual behavior

Sameers-MBP:~ sameer$ lisk-core start --network testnet --api-ws --api-ws-port=4000 --enable-forger-plugin --overwrite-config --log=info -d ~/testnet
Starting Lisk Core at /Users/sameer/testnet.
Genesis block from "testnet" does not exists.
Downloading genesis block from https://downloads.lisk.io/lisk/testnet/genesis_block.json.tar.gz
Downloaded to path: /Users/sameer/testnet/config/testnet/genesis_block.json.tar.gz.
Verified checksum: 690ed7d6990c4b7705fbdc4a90e20e3508db9facd2b38f8606e90a0be30c946c.
Extracting genesis block file.
Removing downloaded genesis block
Download completed.
   /Users/sameer/testnet/config/testnet/genesis_block.json
09:51:14 INFO lisk-framework: Starting the app - testnet (module=lisk:app)
09:51:14 INFO lisk-framework: If you experience any type of error, please open an issue on Lisk GitHub: https://github.com/LiskHQ/lisk-sdk/issues (module=lisk:app)
09:51:14 INFO lisk-framework: Contribution guidelines can be found at Lisk-sdk: https://github.com/LiskHQ/lisk-sdk/blob/development/docs/CONTRIBUTING.md (module=lisk:app)
09:51:14 INFO lisk-framework: Booting the application with Lisk Framework(3.0.0-rc.2) (module=lisk:app)
09:51:14 INFO lisk-framework: Initializing controller (module=lisk:app)
09:51:14 INFO lisk-framework: Loading controller (module=lisk:app)
09:51:14 INFO lisk-framework: Event * was subscribed but not registered to the bus yet. (module=lisk:app)
09:51:16 INFO lisk-framework: Websocket Server Ready (module=lisk:app)
09:51:18 INFO lisk-framework: New block added to the chain (module=lisk:app)
{
 "id": "913c05af34a7f1cc40be1e388ca4878fa7b34026a9514b4f299b3d42a6f82b54",
 "height": 14075260,
 "numberOfTransactions": 0
} 
09:51:19 INFO lisk-framework: Blockchain ready (module=lisk:app)
09:51:19 INFO lisk-framework: Node ready and launched (module=lisk:app)
09:51:19 INFO @liskhq/lisk-framework-forger-plugin: Loading child-process plugin (module=lisk:app)
{
 "version": "0.1.6",
 "alias": "forger"
} 
09:51:19 INFO lisk-framework: Event forger:loading:finished was subscribed but not registered to the bus yet. (module=lisk:app)
09:51:19 INFO @liskhq/lisk-framework-forger-plugin: Loaded child-process plugin (module=lisk:app)
{
 "version": "0.1.6",
 "alias": "forger"
} 
(node:73995) UnhandledPromiseRejectionWarning: Error: Specified key blocks:height:00d6c57b does not exist
    at parseError (/Users/sameer/.nvm/versions/node/v12.20.1/lib/node_modules/lisk-core/node_modules/lisk-framework/dist-node/controller/bus.js:20:12)
    at Bus.invoke (/Users/sameer/.nvm/versions/node/v12.20.1/lib/node_modules/lisk-core/node_modules/lisk-framework/dist-node/controller/bus.js:125:23)
(node:73995) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:73995) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
09:51:46 INFO lisk-framework: Loading transactions from the network (module=lisk:app)
09:51:53 INFO lisk-framework: Starting synchronizer (module=lisk:app)
{
 "blockId": "d6bf5622915e9a849983c09fff169554d8d1dd031b0a1f08f5c55e1bfbee31a4",
 "height": 14076295
} 
09:51:53 INFO lisk-framework: Triggering: BlockSynchronizationMechanism (module=lisk:app)
09:51:57 INFO lisk-framework: Applying penalty to peer and restarting synchronizer (module=lisk:app)
{
 "peerId": "94.237.92.196:7001",
 "reason": "No common block has been found between the chain and the targeted peer"
} 
09:51:57 INFO lisk-framework: Synchronization finished. (module=lisk:app)
{
 "lastBlockHeight": 14075260,
 "lastBlockID": "913c05af34a7f1cc40be1e388ca4878fa7b34026a9514b4f299b3d42a6f82b54",
 "mechanism": "BlockSynchronizationMechanism"
} 
09:52:00 INFO lisk-framework: Starting synchronizer (module=lisk:app)
{
 "blockId": "f590aea1c3ad14efa7eb3d0e34371f48ccfaf6f467db8cf060dd46dd34be2643",
 "height": 14076296
} 
09:52:00 INFO lisk-framework: Triggering: BlockSynchronizationMechanism (module=lisk:app)
09:52:03 INFO lisk-framework: New block added to the chain (module=lisk:app)
{
 "id": "30421c066ed3304f6eb647bee5b3df92998d06adc5dffa027c5429ba944f8f3d",
 "height": 14075261,
 "numberOfTransactions": 4
} 
09:52:03 INFO lisk-framework: New block added to the chain (module=lisk:app)
{
 "id": "d962cbe6b6744d52920be0f683c4732b224b9a24c1a723bfda3a2fd71f1386d9",
 "height": 14075262,
 "numberOfTransactions": 0
} 
10:09
10:00:50 INFO lisk-framework: New block added to the chain (module=lisk:app)
{
 "id": "38cdb1f86763c51cfe6c2a8d2e3600e00137b7cd54cbbc7828e8e98f397edbe2",
 "height": 14076328,
 "numberOfTransactions": 0
} 
10:00:50 INFO lisk-framework: Synchronization finished. (module=lisk:app)
{
 "lastBlockHeight": 14076328,
 "lastBlockID": "38cdb1f86763c51cfe6c2a8d2e3600e00137b7cd54cbbc7828e8e98f397edbe2",
 "mechanism": "BlockSynchronizationMechanism"
} 
10:01:01 INFO lisk-framework: New block added to the chain (module=lisk:app)
{
 "id": "68e9040e5fe7c93e7878c7eec6c67afdc192a10725d6618f97733feacda3e17a",
 "height": 14076329,
 "numberOfTransactions": 0
} 
(node:74180) UnhandledPromiseRejectionWarning: Error: Specified key blocks:height:00d6c57b does not exist
    at parseError (/Users/sameer/.nvm/versions/node/v12.20.1/lib/node_modules/lisk-core/node_modules/lisk-framework/dist-node/controller/bus.js:20:12)
    at Bus.invoke (/Users/sameer/.nvm/versions/node/v12.20.1/lib/node_modules/lisk-core/node_modules/lisk-framework/dist-node/controller/bus.js:125:23)
(node:74180) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:74180) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
10:01:33 INFO lisk-framework: New block added to the chain (module=lisk:app)
{
 "id": "bba989d2b5a81715c04cfa14c539d886303e2f7428212d44244190d8bfb81a4a",
 "height": 14076330,
 "numberOfTransactions": 0
} 
10:02:03 INFO lisk-framework: New block added to the chain (module=lisk:app)
{
 "id": "4f4b7ff4ced78f2ff9ef10aade5b673f3ce09b67a5b2395c6fd40d1235d66dde",
 "height": 14076331,
 "numberOfTransactions": 0
} 
10:04:04 INFO lisk-framework: New block added to the chain (module=lisk:app)
{
 "id": "92b63f5eeb2f5ac9dfc438f3923633759e3689f22124e272f53db853b311e218",
 "height": 14076332,
 "numberOfTransactions": 0
} 
10:04:29 INFO lisk-framework: Added transaction to pool (module=lisk:app)
{
 "id": "5ef3dac7dc13ee4fa6148476ed11abe020841ba7b9f0b524bb5bc5ac536f4eb2",
 "nonce": "1",
 "senderPublicKey": "ed6a9cf7d71a92a5af5d8f74185515547edfb03129b0653a4036c36ac1e0b456"
} 
10:04:43 INFO lisk-framework: New block added to the chain (module=lisk:app)
{
 "id": "dc3746d1c3d473d5303d8c54f13804b0c243e237e353656f3f3ed988679cf2f3",
 "height": 14076333,
 "numberOfTransactions": 1
} 

Steps to reproduce

Happens rarely while syncing

Which version(s) does this affect? (Environment, OS, etc...)

5.0.6

@ishantiw
Copy link
Contributor Author

In general, we have to handle errors whenever we are calling any action on the application, this issue is probably generated because an action was invoked and error was not handled. When we are calling an action using client then it doesn't crash the node instead it shows error in the client side. Bu in case, we are calling an action within the framework then we should always make sure we handle the errors.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants