hyperledger-archives / avalon

Hyperledger Avalon enables privacy in blockchain transactions, moving intensive processing from a main blockchain to improve scalability and latency, and to support attested Oracles
https://wiki.hyperledger.org/display/avalon/Hyperledger+Avalon
Apache License 2.0
136 stars 93 forks source link

Avalon fabric ssl handshake failed #442

Closed TaibiaoGuo closed 3 years ago

TaibiaoGuo commented 4 years ago

Reproduce

Up minifabric network cd $avalon_dir sudo /home/ubuntu/.local/bin/minifab up -i 1.4.4

Up Avalon Fabric sudo docker-compose -f docker-compose-fabric.yaml up --build

Call Avalon docker exec -it avalon-shell bash cd examples/apps/generic_client/ ./fabric_generic_client.py -b fabric --workload_id "echo-result" --in_data "Hello"


More Informations

Avalon Version 1f84bfc7e413505732aa0eb11cc76ddec1c5fcd4

OS Informations

$ uname -a
Linux dc01 4.15.0-91-generic #92-Ubuntu SMP Fri Feb 28 11:09:48 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

minifabric Up logs

ubuntu@dc01:~/avalon$ sudo /home/ubuntu/.local/bin/minifab up -i 1.4.4 
Minifab Execution Context:
    FABRIC_RELEASE=1.4.4
    CHANNEL_NAME=mychannel
    PEER_DATABASE_TYPE=golevel
    CHAINCODE_LANGUAGE=go
    CHAINCODE_NAME=simple
    CHAINCODE_VERSION=1.0
    CHAINCODE_PARAMETERS="init","a","200","b","300"
    CHAINCODE_PRIVATE=false
    CHAINCODE_POLICY=
    TRANSIENT_DATA=
    BLOCK_NUMBER=newest
    EXPOSE_ENDPOINTS=false
    CURRENT_ORG=org0.example.com
    HOST_ADDRESSES=172.20.46.136
    WORKING_DIRECTORY: /home/ubuntu/avalon
# Fabric Network **************************************************************************************
  * minifab                                                                             
    setting up
............................................................

# STATS ***********************************************************************************************
minifab: ok=65  failed=0
...
# Fabric operations ***********************************************************************************
  * minifab                                                                             
    channel create, channel join, anchor update, profile generation, cc install, cc instantiate, discover
.............................................................................................................................................................

# STATS ***********************************************************************************************
minifab: ok=178 failed=0
Running Nodes:
dev-peer2.org0.example.com-simple-1.0:
cli:
ca1.org1.example.com:7054/tcp
ca1.org0.example.com:7054/tcp
orderer3.example.com:7050/tcp
orderer2.example.com:7050/tcp
orderer1.example.com:7050/tcp
peer2.org1.example.com:
peer1.org1.example.com:
peer2.org0.example.com:
peer1.org0.example.com:
minifab:

real    5m20.072s
user    1m42.661s
sys     0m31.098s

Avalon Error Informations

root@0d42f9ce0ed0:/project/avalon# cd examples/apps/generic_client/
root@0d42f9ce0ed0:/project/avalon/examples/apps/generic_client# ./fabric_generic_client.py -b fabric --workload_id "echo-result" --in_data "Hello"
[10:44:01 INFO    __main__] ******* Hyperledger Avalon Generic client *******
[10:44:01 INFO    root] Org name choose: org0.example.com
Init client with profile=/project/avalon/sdk/avalon_sdk/connector/blockchains/fabric/network.json
[10:44:01 DEBUG   hfc.fabric.client] Init client with profile=/project/avalon/sdk/avalon_sdk/connector/blockchains/fabric/network.json
create org with name=example.com
[10:44:01 DEBUG   hfc.fabric.client] create org with name=example.com
create org with name=org0.example.com
[10:44:01 DEBUG   hfc.fabric.client] create org with name=org0.example.com
create org with name=org1.example.com
[10:44:01 DEBUG   hfc.fabric.client] create org with name=org1.example.com
create ca with name=ca1.org0.example.com
[10:44:01 DEBUG   hfc.fabric.client] create ca with name=ca1.org0.example.com
create ca with name=ca1.org1.example.com
[10:44:01 DEBUG   hfc.fabric.client] create ca with name=ca1.org1.example.com
Import orderers = dict_keys(['orderer1.example.com', 'orderer2.example.com', 'orderer3.example.com'])
[10:44:01 DEBUG   hfc.fabric.client] Import orderers = dict_keys(['orderer1.example.com', 'orderer2.example.com', 'orderer3.example.com'])
Import peers = dict_keys(['peer1.org0.example.com', 'peer2.org0.example.com', 'peer1.org1.example.com', 'peer2.org1.example.com'])
[10:44:01 DEBUG   hfc.fabric.client] Import peers = dict_keys(['peer1.org0.example.com', 'peer2.org0.example.com', 'peer1.org1.example.com', 'peer2.org1.example.com'])
New channel with name = mychannel
[10:44:01 DEBUG   hfc.fabric.client] New channel with name = mychannel
[10:44:01 INFO    hfc.fabric.channel.channel] DISCOVERY: adding channel peers query
[10:44:01 INFO    hfc.fabric.channel.channel] DISCOVERY: adding config query
E0505 10:44:01.514951561      59 ssl_transport_security.cc:1379] Handshake failed with fatal error SSL_ERROR_SSL: error:1000007d:SSL routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED.
[10:44:01 WARNING STDERR] Traceback (most recent call last):
[10:44:01 WARNING STDERR]   File "./fabric_generic_client.py", line 621, in <module>
[10:44:01 WARNING STDERR] Main()
[10:44:01 WARNING STDERR]   File "./fabric_generic_client.py", line 508, in Main
[10:44:01 WARNING STDERR] blockchain, config)
[10:44:01 WARNING STDERR]   File "./fabric_generic_client.py", line 333, in create_worker_registry_instance
[10:44:01 WARNING STDERR] return FabricWorkerRegistryImpl(config)
[10:44:01 WARNING STDERR]   File "/usr/local/lib/python3.6/dist-packages/avalon_sdk/connector/blockchains/fabric/fabric_worker_registry.py", line 52, in __init__
[10:44:01 WARNING STDERR] self.__fabric_wrapper = FabricWrapper(config)
[10:44:01 WARNING STDERR]   File "/usr/local/lib/python3.6/dist-packages/avalon_sdk/connector/blockchains/fabric/fabric_wrapper.py", line 61, in __init__
[10:44:01 WARNING STDERR] self.__peername, 'Admin')
[10:44:01 WARNING STDERR]   File "/usr/local/lib/python3.6/dist-packages/avalon_sdk/connector/blockchains/fabric/base.py", line 75, in __init__
[10:44:01 WARNING STDERR] self._user, peer, self._channel_name))
[10:44:01 WARNING STDERR]   File "/usr/lib/python3.6/asyncio/base_events.py", line 484, in run_until_complete
[10:44:01 WARNING STDERR] return future.result()
[10:44:01 WARNING STDERR]   File "/usr/local/lib/python3.6/dist-packages/hfc/fabric/client.py", line 175, in init_with_discovery
[10:44:01 WARNING STDERR] local=False)
[10:44:01 WARNING STDERR]   File "/usr/local/lib/python3.6/dist-packages/aiogrpc/channel.py", line 40, in __call__
[10:44:01 WARNING STDERR] return await fut
[10:44:01 WARNING STDERR] grpc._channel
[10:44:01 WARNING STDERR] .
[10:44:01 WARNING STDERR] _MultiThreadedRendezvous
[10:44:01 WARNING STDERR] :
[10:44:01 WARNING STDERR] <_MultiThreadedRendezvous of RPC that terminated with:
[10:44:01 WARNING STDERR]       status = StatusCode.UNAVAILABLE
[10:44:01 WARNING STDERR]       details = "failed to connect to all addresses"
[10:44:01 WARNING STDERR]       debug_error_string = "{"created":"@1588675441.515290099","description":"Failed to pick subchannel","file":"src/core/ext/filters/client_channel/client_channel.cc","file_line":3981,"referenced_errors":[{"created":"@1588675441.515279834","description":"failed to connect to all addresses","file":"src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc","file_line":394,"grpc_status":14}]}"
[10:44:01 WARNING STDERR] >
avalon-blockchain-connector    | 2020-05-05 10:42:57,827 - DEBUG - Import orderers = dict_keys(['orderer1.example.com', 'orderer2.example.com', 'orderer3.example.com'])
avalon-blockchain-connector    | Import peers = dict_keys(['peer1.org0.example.com', 'peer2.org0.example.com', 'peer1.org1.example.com', 'peer2.org1.example.com'])
avalon-blockchain-connector    | 2020-05-05 10:42:57,831 - DEBUG - Import peers = dict_keys(['peer1.org0.example.com', 'peer2.org0.example.com', 'peer1.org1.example.com', 'peer2.org1.example.com'])
avalon-blockchain-connector    | New channel with name = mychannel
avalon-blockchain-connector    | 2020-05-05 10:42:57,833 - DEBUG - New channel with name = mychannel
avalon-blockchain-connector    | 2020-05-05 10:42:57,834 - INFO - DISCOVERY: adding channel peers query
avalon-blockchain-connector    | 2020-05-05 10:42:57,834 - INFO - DISCOVERY: adding config query
avalon-blockchain-connector    | E0505 10:42:57.840321291      50 ssl_transport_security.cc:1379] Handshake failed with fatal error SSL_ERROR_SSL: error:1000007d:SSL routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED.
avalon-blockchain-connector    | Traceback (most recent call last):
avalon-blockchain-connector    |   File "/usr/local/bin/avalon_blockchain_connector", line 7, in <module>
avalon-blockchain-connector    |     from avalon_blockchain_connector.connector_service import main
avalon-blockchain-connector    |   File "/usr/local/lib/python3.6/dist-packages/avalon_blockchain_connector/connector_service.py", line 114, in <module>
avalon-blockchain-connector    |     main()
avalon-blockchain-connector    |   File "/usr/local/lib/python3.6/dist-packages/avalon_blockchain_connector/connector_service.py", line 104, in main
avalon-blockchain-connector    |     fabric_connector_svc = FabricConnector(uri)
avalon-blockchain-connector    |   File "/usr/local/lib/python3.6/dist-packages/avalon_blockchain_connector/fabric/fabric_connector.py", line 61, in __init__
avalon-blockchain-connector    |     self.__fabric_worker = FabricWorkerRegistryImpl(self.__config)
avalon-blockchain-connector    |   File "/usr/local/lib/python3.6/dist-packages/avalon_sdk/connector/blockchains/fabric/fabric_worker_registry.py", line 52, in __init__
avalon-blockchain-connector    |     self.__fabric_wrapper = FabricWrapper(config)
avalon-blockchain-connector    |   File "/usr/local/lib/python3.6/dist-packages/avalon_sdk/connector/blockchains/fabric/fabric_wrapper.py", line 61, in __init__
avalon-blockchain-connector    |     self.__peername, 'Admin')
avalon-blockchain-connector    |   File "/usr/local/lib/python3.6/dist-packages/avalon_sdk/connector/blockchains/fabric/base.py", line 75, in __init__
avalon-blockchain-connector    |     self._user, peer, self._channel_name))
avalon-blockchain-connector    |   File "/usr/lib/python3.6/asyncio/base_events.py", line 484, in run_until_complete
avalon-blockchain-connector    |     return future.result()
avalon-blockchain-connector    |   File "/usr/local/lib/python3.6/dist-packages/hfc/fabric/client.py", line 177, in init_with_discovery
avalon-blockchain-connector    |     local=False)
avalon-blockchain-connector    |   File "/usr/local/lib/python3.6/dist-packages/aiogrpc/channel.py", line 40, in __call__
avalon-blockchain-connector    |     return await fut
avalon-blockchain-connector    | grpc._channel._MultiThreadedRendezvous: <_MultiThreadedRendezvous of RPC that terminated with:
avalon-blockchain-connector    |        status = StatusCode.UNAVAILABLE
avalon-blockchain-connector    |        details = "failed to connect to all addresses"
avalon-blockchain-connector    |        debug_error_string = "{"created":"@1588675377.840694607","description":"Failed to pick subchannel","file":"src/core/ext/filters/client_channel/client_channel.cc","file_line":3981,"referenced_errors":[{"created":"@1588675377.840682527","description":"failed to connect to all addresses","file":"src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc","file_line":394,"grpc_status":14}]}"
pankajgoyal2 commented 4 years ago

Please refer to https://github.com/hyperledger/avalon/blob/master/docs/TestingFabricProxyModel.rst for how to setup and run fabric proxy model with Avalon. Please make sure to set proxy settings if your machine is behind proxy.