Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Catch error when _lifecycle chaincode is not running preventing Synchronizer to shutdown #451

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

daanporon
Copy link

What this PR does / why we need it:

Right now when you set up an empty network that just contains a peer and an orderer and you install an explorer on it it will crash the Synchronizer because it cannot find any chaincodes.

If it doesn't find any chaincodes it will fallback to the _lifecycle chaincode and if that is not installed it will crash because the peer will answer with Peer XXXXX is not running chaincode _lifecycle. If then later on blocks are being added or chaincode is installed it won't pick this up.

This is the error that it throws

2023-09-11T15:39:05.991Z - error: [SingleQueryHandler]: evaluate: message=Query failed. Errors: ["Error: Peer fab2p1-3041 is not running chaincode _lifecycle"], stack=FabricError: Query failed. Errors: ["Error: Peer fab2p1-3041 is not running chaincode │
│     at SingleQueryHandler.evaluate (/opt/explorer/node_modules/fabric-network/lib/impl/query/singlequeryhandler.js:66:23)                                                                                                                                    │
│     at processTicksAndRejections (internal/process/task_queues.js:97:5)                                                                                                                                                                                      │
│     at async Transaction.evaluate (/opt/explorer/node_modules/fabric-network/lib/transaction.js:319:25), name=FabricError                                                                                                                                    │
│ [2023-09-11T15:39:05.992] [ERROR] Sync - <<<<<<<<<<<<<<<<<<<<<<<<<< Synchronizer Error >>>>>>>>>>>>>>>>>>>>>                                                                                                                                                 │
│ [2023-09-11T15:39:05.992] [ERROR] Sync - Error [FabricError]: Query failed. Errors: ["Error: Peer fab2p1-3041 is not running chaincode _lifecycle"]                                                                                                          │
│     at SingleQueryHandler.evaluate (/opt/explorer/node_modules/fabric-network/lib/impl/query/singlequeryhandler.js:66:23)                                                                                                                                    │
│     at processTicksAndRejections (internal/process/task_queues.js:97:5)                                                                                                                                                                                      │
│     at async Transaction.evaluate (/opt/explorer/node_modules/fabric-network/lib/transaction.js:319:25)                                                                                                                                                      │
│ [2023-09-11T15:39:05.992] [INFO] Sync - <<<<<<<<<<<<<<<<<<<<<<<<<< Closing client processor >>>>>>>>>>>>>>>>>>>>> 

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?


Additional documentation, usage docs, etc.:


Signed-off-by: Daan Poron <[email protected]>
(cherry picked from commit 90df492)
@daanporon daanporon requested a review from a team as a code owner September 12, 2023 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant