6

Can anyone help me fixing below error. I'm trying to install chaincode on peer via cli. I configured cli container correctly. But somehow Im getting this error..

grpc: addrConn.createTransport failed to connect to {peer0.org1.example.com:7051 0 <nil>}. Err :connection error: desc = “transport: Error while dialing dial tcp: lookup peer0.org1.example.com on 127.0.0.11:53: connection refused

Here is my docker-compose-cli.yaml

ajay
  • 328
  • 1
  • 5
  • 17

2 Answers2

0

You can run into odd DNS resolution issues depending on the configuration of DNS on your host system. The easiest thing to try is to add the dns_search config value to your Compose file:

cli:
    container_name: cli
    image: hyperledger/fabric-tools:$IMAGE_TAG
    tty: true
    stdin_open: true
    dns_search: .

See https://stackoverflow.com/a/45916717/6160507 as well ... you might need this for all of your services.

Gari Singh
  • 11,418
  • 2
  • 18
  • 41
  • I am also get same issue with k8s cluster, @Gari Singh do you have any solution for that? I have tried above solution however its give error as dns search not allow – Abhirock Jan 16 '20 at 12:22
  • 1
    I try with IP address (localhost and 0.0.0.0 and container IP) but the same error occurs, I think it does not depend on DNS @Gari Singh. – Hashem Jahangiri Feb 02 '20 at 08:38
-1

solution 1 : use the command: sudo echo "nameserver 8.8.8.8" and start once again

Solution 2 : check your container logs and see

use the command "docker logs container-id"

Solution 3 :add "dns_serach: ." in docker-compose.yaml file and start once again as below

** dns_search: . **