Skip to content
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

"Error while dialing" when using CouchDB #434

Open
fsalhab opened this issue Mar 29, 2024 · 5 comments
Open

"Error while dialing" when using CouchDB #434

fsalhab opened this issue Mar 29, 2024 · 5 comments
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@fsalhab
Copy link

fsalhab commented Mar 29, 2024

Hey, I have a network with 3 orgs and single peer that works perfectly when using LevelDb as option in the fablo-config.json file. However, when I change to CouchDb I start having this error:

============ 😻 Creating 'my-channel1' on supplier/peer0 😻 ==============
Creating channel with name: my-channel1
   Orderer: orderer0.group1.orderer.supplychain.com:7030
   CORE_PEER_LOCALMSPID: supplierMSP
   CORE_PEER_ADDRESS: peer0.supplier.supplychain.com:7041
   CORE_PEER_MSPCONFIGPATH: /var/hyperledger/cli/crypto/users/[email protected]/msp
2024-03-29 15:55:44.237 UTC 0001 INFO [channelCmd] InitCmdFactory -> Endorser and orderer connections initialized
2024-03-29 15:55:44.350 UTC 0002 INFO [cli.common] readBlock -> Received block: 0
Error: error getting endorser client for channel: endorser client failed to connect to peer0.supplier.supplychain.com:7041: failed to create new connection: connection error: desc = "transport: error while dialing: dial tcp 172.24.0.6:7041: connect: connection refused"

I found a few similar issues but the solutions didn't work for me. I'm running Linux on a VM, but I have enough RAM so this isn't the problem. Also, all containers are running. This is my docker ps -a output:

CONTAINER ID   IMAGE                              COMMAND                  CREATED         STATUS         PORTS                                                                                            NAMES
24ea940fb135   hyperledger/fabric-tools:2.5.6     "/bin/bash"              6 minutes ago   Up 6 minutes                                                                                                    cli.orderer.supplychain.com
0d4c3f6a7aba   hyperledger/fabric-ca:1.5.5        "sh -c 'fabric-ca-se…"   6 minutes ago   Up 6 minutes   0.0.0.0:7080->7054/tcp, :::7080->7054/tcp                                                        ca.retailer.supplychain.com
4b5f09b906f1   hyperledger/fabric-tools:2.5.6     "/bin/bash"              6 minutes ago   Up 6 minutes                                                                                                    cli.retailer.supplychain.com
ff44240c51da   hyperledger/fabric-tools:2.5.6     "/bin/bash"              6 minutes ago   Up 6 minutes                                                                                                    cli.distributor.supplychain.com
29b854ba5ce8   hyperledger/fabric-peer:2.5.6      "peer node start"        6 minutes ago   Up 6 minutes   7051/tcp, 0.0.0.0:7061->7061/tcp, :::7061->7061/tcp, 0.0.0.0:8061->9440/tcp, :::8061->9440/tcp   peer0.distributor.supplychain.com
baeef946931f   couchdb:3.1                        "tini -- /docker-ent…"   6 minutes ago   Up 6 minutes   4369/tcp, 9100/tcp, 0.0.0.0:5140->5984/tcp, :::5140->5984/tcp                                    couchdb.peer0.retailer.supplychain.com
50a001fd0c38   hyperledger/fabric-tools:2.5.6     "/bin/bash"              6 minutes ago   Up 6 minutes                                                                                                    cli.supplier.supplychain.com
03564565be4f   hyperledger/fabric-orderer:2.5.6   "orderer"                6 minutes ago   Up 6 minutes   0.0.0.0:7030->7030/tcp, :::7030->7030/tcp, 7050/tcp, 0.0.0.0:8030->9440/tcp, :::8030->9440/tcp   orderer0.group1.orderer.supplychain.com
400f88004d32   hyperledger/fabric-ca:1.5.5        "sh -c 'fabric-ca-se…"   6 minutes ago   Up 6 minutes   0.0.0.0:7020->7054/tcp, :::7020->7054/tcp                                                        ca.orderer.supplychain.com
402e8df45eb1   hyperledger/fabric-ca:1.5.5        "sh -c 'fabric-ca-se…"   6 minutes ago   Up 6 minutes   0.0.0.0:7060->7054/tcp, :::7060->7054/tcp                                                        ca.distributor.supplychain.com
908f8cf9a9da   couchdb:3.1                        "tini -- /docker-ent…"   6 minutes ago   Up 6 minutes   4369/tcp, 9100/tcp, 0.0.0.0:5100->5984/tcp, :::5100->5984/tcp                                    couchdb.peer0.supplier.supplychain.com
44f2ac7e4229   couchdb:3.1                        "tini -- /docker-ent…"   6 minutes ago   Up 6 minutes   4369/tcp, 9100/tcp, 0.0.0.0:5120->5984/tcp, :::5120->5984/tcp                                    couchdb.peer0.distributor.supplychain.com
874e6ad9eaa7   hyperledger/fabric-peer:2.5.6      "peer node start"        6 minutes ago   Up 6 minutes   0.0.0.0:7041->7041/tcp, :::7041->7041/tcp, 7051/tcp, 0.0.0.0:8041->9440/tcp, :::8041->9440/tcp   peer0.supplier.supplychain.com
a2c9c789ca24   hyperledger/fabric-peer:2.5.6      "peer node start"        6 minutes ago   Up 6 minutes   7051/tcp, 0.0.0.0:7081->7081/tcp, :::7081->7081/tcp, 0.0.0.0:8081->9440/tcp, :::8081->9440/tcp   peer0.retailer.supplychain.com
46b648db1a6a   hyperledger/fabric-ca:1.5.5        "sh -c 'fabric-ca-se…"   6 minutes ago   Up 6 minutes   0.0.0.0:7040->7054/tcp, :::7040->7054/tcp                                                        ca.supplier.supplychain.com

I really appreciate any help!

Edit: Sometimes it works correctly when I do fablo recreate, but it's really inconsistent. Also, most of the times I do fablo reset it fails again, so I need to fix this.

@dzikowski
Copy link
Contributor

I think that might be the case with a peer trying to connect CouchDB before it's ready. It seems we don't have depends_on section for peers in our Docker compose template: https://github.com/hyperledger-labs/fablo/blob/main/src/setup-docker/templates/fabric-docker/docker-compose.yaml

There should be something similar to:

  <%= peer.address %>:
    container_name: <%= peer.address %>
    ...
    <%_ if(peer.db.type==="CouchDb") { _%>
    depends_on:
      couchdb.<%= peer.name %>.<%= org.domain %>:
        condition: service_healthy
    <%_ } _%>
    networks:
      - basic

Would you like to contribute?

@dzikowski dzikowski added good first issue Good for newcomers bug Something isn't working labels Apr 2, 2024
@sroopsai
Copy link
Contributor

sroopsai commented Apr 6, 2024

I like to contribute to this issue. Please assign me to this issue.

@officialasishkumar
Copy link

Is this issue resolved?

@sroopsai
Copy link
Contributor

This PR #443 may close this issue.

@dzikowski
Copy link
Contributor

The fix should be available in 1.2.1-unstable.0 version of Fablo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants