hyperledger / caliper-benchmarks

Sample benchmark files for Hyperledger Caliper https://wiki.hyperledger.org/display/caliper
https://hyperledger.github.io/caliper-benchmarks/
Apache License 2.0
113 stars 120 forks source link

Error: Failed to connect before the deadline on Endorser- name: peer0.org1.example.com, url:grpcs://localhost:7051, connected:false, connectAttempted:true #132

Open HelmiTrabelsi opened 3 years ago

HelmiTrabelsi commented 3 years ago

I am running caliper 0.4.0 with a pre-configured fabric network 2.1 and I get this error: Error: Failed to connect before the deadline on Endorser- name: peer0.org1.example.com, url:grpcs://localhost:7051, connected:false, connectAttempted:true

MUKESHBADIGINENI commented 3 years ago

I'm also facing the same issue while deploying the smart contract, please let me know if you solved it.

bellaj commented 3 years ago

@MUKESHBADIGINENI You can look into the peer0 container's log you'll probably find

[core.comm] ServerHandshake -> ERRO 077 Server TLS handshake failed in 2.193318ms with error EOF server=PeerServer remoteaddress=172.20.0.1:48646

Try first to correctly define the following parameters :

export FABRIC_CFG_PATH=/home/user/fabric-samples/config/
export CORE_PEER_TLS_ENABLED=true
export CORE_PEER_LOCALMSPID="Org1MSP"
export CORE_PEER_TLS_ROOTCERT_FILE=${PWD}/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
export CORE_PEER_MSPCONFIGPATH=${PWD}/organizations/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
export CORE_PEER_ADDRESS=localhost:7051

Therefore to solve the problem you should use the right connection profile

Jehosua97 commented 3 years ago

The problems is that you have multiple containers and they are not in the same network. Try to enter to the bash of one of the docker container and ping the node peer0.org1.example.com. if the ping fails, join the dockers in the same network and allow external connections. Here is my configuration of docker-compose.yaml in ./Explorer folder

version: "2.1"
volumes:
  data:
  walletstore:
networks:
  artifacts_test:
   external: true
services:
  explorerdb.mynetwork.com:
    image: hyperledger/explorer-db:latest
    container_name: explorerdb.mynetwork.com
    hostname: explorerdb.mynetwork.com
    environment:
      - DATABASE_DATABASE=fabricexplorer
      - DATABASE_USERNAME=hppoc
      - DATABASE_PASSWORD=password
    healthcheck:
      test: "pg_isready -h localhost -p 5432 -q -U postgres"
      interval: 30s
      timeout: 10s
      retries: 5
    volumes:
      - data:/var/lib/postgresql/data
    networks:
      - artifacts_test
  explorer.mynetwork.com:
    image: hyperledger/explorer:1.1.1
    container_name: explorer.mynetwork.com
    hostname: explorer.mynetwork.com
    environment:
      - DATABASE_HOST=explorerdb.mynetwork.com
      - DATABASE_DATABASE=fabricexplorer
      - DATABASE_USERNAME=hppoc
      - DATABASE_PASSWD=password
      - LOG_LEVEL_APP=debug
      - LOG_LEVEL_DB=debug
      - LOG_LEVEL_CONSOLE=info
      - LOG_CONSOLE_STDOUT=true
      - DISCOVERY_AS_LOCALHOST=false
    volumes:
      - ./config.json:/opt/explorer/app/platform/fabric/config.json
      - ./connection-profile:/opt/explorer/app/platform/fabric/connection-profile
      - ./examples/net1/crypto:/tmp/crypto
      - walletstore:/opt/wallet
      - ./crypto-config/:/etc/data
    command: sh -c "node /opt/explorer/main.js && tail -f /dev/null"
    ports:
      - 8080:8080
    depends_on:
      explorerdb.mynetwork.com:
        condition: service_healthy
    networks:
      - atifacts_test
sadityakumar9211 commented 10 months ago

Is this issue resolved?

sadityakumar9211 commented 10 months ago

@Jehosua97 I tried to ping and the ping is working fine. I am getting the same error. I don't know what is the exact cause of this. I would love your help in figuring this out.