hyperledger-cacti / cacti

Hyperledger Cacti is a new approach to the blockchain interoperability problem
https://wiki.hyperledger.org/display/cactus
Apache License 2.0
344 stars 286 forks source link

PoolLedgerTimeout error for cactus-example-discounted-asset-trade #2449

Closed ssxsidhu closed 1 month ago

ssxsidhu commented 1 year ago

Describe the bug

I was trying to run the cactus-example-discounted-asset-trade in the examples folder as per the readme. but i get the following error after running

pushd ../register-indy-data && sh ./script-build-docker.sh && popd &&
docker run --rm -ti -v/etc/cactus/:/etc/cactus/ --net="host" register-indy-data --force

This is supposed to be the last command to change the ledger state but instead I get this.

INFO:__main__:Getting started -> started
INFO:__main__:Open Pool Ledger: pool1
INFO:indy.libindy.native.command_executor:      src/commands/mod.rs:127 | Worker thread started
INFO:indy.libindy.native.indy.commands.pool:    src/commands/pool.rs:75 | OpenAck handle 2, pool_id 2, result Err(IndyError { inner: 

Pool timeout

Pool timeout })
WARNING:indy.libindy:_indy_loop_callback: Function returned error 
Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 192, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/indy/src/register-indy-data.py", line 671, in <module>
    run_coroutine(run)
  File "/home/indy/src/utils.py", line 52, in run_coroutine
    loop.run_until_complete(coroutine())
  File "/usr/lib/python3.8/asyncio/base_events.py", line 608, in run_until_complete
    return future.result()
  File "/home/indy/src/register-indy-data.py", line 106, in run
    pool_['handle'] = await pool.open_pool_ledger(pool_['name'], None)
  File "/usr/local/lib/python3.8/dist-packages/indy/pool.py", line 85, in open_pool_ledger
    res = await do_call('indy_open_pool_ledger',
indy.error.PoolLedgerTimeout

To Reproduce

I used the dockerless option to run the example. I also tried with the docker-compose but it was the same result.

To reproduce the error, follow the instructions to build the example and then the instructions from 'How to use' section. The error comes in step 2 of that section

Expected behavior

After running the command the user should get the following in the output:

[INFO] BusinessLogicAssetTrade - ##INFO: completed asset-trade, businessLogicID: guks32pf, tradeID: *******-001

Logs/Stack traces

These are logs of the validators which were started when building the example. Also I have included the output of the npm run start-dockerless command.

[2023-06-12T19:50:44.070] [DEBUG] connector_main[25767] - Listening on port 5040 [2023-06-12T19:52:10.934] [INFO] connector_main[25767] - Client Td0ITddJbYFIWrEyAAAB connected. [2023-06-12T19:52:10.970] [INFO] connector_main[25767] - ##add reqID: r9IS4dDf_1 [2023-06-12T19:52:10.970] [INFO] connector_main[25767] - ##[HL-BC] Invoke smart contract to transfer asset(D1) [2023-06-12T19:52:10.971] [INFO] connector_main[25767] - REQUEST [2023-06-12T19:52:10.971] [INFO] connector_main[25767] - Client ID :Td0ITddJbYFIWrEyAAAB [2023-06-12T19:52:10.975] [INFO] connector_main[25767] - Data :{"contract":{"channelName":"mychannel","contractName":"basic"},"method":{"type":"evaluateTransaction","command":"GetAllAssets"},"args":{"args":[]},"reqID":"r9IS4dDf_1"} [2023-06-12T19:52:10.975] [INFO] ServerPlugin[25767] - evaluateTransaction start [2023-06-12T19:52:10.976] [INFO] ServerPlugin[25767] - ##fablicaccess: InvokeSync start Wallet path: /etc/cactus/connector-fabric-socketio/wallet [2023-06-12T19:52:10.982] [INFO] fabricaccess[25767] - ##fabricaccess_getClientAndChannel [2023-06-12T19:52:10.982] [INFO] fabricaccess[25767] - create new fabric-client 2023-06-12T19:52:10.984Z - error: [Client.js]: Channel not found for name mychannel [2023-06-12T19:52:10.985] [INFO] fabricaccess[25767] - create new channel, name=mychannel [2023-06-12T19:52:11.151] [INFO] fabricaccess[25767] - ##fabricaccess_getSubmitter [2023-06-12T19:52:11.280] [INFO] ServerPlugin[25767] - ##fablicaccess: InvokeSync Params: type=evaluateTransaction, fcn=GetAllAssets, args0=undefined, args1=undefined, args2=undefined [2023-06-12T19:52:11.280] [DEBUG] ServerPlugin[25767] - ##InvokeSync(G1): call evaluateTransaction [2023-06-12T19:52:11.305] [INFO] ServerPlugin[25767] - ##fablicaccess: InvokeSync result: [{"ID":"asset1","color":"blue","size":5,"owner":"Tomoko","appraisedValue":300},{"ID":"asset2","color":"red","size":5,"owner":"Brad","appraisedValue":400},{"ID":"asset3","color":"green","size":10,"owner":"Jin Soo","appraisedValue":500},{"ID":"asset4","color":"yellow","size":10,"owner":"Max","appraisedValue":600},{"ID":"asset5","color":"black","size":15,"owner":"Adriana","appraisedValue":700},{"ID":"asset6","color":"white","size":15,"owner":"Michel","appraisedValue":800}]

fablicaccess: InvokeSync result: [{"ID":"asset1","color":"blue","size":5,"owner":"Tomoko","appraisedValue":300},{"ID":"asset2","color":"red","size":5,"owner":"Brad","appraisedValue":400},{"ID":"asset3","color":"green","size":10,"owner":"Jin Soo","appraisedValue":500},{"ID":"asset4","color":"yellow","size":10,"owner":"Max","appraisedValue":600},{"ID":"asset5","color":"black","size":15,"owner":"Adriana","appraisedValue":700},{"ID":"asset6","color":"white","size":15,"owner":"Michel","appraisedValue":800}]

[2023-06-12T19:52:11.305] [DEBUG] ServerPlugin[25767] - ##InvokeSync(I) [2023-06-12T19:52:11.312] [DEBUG] ServerPlugin[25767] - ##evaluateTransaction(C1c) retObj: [object Object] [2023-06-12T19:52:11.312] [INFO] connector_main[25767] - RESPONSE [2023-06-12T19:52:11.312] [INFO] connector_main[25767] - Client ID :Td0ITddJbYFIWrEyAAAB [2023-06-12T19:52:11.313] [INFO] connector_main[25767] - Response :{"resObj":{"status":200,"data":"eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJyZXN1bHQiOlt7IklEIjoiYXNzZXQxIiwiY29sb3IiOiJibHVlIiwic2l6ZSI6NSwib3duZXIiOiJUb21va28iLCJhcHByYWlzZWRWYWx1ZSI6MzAwfSx7IklEIjoiYXNzZXQyIiwiY29sb3IiOiJyZWQiLCJzaXplIjo1LCJvd25lciI6IkJyYWQiLCJhcHByYWlzZWRWYWx1ZSI6NDAwfSx7IklEIjoiYXNzZXQzIiwiY29sb3IiOiJncmVlbiIsInNpemUiOjEwLCJvd25lciI6IkppbiBTb28iLCJhcHByYWlzZWRWYWx1ZSI6NTAwfSx7IklEIjoiYXNzZXQ0IiwiY29sb3IiOiJ5ZWxsb3ciLCJzaXplIjoxMCwib3duZXIiOiJNYXgiLCJhcHByYWlzZWRWYWx1ZSI6NjAwfSx7IklEIjoiYXNzZXQ1IiwiY29sb3IiOiJibGFjayIsInNpemUiOjE1LCJvd25lciI6IkFkcmlhbmEiLCJhcHByYWlzZWRWYWx1ZSI6NzAwfSx7IklEIjoiYXNzZXQ2IiwiY29sb3IiOiJ3aGl0ZSIsInNpemUiOjE1LCJvd25lciI6Ik1pY2hlbCIsImFwcHJhaXNlZFZhbHVlIjo4MDB9XSwiaWF0IjoxNjg2NTk5NTMxLCJleHAiOjE2ODY2MDA0MzF9.01EOClkAjkAAKaZpuyHJI4g1Cr7dniDyy8AtpWZ4aO7ybI0W9tY2LaLl--6jrTpcug90HZ-XKKYPfqDeND2lWQ"},"id":"r9IS4dDf_1"}

- cactus-plugin-ledger-connector-go-ethereum-socketio

@hyperledger/cactus-plugin-ledger-connector-go-ethereum-socketio@2.0.0-alpha.1 start /home/sahilpsidhu_2001/cacti/packages/cactus-plugin-ledger-connector-go-ethereum-socketio cd ./dist && node common/core/bin/www.js

[2023-06-12T19:50:50.400] [DEBUG] connector_main[26071] - Listening on port 5050 [2023-06-12T19:52:10.713] [INFO] connector_main[26071] - Client 6ynuNl3JSyP-CZbPAAAB connected. [2023-06-12T19:52:10.741] [INFO] connector_main[26071] - ##add reqID: 84jUisrs_1

[HL-BC] Invoke smart contract to transfer asset(D1)

[2023-06-12T19:52:10.742] [INFO] connector_main[26071] - REQUEST [2023-06-12T19:52:10.743] [INFO] connector_main[26071] - Client ID :6ynuNl3JSyP-CZbPAAAB [2023-06-12T19:52:10.743] [INFO] connector_main[26071] - Data :{"contract":{},"method":{"type":"web3Eth","command":"getBalance"},"args":{"args":["0xec709e1774f0ce4aba47b52a499f9abaaa159f71"]},"reqID":"84jUisrs_1"} [2023-06-12T19:52:10.743] [DEBUG] ServerPlugin[26071] - web3Eth start [2023-06-12T19:52:10.743] [DEBUG] ServerPlugin[26071] - send_func : getBalance [2023-06-12T19:52:10.744] [DEBUG] ServerPlugin[26071] - sendArgs : ["0xec709e1774f0ce4aba47b52a499f9abaaa159f71"] [2023-06-12T19:52:10.772] [DEBUG] ServerPlugin[26071] - ##web3Eth: retObj: {"resObj":{"status":200,"data":"eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJyZXN1bHQiOiIxMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAiLCJpYXQiOjE2ODY1OTk1MzAsImV4cCI6MTY4NjYwMDQzMH0.o88dnfGtF8t5FC5PEb3ox6x_RAPwZaF2bMrYqIgtx7mGyPeJG2GxTKXkp1XrYGjy_o-jjCgRnDd6MNSuH_BUhg"},"id":"84jUisrs_1"} [2023-06-12T19:52:10.772] [INFO] connector_main[26071] - RESPONSE [2023-06-12T19:52:10.773] [INFO] connector_main[26071] - Client ID :6ynuNl3JSyP-CZbPAAAB [2023-06-12T19:52:10.773] [INFO] connector_main[26071] - Response :{"resObj":{"status":200,"data":"eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJyZXN1bHQiOiIxMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAiLCJpYXQiOjE2ODY1OTk1MzAsImV4cCI6MTY4NjYwMDQzMH0.o88dnfGtF8t5FC5PEb3ox6x_RAPwZaF2bMrYqIgtx7mGyPeJG2GxTKXkp1XrYGjy_o-jjCgRnDd6MNSuH_BUhg"},"id":"84jUisrs_1"} [2023-06-12T19:52:10.814] [INFO] connector_main[26071] - ##add reqID: 84jUisrs_2

[HL-BC] Invoke smart contract to transfer asset(D1)

[2023-06-12T19:52:10.815] [INFO] connector_main[26071] - REQUEST [2023-06-12T19:52:10.815] [INFO] connector_main[26071] - Client ID :6ynuNl3JSyP-CZbPAAAB [2023-06-12T19:52:10.815] [INFO] connector_main[26071] - Data :{"contract":{},"method":{"type":"web3Eth","command":"getBalance"},"args":{"args":["0x36e146d5afab61ab125ee671708eeb380aea05b6"]},"reqID":"84jUisrs_2"} [2023-06-12T19:52:10.816] [DEBUG] ServerPlugin[26071] - web3Eth start [2023-06-12T19:52:10.816] [DEBUG] ServerPlugin[26071] - send_func : getBalance [2023-06-12T19:52:10.816] [DEBUG] ServerPlugin[26071] - sendArgs : ["0x36e146d5afab61ab125ee671708eeb380aea05b6"] [2023-06-12T19:52:10.821] [DEBUG] ServerPlugin[26071] - ##web3Eth: retObj: {"resObj":{"status":200,"data":"eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJyZXN1bHQiOiIwIiwiaWF0IjoxNjg2NTk5NTMwLCJleHAiOjE2ODY2MDA0MzB9.Vii-ApDyNd9lSKA-T7X6fwsWXG501ykc97QVfkSrVqHGGck8l3bfezQMq5jb28fGcLuDX9OI7ou4IGi1hcgEuQ"},"id":"84jUisrs_2"} [2023-06-12T19:52:10.821] [INFO] connector_main[26071] - RESPONSE [2023-06-12T19:52:10.821] [INFO] connector_main[26071] - Client ID :6ynuNl3JSyP-CZbPAAAB [2023-06-12T19:52:10.821] [INFO] connector_main[26071] - Response :{"resObj":{"status":200,"data":"eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJyZXN1bHQiOiIwIiwiaWF0IjoxNjg2NTk5NTMwLCJleHAiOjE2ODY2MDA0MzB9.Vii-ApDyNd9lSKA-T7X6fwsWXG501ykc97QVfkSrVqHGGck8l3bfezQMq5jb28fGcLuDX9OI7ou4IGi1hcgEuQ"},"id":"84jUisrs_2"} [2023-06-12T19:52:10.839] [INFO] connector_main[26071] - ##add reqID: 84jUisrs_3

[HL-BC] Invoke smart contract to transfer asset(D1)

[2023-06-12T19:52:10.840] [INFO] connector_main[26071] - REQUEST [2023-06-12T19:52:10.840] [INFO] connector_main[26071] - Client ID :6ynuNl3JSyP-CZbPAAAB [2023-06-12T19:52:10.840] [INFO] connector_main[26071] - Data :{"contract":{},"method":{"type":"web3Eth","command":"getBalance"},"args":{"args":["0x9d624f7995e8bd70251f8265f2f9f2b49f169c55"]},"reqID":"84jUisrs_3"} [2023-06-12T19:52:10.840] [DEBUG] ServerPlugin[26071] - web3Eth start [2023-06-12T19:52:10.841] [DEBUG] ServerPlugin[26071] - send_func : getBalance [2023-06-12T19:52:10.841] [DEBUG] ServerPlugin[26071] - sendArgs : ["0x9d624f7995e8bd70251f8265f2f9f2b49f169c55"] [2023-06-12T19:52:10.852] [DEBUG] ServerPlugin[26071] - ##web3Eth: retObj: {"resObj":{"status":200,"data":"eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJyZXN1bHQiOiIwIiwiaWF0IjoxNjg2NTk5NTMwLCJleHAiOjE2ODY2MDA0MzB9.jKRph7b8SgeecrfP6470IHgGVwO9qeT9lQ9pyz6dqXjj3O9wqYKdMVS46quma112YbB6hfnBykGcvEaio5K5Ng"},"id":"84jUisrs_3"} [2023-06-12T19:52:10.852] [INFO] connector_main[26071] - RESPONSE [2023-06-12T19:52:10.852] [INFO] connector_main[26071] - Client ID :6ynuNl3JSyP-CZbPAAAB [2023-06-12T19:52:10.852] [INFO] connector_main[26071] - Response :{"resObj":{"status":200,"data":"eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJyZXN1bHQiOiIwIiwiaWF0IjoxNjg2NTk5NTMwLCJleHAiOjE2ODY2MDA0MzB9.jKRph7b8SgeecrfP6470IHgGVwO9qeT9lQ9pyz6dqXjj3O9wqYKdMVS46quma112YbB6hfnBykGcvEaio5K5Ng"},"id":"84jUisrs_3"}

- cactus_validator_socketio_indy
[cactus_validator_socketio_indy.txt](https://github.com/hyperledger/cacti/files/11727847/cactus_validator_socketio_indy.txt)

- npm run start-dockerless
[start-dockerless output.txt](https://github.com/hyperledger/cacti/files/11727853/start-dockerless.output.txt)

**Cloud provider or hardware configuration:**

I am running this on Google cloud platform as a VM instance

Image used: Canonical, Ubuntu, 20.04 LTS, amd64 focal image built on 2023-06-05, supports Shielded VM features

I also tried it on a different physical machine, same result.

Node versions tried:
v10.19
v14.16.1
v18.12.0

Npm versions tried:
6.14.12
9.5.1

**Operating system name, version, build:**

```sh
Linux 5.15.0-1035-gcp x86_64
NAME="Ubuntu"
VERSION="20.04.6 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.6 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

Additional context

I think there is some problem with indy-testnet in the tools/docker, I tried to test it, but it was not working. I got the same error while trying to test it.

petermetz commented 1 year ago

@ssxsidhu Sorry for the slow response! This package is maintained mostly by the Fujitsu crew (@takeutak @izuru0 @outSH) I'm tagging them here and hopefully they can provide an answer!

outSH commented 11 months ago

@ssxsidhu It seems there was a problem starting indy test ledger, all ledgers should be started without error by ./script-start-ledgers.sh script. Can you provide logs from ledger containers? i.e. docker ps to see if indy container is running and docker logs to check if it works correctly.

BTW PR that switches from Indy SDK to Aries should be merged soon, it changes a lot in this sample app setup, might be good to wait and retest after it's merged.

outSH commented 10 months ago

@ssxsidhu IndySDK has been replaced with Aries, can you retest and confirm that issue was solved?