Under Hyperledger composer, I am trying to set up a persistent Rest Server using googleauth2.0 over a multi-org setup.
For the multi-org setup, I have followed https://hyperledger.github.io/composer/latest/tutorials/deploy-to-fabric-multi-org and for the google auth setup I have followed https://hyperledger.github.io/composer/latest/tutorials/google_oauth2_rest.
Everything goes fine until following step when I try to start a new instance of the extended Docker image for the REST server using following command
docker run
-d
-e COMPOSER_CARD=${COMPOSER_CARD}
-e COMPOSER_NAMESPACES=${COMPOSER_NAMESPACES}
-e COMPOSER_AUTHENTICATION=${COMPOSER_AUTHENTICATION}
-e COMPOSER_MULTIUSER=${COMPOSER_MULTIUSER}
-e COMPOSER_PROVIDERS="${COMPOSER_PROVIDERS}"
-e COMPOSER_DATASOURCES="${COMPOSER_DATASOURCES}"
-v ~/.composer:/home/composer/.composer
--name rest
--network composer_default
-p 3001:3001
org1/composer-rest-server
Following are the logs from rest container:
[2018-05-13 02:38:15] PM2 log: Launching in no daemon mode
[2018-05-13 02:38:16] PM2 log: Starting execution sequence in -fork mode- for app name:composer-rest-server id:0
[2018-05-13 02:38:16] PM2 log: App name:composer-rest-server id:0 online
WARNING: NODE_APP_INSTANCE value of '0' did not match any instance config file names.
WARNING: See https://github.com/lorenwest/node-config/wiki/Strict-Mode
Discovering types from business network definition ...
Connection fails: Error: Error trying to ping. Error: No peers available to query. last error was Error: 14 UNAVAILABLE: Connect Failed
It will be retried for the next request.
Exception: Error: Error trying to ping. Error: No peers available to query. last error was Error: 14 UNAVAILABLE: Connect Failed
Error: Error trying to ping. Error: No peers available to query. last error was Error: 14 UNAVAILABLE: Connect Failed
at _checkRuntimeVersions.then.catch (/home/composer/.npm-global/lib/node_modules/composer-rest-server/node_modules/composer-connector-hlfv1/lib/hlfconnection.js:790:34)
at <anonymous>
[2018-05-13 02:38:29] PM2 log: App [composer-rest-server] with id [0] and pid [14], exited with code [1] via signal [SIGINT]
Here are the docker containers:
233938f12ef0 org1/composer-rest-server "pm2-docker composer…" 30 minutes ago Up 30 minutes 3000/tcp, 0.0.0.0:3001->3001/tcp rest
6285853fdceb dev-peer1.org1.example.com-emcs-0.0.3-b1bb3a7f1090c0d1cabf10340188aa72e329e1266595f63d232d9cc38a0ed8b8 "/bin/sh -c 'cd /usr…" About an hour ago Up About an hour dev-peer1.org1.example.com-emcs-0.0.3
1a4f7680cac9 dev-peer0.org1.example.com-emcs-0.0.3-094e3600469176994df7048ec5afad4114ce5203fe267b0c45da52a3d3b9e0b7 "/bin/sh -c 'cd /usr…" About an hour ago Up About an hour dev-peer0.org1.example.com-emcs-0.0.3
b7c7364c88bd dev-peer0.org2.example.com-emcs-0.0.3-3f76658cf8352417e15be589ed41aa0fa81e702a1bdb6e7e1ce898a015fdd34c "/bin/sh -c 'cd /usr…" About an hour ago Up About an hour dev-peer0.org2.example.com-emcs-0.0.3
b154cd4f50bd dev-peer1.org2.example.com-emcs-0.0.3-340eb1dbb0152185d068724d637848c882bd3754f7c9888d57c80bdfb6530774 "/bin/sh -c 'cd /usr…" About an hour ago Up About an hour dev-peer1.org2.example.com-emcs-0.0.3
f9d2a72fde40 dev-peer1.org2.example.com-mycc-1.0-26c2ef32838554aac4f7ad6f100aca865e87959c9a126e86d764c8d01f8346ab "chaincode -peer.add…" 2 hours ago Up 2 hours dev-peer1.org2.example.com-mycc-1.0
d812bef3a1bd dev-peer0.org1.example.com-mycc-1.0-384f11f484b9302df90b453200cfb25174305fce8f53f4e94d45ee3b6cab0ce9 "chaincode -peer.add…" 2 hours ago Up 2 hours dev-peer0.org1.example.com-mycc-1.0
ccb70e752d7b dev-peer0.org2.example.com-mycc-1.0-15b571b3ce849066b7ec74497da3b27e54e0df1345daff3951b94245ce09c42b "chaincode -peer.add…" 2 hours ago Up 2 hours dev-peer0.org2.example.com-mycc-1.0
6989f8850296 hyperledger/fabric-tools "/bin/bash -c './scr…" 2 hours ago Up 2 hours cli
0eabbd6be684 hyperledger/fabric-peer "peer node start" 2 hours ago Up 2 hours 0.0.0.0:10051->7051/tcp, 0.0.0.0:10053->7053/tcp peer1.org2.example.com
d8c1146a5989 hyperledger/fabric-peer "peer node start" 2 hours ago Up 2 hours 0.0.0.0:8051->7051/tcp, 0.0.0.0:8053->7053/tcp peer1.org1.example.com
142aeb4525ab hyperledger/fabric-peer "peer node start" 2 hours ago Up 2 hours 0.0.0.0:9051->7051/tcp, 0.0.0.0:9053->7053/tcp peer0.org2.example.com
70ef571ea1ba hyperledger/fabric-peer "peer node start" 2 hours ago Up 2 hours 0.0.0.0:7051->7051/tcp, 0.0.0.0:7053->7053/tcp peer0.org1.example.com
31c8417beae2 hyperledger/fabric-ca "sh -c 'fabric-ca-se…" 2 hours ago Up 2 hours 0.0.0.0:8054->7054/tcp ca_peerOrg2
ade3061fc517 hyperledger/fabric-orderer "orderer" 2 hours ago Up 2 hours 0.0.0.0:7050->7050/tcp orderer.example.com
e315be1721d9 hyperledger/fabric-couchdb "tini -- /docker-ent…" 2 hours ago Up 2 hours 4369/tcp, 9100/tcp, 0.0.0.0:8984->5984/tcp couchdb3
0197051ffaf6 hyperledger/fabric-couchdb "tini -- /docker-ent…" 2 hours ago Up 2 hours 4369/tcp, 9100/tcp, 0.0.0.0:6984->5984/tcp couchdb1
5abd60481ec3 hyperledger/fabric-couchdb "tini -- /docker-ent…" 2 hours ago Up 2 hours 4369/tcp, 9100/tcp, 0.0.0.0:7984->5984/tcp couchdb2
58205a7b26fe hyperledger/fabric-ca "sh -c 'fabric-ca-se…" 2 hours ago Up 2 hours 0.0.0.0:7054->7054/tcp ca_peerOrg1
13009c1401fb hyperledger/fabric-couchdb "tini -- /docker-ent…" 2 hours ago Up 2 hours 4369/tcp, 9100/tcp, 0.0.0.0:5984->5984/tcp couchdb0
1ef9ab29b607 mongo "docker-entrypoint.s…" 2 hours ago Up 2 hours 0.0.0.0:27017->27017/tcp mongo
I have already gone through some errors which have been received by others, and so have already performed following additional steps:
- Changing the permissions of ~/.composer by using the command: chmod -R 777 ~/.composer
- Replaced the IP addresses in the connection.json for my network cards to use 0.0.0.0 as recommended in https://github.com/hyperledger/composer/issues/3002.
I have tried cleaning up all my docker containers and images, stopping the fabric and starting the fabric but it still comes up with the same error..
Expected behaviour is that the command docker logs -f rest should finish with Browse your REST API at http://localhost:3001/explorer. However, it results in the above error.