peer node unjoin fails when couchdb is present


Brett Tiller
 

 

Using the fabric sample test-network I start the network and create a channel using the defaults i.e ‘network up createChannel’.  I’ve written a script that sucessfully unjoins a peer from the channel using command ‘peer node unjoin’ which it does by doing a ‘docker inspect’ on the container to be removed and reading in the Env and Bind data to build the command line. See Figure-1 below.   However, when I start the network and include CouchDB i.e. ‘./network.sh up createChannel -s couchdb’, I see an error connecting to the database when I try to unjoin the peer.  See Figure -2.  The connection to CouchDB is failing as it appears to me that the url is incorrect and should be using the localhost?  I’m guessing that the couch connection url is taken from the Env data that contains "CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb0:5984".  Perhaps there’s another environment variable that needs to be set to log into the host and the mapped port which is what I use to access CouchDB via the browser?

 

 

                                                                                                                                                                Figure -1 Success

 

Figure -2 Failure to Connect to CouchDB

 

Thanks,

 

Brett Tiller

Sr. Software Engineer

984-349-4239 (mobile)

btiller@...

 

https://www.linkedin.com/company/securboration

 


Sam Venzi
 

Hello Brett,

If this script is being run outside a Docker container, the env variable must point to localhost. You’re currently setting it as couchdb0 which I imagine is the container name, which becomes accessible in a peer container via the Docker network shared amongst them. 

As far as I recall, CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS is the only env you need to change.

Hope it helps. 

Best,

Samuel Venzi
CTO @ GoLedger


On 19 Aug 2022 12:56 -0300, Brett Tiller <btiller@...>, wrote:

 

Using the fabric sample test-network I start the network and create a channel using the defaults i.e ‘network up createChannel’.  I’ve written a script that sucessfully unjoins a peer from the channel using command ‘peer node unjoin’ which it does by doing a ‘docker inspect’ on the container to be removed and reading in the Env and Bind data to build the command line. See Figure-1 below.   However, when I start the network and include CouchDB i.e. ‘./network.sh up createChannel -s couchdb’, I see an error connecting to the database when I try to unjoin the peer.  See Figure -2.  The connection to CouchDB is failing as it appears to me that the url is incorrect and should be using the localhost?  I’m guessing that the couch connection url is taken from the Env data that contains "CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb0:5984".  Perhaps there’s another environment variable that needs to be set to log into the host and the mapped port which is what I use to access CouchDB via the browser?

 

 

<image002.png>

                                                                                                                                                                Figure -1 Success

 

<image003.png>

Figure -2 Failure to Connect to CouchDB

 

Thanks,

 

Brett Tiller

Sr. Software Engineer

984-349-4239 (mobile)

btiller@...

 

<image001.png>

https://www.linkedin.com/company/securboration

 


Brett Tiller
 

Thanks Samuel.  I made the change to the CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS environment variable, but unfortunately the connection is still failing.

 

 

 

Brett Tiller

Sr. Software Engineer

984-349-4239 (mobile)

btiller@...

 

https://www.linkedin.com/company/securboration

 

From: Samuel Venzi <samuel.venzi@...>
Sent: Friday, August 19, 2022 12:07 PM
To: fabric@...; Brett Tiller <btiller@...>
Subject: Re: [Hyperledger Fabric] peer node unjoin fails when couchdb is present

 

Hello Brett,

If this script is being run outside a Docker container, the env variable must point to localhost. You’re currently setting it as couchdb0 which I imagine is the container name, which becomes accessible in a peer container via the Docker network shared amongst them. 

As far as I recall, CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS is the only env you need to change.

Hope it helps. 

Best,

 

Samuel Venzi

CTO @ GoLedger

 

 

On 19 Aug 2022 12:56 -0300, Brett Tiller <btiller@...>, wrote:

 

Using the fabric sample test-network I start the network and create a channel using the defaults i.e ‘network up createChannel’.  I’ve written a script that sucessfully unjoins a peer from the channel using command ‘peer node unjoin’ which it does by doing a ‘docker inspect’ on the container to be removed and reading in the Env and Bind data to build the command line. See Figure-1 below.   However, when I start the network and include CouchDB i.e. ‘./network.sh up createChannel -s couchdb’, I see an error connecting to the database when I try to unjoin the peer.  See Figure -2.  The connection to CouchDB is failing as it appears to me that the url is incorrect and should be using the localhost?  I’m guessing that the couch connection url is taken from the Env data that contains "CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb0:5984".  Perhaps there’s another environment variable that needs to be set to log into the host and the mapped port which is what I use to access CouchDB via the browser?

 

 

<image002.png>

                                                                                                                                                                Figure -1 Success

 

<image003.png>

Figure -2 Failure to Connect to CouchDB

 

Thanks,

 

Brett Tiller

Sr. Software Engineer

984-349-4239 (mobile)

btiller@...

 

<image001.png>

https://www.linkedin.com/company/securboration

 

Message Sender is EXTERNAL to Securboration. Carefully examine this message before you open any links or attachments.


Sam Venzi
 

Okay. The error seems to have changed, which is good news. First you had a timeout error, because the request tried to find an internet server with domain couchdb0, but received no answer. Now the error is “connection refused” which might indicate the localhost:5984 is not accessible or is down. 

You could try to reach it some other way to check if it’s available. Unfortunately, you might have to debug it manually.

Again, hope it helps. 
(I’ll try my best to answer subsequent issues you might encounter)

Best,

Samuel Venzi
CTO @ GoLedger


On 19 Aug 2022 16:07 -0300, Brett Tiller <btiller@...>, wrote:

Thanks Samuel.  I made the change to the CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS environment variable, but unfortunately the connection is still failing.

 

<image002.png>

 

 

Brett Tiller

Sr. Software Engineer

984-349-4239 (mobile)

btiller@...

 

<image001.png>

https://www.linkedin.com/company/securboration

 

From: Samuel Venzi <samuel.venzi@...>
Sent: Friday, August 19, 2022 12:07 PM
To: fabric@...; Brett Tiller <btiller@...>
Subject: Re: [Hyperledger Fabric] peer node unjoin fails when couchdb is present

 

Hello Brett,

If this script is being run outside a Docker container, the env variable must point to localhost. You’re currently setting it as couchdb0 which I imagine is the container name, which becomes accessible in a peer container via the Docker network shared amongst them. 

As far as I recall, CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS is the only env you need to change.

Hope it helps. 

Best,

 

Samuel Venzi

CTO @ GoLedger

 

 

On 19 Aug 2022 12:56 -0300, Brett Tiller <btiller@...>, wrote:

 

Using the fabric sample test-network I start the network and create a channel using the defaults i.e ‘network up createChannel’.  I’ve written a script that sucessfully unjoins a peer from the channel using command ‘peer node unjoin’ which it does by doing a ‘docker inspect’ on the container to be removed and reading in the Env and Bind data to build the command line. See Figure-1 below.   However, when I start the network and include CouchDB i.e. ‘./network.sh up createChannel -s couchdb’, I see an error connecting to the database when I try to unjoin the peer.  See Figure -2.  The connection to CouchDB is failing as it appears to me that the url is incorrect and should be using the localhost?  I’m guessing that the couch connection url is taken from the Env data that contains "CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb0:5984".  Perhaps there’s another environment variable that needs to be set to log into the host and the mapped port which is what I use to access CouchDB via the browser?

 

 

<image002.png>

                                                                                                                                                                Figure -1 Success

 

<image003.png>

Figure -2 Failure to Connect to CouchDB

 

Thanks,

 

Brett Tiller

Sr. Software Engineer

984-349-4239 (mobile)

btiller@...

 

<image001.png>

https://www.linkedin.com/company/securboration

 

Message Sender is EXTERNAL to Securboration. Carefully examine this message before you open any links or attachments.