Re: peer node unjoin fails when couchdb is present


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

 

Join {fabric@lists.hyperledger.org to automatically receive all group messages.