-
Notifications
You must be signed in to change notification settings - Fork 205
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
Observed NPEs during contract invoke #1585
Comments
Investigation and OutcomesOS: Docker Composer (observed in K8s as well) ScenarioUser of FireFly tried to invoke a smart contract through the API deployed using Why is this Steps to ReproduceWe have a running FireFly stack at version at unreleased v1.3.0 using the CLI which is connected to a transaction manager. FireFly has at least one contract listener created. Transaction manager is unreachable by FireFly for some unknown reason, maybe due to the networking timeouts. For this scenario, we took down the EVMConnect container. We have configured FireFly to start the blockchain plugin in backgroundStart mode and with retry which means the FireFly namespace will start up correctly but the blockchain plugin will keep retrying in a background process. We then tried to invoke a Contract API with Found the cause of the issueAfter enabling debug mode in VSCode with FireFly, we were able to step through the initialisation process of FireFly setting up the plugins. In turns out there is a bug in the way the Contract Manager (responsible of handing contract listeners, etc...) is initialised. As part of the initialisation of Contract Manager, it will verify that the contract listener exist in the transaction manager and it takes a Link to creation of the Contract Manager firefly/internal/orchestrator/orchestrator.go Line 540 in dc97c73
Now FireFly retried the initialisation of the namespace by going through the same flow and starting the plugins. As part of this, it creates a new Link to where Init is called firefly/internal/orchestrator/orchestrator.go Line 602 in dc97c73
When a user calls an invoke on Contract API with Proposed FixIn the InitComponents function, when initialising the ContractManager plugin make sure not to set the |
RecreateSince this is a kind of nasty issue to try and recreate, I'll provide here the full configuration for getting this working plus the exact steps that have been followed.
*1 - Use this configuration to enable background start plugins:
blockchain:
- ethereum:
ethconnect:
retry:
enabled: true
backgroundStart:
enabled: true
topic: "0"
url: http://127.0.0.1:5102
name: blockchain0
type: ethereum
... *2 - For FireFly 1.3 use this guide, for FireFly 1.2 use this guide |
When invoking a method on a contract, we've occasionally seen FireFly get into a state where we get an NPE from the
syncasync
bridge and then no response is returned. It's not clear at the moment what causes FireFly to get into this state, but hard restarting the FireFly process seems to get it out of this state and allow invoke operations to succeed.We've seen this issue in 1.2.2 but suspect the same kind of problem might happen in 1.3.X as it's not currently fixed yet.
Stack Trace
The text was updated successfully, but these errors were encountered: