query.js crash on Hyperledger fabric fabcar example - hyperledger

The fabcar example of the hyperledger tutorial crashes for me at the step of attempting to run query.js.
I have removed all hyperledger related docker images (with docker rmi), so all required content was downloaded automatically when running startFabric.sh. The output on startup looks slightly "clouded" but not very suspicious (I skipped the lengthy output about the images being downloaded):
# wait for Hyperledger Fabric to start
# incase of errors when running later commands, issue export FABRIC_START_TIMEOUT=<larger number>
export FABRIC_START_TIMEOUT=10
#echo ${FABRIC_START_TIMEOUT}
sleep ${FABRIC_START_TIMEOUT}
# Create the channel
docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/users/Admin#org1.example.com/msp" peer0.org1.example.com peer channel create -o orderer.example.com:7050 -c mychannel -f /etc/hyperledger/configtx/channel.tx
flag provided but not defined: -e
See 'docker exec --help'.
The next step as asked is
npm install
It also delivers mostly ok output,just one warning:
npm WARN fabcar#1.0.0 No repository field.
I have verified images are running (also shows that the user is authorized to use the docker, while the user is otherwise not root):
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9acf0dd8a2e2 hyperledger/fabric-peer:x86_64-1.0.0 "peer node start" 20 seconds ago Up 19 seconds 0.0.0.0:7051->7051/tcp, 0.0.0.0:7053->7053/tcp peer0.org1.example.com
da42dca3cbda hyperledger/fabric-orderer:x86_64-1.0.0 "orderer" 20 seconds ago Up 19 seconds 0.0.0.0:7050->7050/tcp orderer.example.com
0265c3cd86f2 hyperledger/fabric-ca:x86_64-1.0.0 "sh -c 'fabric-ca-ser" 20 seconds ago Up 20 seconds 0.0.0.0:7054->7054/tcp ca.example.com
4f71895a78c0 hyperledger/fabric-couchdb:x86_64-1.0.0 "tini -- /docker-entr" 20 seconds ago Up 19 seconds 4369/tcp, 9100/tcp, 0.0.0.0:5984->5984/tcp couchdb
When I finally try to run
node query.js
I observe the following errors:
Create a client and set the wallet location
Set wallet path, and associate user PeerAdmin with application
Check user is enrolled, and set a query URL in the network
Make query
Assigning transaction_id: eb03c5e69259b880433861daf57a5ac2d33e41d93cebe80a7a478a1aa2cba711
error: [client-utils.js]: sendPeersProposal - Promise is rejected: Error: Endpoint read failed
at /home/hla/fabric-samples/fabcar/node_modules/grpc/src/node/src/client.js:434:17
returned from query
Query result count = 1
error from query = { Error: Endpoint read failed
at /home/hla/fabric-samples/fabcar/node_modules/grpc/src/node/src/client.js:434:17 code: 14, metadata: Metadata { _internal_repr: {} } }
Response is Error: Endpoint read failed
My OS:
uname -a
Linux uhost 4.4.0-92-generic #115-Ubuntu SMP Thu Aug 10 09:04:33 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
I have checked this but my node.js version is correct:
node --version
v6.11.2
npm -- version
{ fabcar: '1.0.0',
npm: '3.10.10',
ares: '1.10.1-DEV',
http_parser: '2.7.0',
icu: '56.1',
modules: '48',
node: '6.11.2',
openssl: '1.0.2l',
uv: '1.11.0',
v8: '5.1.281.103',
zlib: '1.2.11' }
Also, the error message is completely different. The machine has ports 8080 and 8443 in use, but when I tired to shut down the applications using them, was not helpful.

That's because you didn't follow the steps.. as it says, before query.js u should enroll the admin and register user, then it works properly. And don't pay attention to "npm WARN fabcar#1.0.0 No repository field", it works well. Try the following:
$docker stop $(docker ps -a -q)
$docker ps -qa|xargs docker rm
$./startFabric.sh
$cd fabric-samples/fabcar/javascript
$node enrollAdmin.js
$npm install
$node registerUser.js
$node query.js
[

Related

Running container fails with failed to add the host cannot allocate memory

OS: Red Hat Enterprise Linux release 8.7 (Ootpa)
Version:
$ sudo yum list installed | grep docker
containerd.io.x86_64 1.6.9-3.1.el8 #docker-ce-stable
docker-ce.x86_64 3:20.10.21-3.el8 #docker-ce-stable
docker-ce-cli.x86_64 1:20.10.21-3.el8 #docker-ce-stable
docker-ce-rootless-extras.x86_64 20.10.21-3.el8 #docker-ce-stable
docker-scan-plugin.x86_64 0.21.0-3.el8 #docker-ce-stable
Out of hundreds os docker calls made over days, a few of them fails. This is the schema of the commandline:
/usr/bin/docker
run
-u
1771:1771
-a
stdout
-a
stderr
-v
/my_path:/data
--rm
my_image:latest
my_entry
--my_args
The failure:
docker: Error response from daemon: failed to create endpoint recursing_aryabhata on network bridge: failed to add the host (veth6ad97f8) <=> sandbox (veth23b66ce) pair interfaces: cannot allocate memory.
It is not reproducible. The failure rate is less than one percent. At the time this error happens system has lots of free memory. Around the time that this failure happens, the application is making around 5 docker calls per second. Each call take about 5 to 10 seconds to complete.

docker redis container startup issue

I have question about docker redis-sentinel:5.0.10 startup issue.
I am running docker on CentOS7 Linux.
Before 5.0.10 version I used 4.0.9 and image was taken from our own repository, now I switched to bitnami repo.
The main problem is that I try to use redis-sentinel:5.0.10 (or redis-sentinel:5.0.7) and it falls into restart loop and cannot start properly.
I run containers like that:
[root#XXX opt]# docker run -d -p 26380:26379 -v /opt/app/redis:/data --name redis-sentinel -e REDIS_MASTER_HOST=XXX.XXX.XXX -e REDIS_MASTER_SET=XXX-XXX -e REDIS_SENTINEL_DOWN_AFTER_MILLISECONDS=30000 -e REDIS_SENTINEL_QUORUM=2 -e REDIS_SENTINEL_FAILOVER_TIMEOUT=180000 --net=host --restart=always bitnami/redis-sentinel:5.0.10
[root#XXX opt]# docker run -d --net=host -v /opt/app/redis:/data -v /opt/app/redis.conf:/usr/local/etc/redis/redis.conf --name redis-client --restart=always redis:5.0.10-alpine redis-server --slaveof XXX.XXX.XXX 6379
In log there are messages like:
redis-sentinel 10:16:50.45 Welcome to the Bitnami redis-sentinel container
redis-sentinel 10:16:50.45 Subscribe to project updates by watching https://github.com/bitnami/bitnami-docker-redis-sentinel
redis-sentinel 10:16:50.45 Submit issues and feature requests at https://github.com/bitnami/bitnami-docker-redis-sentinel/issues
redis-sentinel 10:16:50.46
redis-sentinel 10:16:50.46 INFO ==> ** Starting Redis sentinel setup **
redis-sentinel 10:16:50.47 ERROR ==> The configuration file /opt/bitnami/redis-sentinel/etc/sentinel.conf is not writable
Why it is not writable?
[root#dam31 ~]# docker run --rm -it bitnami/redis-sentinel:5.0.10 sh
redis-sentinel 14:03:36.16
redis-sentinel 14:03:36.16 Welcome to the Bitnami redis-sentinel container
redis-sentinel 14:03:36.17 Subscribe to project updates by watching https://github.com/bitnami/bitnami-docker-redis-sentinel
redis-sentinel 14:03:36.17 Submit issues and feature requests at https://github.com/bitnami/bitnami-docker-redis-sentinel/issues
redis-sentinel 14:03:36.17
$ cd /opt/bitnami/redis-sentinel/etc/
$ ls -l
total 12
-rw-rw-r-- 1 root root 9797 Dec 8 13:25 sentinel.conf
docker ps command says:
[root#XXX app]# docker ps --no-trunc
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
45988acb45407dfc7a19f4a2a08da7c8f7a99381a97bc17a3ae985d377605462 redis:5.0.10-alpine "docker-entrypoint.sh redis-server --slaveof XXX.XXX.XXX 6379" 4 minutes ago Up 3 minutes redis-client
94b9b8e712e2219bc3f9a18aba349985968e3410c5336905282fb43b38e89e8e bitnami/redis-sentinel:5.0.10 "/opt/bitnami/scripts/redis-sentinel/entrypoint.sh /opt/bitnami/scripts/redis-sentinel/run.sh" 4 minutes ago Restarting (1) 19 seconds ago redis-sentinel
On other machines I have upgraded redis to 5.0.7 version successfully and it runs properly, nothing was done otherwise:
[root#XXX app]# docker ps --no-trunc
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
07e535350c02a67478dd07708a06798981fe7e99ae448567837dacdee198ec1e redis:5.0.7-alpine "docker-entrypoint.sh redis-server /usr/local/etc/redis/redis.conf --slaveof XXX.XXX.XXX 6379" 8 weeks ago Up 8 weeks redis-client
fea1bff3b2c1fbc9c7cea2becad64b7e2727dfc1f73f1d541e08b9b75143b3a9 bitnami/redis-sentinel:5.0.7 "/entrypoint.sh /run.sh" 8 weeks ago Up 8 weeks redis-sentinel
If I run on the same machine (where I tried to run redis:5.0.10) redis:5.0.7 the same error occured:
[root#XXX ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
15cdd46fa325 redis:5.0.7-alpine "docker-entrypoint.s…" 15 minutes ago Up 15 minutes redis-client
b0b02a36b68c bitnami/redis-sentinel:5.0.7 "/entrypoint.sh /run…" 16 minutes ago Restarting (1) 50 seconds ago redis-sentinel
redis-sentinel 14:16:23.86 Welcome to the Bitnami redis-sentinel container
redis-sentinel 14:16:23.87 Subscribe to project updates by watching https://github.com/bitnami/bitnami-docker-redis-sentinel
redis-sentinel 14:16:23.87 Submit issues and feature requests at https://github.com/bitnami/bitnami-docker-redis-sentinel/issues
redis-sentinel 14:16:23.87 Send us your feedback at containers#bitnami.com
redis-sentinel 14:16:23.87
redis-sentinel 14:16:23.87 INFO ==> ** Starting Redis sentinel setup **
redis-sentinel 14:16:23.88 ERROR ==> The configuration file /opt/bitnami/redis-sentinel/etc/sentinel.conf is not writable
What I am doing wrong? Any thoughts? (NB! SELinux is disabled)

Unable to join peers to channel in Hyperledger First Network setup

I am following a tutorial on the Hyperledger fabric site and after installing all the perquisites (latest versions) on a Linux 18.04 installation I run into an error.
I am trying to run the given ./byfn script to "Build Your First Network". After a fresh install I run the commands as follows:
./byfn generate
./byfn up
At which point everything performs as expected untill the following error occurs 5 times in a row (after which the run exits with an Error):
+ peer channel join -b mychannel.block
+ res=1
+ set +x
Error: error getting endorser client for channel: endorser client failed to connect to peer0.org1.example.com:7051: failed to create new connection: context deadline exceeded
peer0.org1 failed to join the channel, Retry after 3 seconds
I have tried various things like:
Increasing the timeout to allow for longer connection times
I have down-ed the network and upped it again
Full re-installations of required packages and the fabric-samples
Removed all docker volumes/images/containers
I came across some sources mentioning that it might have to do with the peers not being able to connect to each other. Which I tried to fix with a manual docker connect of each peer to the byfn docker network, no success there. I can see the orderer running but the peers that attempted to join the network exited with an error:
docker container ls -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
99570e191542 hyperledger/fabric-tools:latest "/bin/bash" 24 seconds ago Up 23 seconds cli
340d1225a913 hyperledger/fabric-peer:latest "peer node start" 30 seconds ago Exited (2) 24 seconds ago peer0.org1.example.com
fabe017751a0 hyperledger/fabric-peer:latest "peer node start" 30 seconds ago Exited (2) 25 seconds ago peer1.org2.example.com
f81a639f29f6 hyperledger/fabric-peer:latest "peer node start" 30 seconds ago Exited (2) 26 seconds ago peer1.org1.example.com
0f91080db681 hyperledger/fabric-peer:latest "peer node start" 30 seconds ago Exited (2) 27 seconds ago peer0.org2.example.com
c491adc91320 hyperledger/fabric-orderer:latest "orderer" 30 seconds ago Up 28 seconds 0.0.0.0:7050->7050/tcp orderer.example.com
This shows that the nodes exited with an error code, they all look the same, look below for a docker logs of the peer node.
So my final question is: How do I get the "First Network" Hyperledger sample peers to successfully join the channel?
Thanks in advance!
Update 1
I chose a bad code dump! Please use these links for logs/outputs.
Full ./byfn up output
Docker log output for peer0
Update 2
So I have been trying various things, it seems to not be a go related error but simply a "connection" error where go crashes upon trying to connect a peer to the channel. So the main question at hand is: Why are my docker instances not properly connecting to the channel?
Update 3
I have used Amazon Web Services to launch a Linux instance and re-created all my installation steps on this "fresh" instance. Everything worked on the first go (pun intended). Therefore I must conclude that it had to do with either my network settings or personal setup as these are the only parameters that changed.
As this works for me for now I will work with that. I am still open to suggestions and will keep an eye on this post!
Package versions
Hyperledger Fabric 1.4.0
Docker version 18.09.2, build 6247962
docker-compose version 1.13.0, build 1719ceb
go version go1.11 linux/amd64
npm: '6.4.1',
node -v: v8.15.0
I will suggest you to check two things: the memory available and the permissions in the "first-network" directory.

Hyperledger composer rest server : Error trying to ping. Error: No peers available to query. last error was Error: 14 UNAVAILABLE: Connect Failed

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.
The Google Auth tutorial isn't expecting a fabric set up from the multiorg tutorial so isn't going to work if you follow the steps. The Auth tutorial is designed to work with the single org provided by the development fabric from setting up the composer development environment or running the single org tutorial. The problem will be that the connection.json needs to describe the multi-org setup (so you will need an appropriate connection profile from the multi-org tutorial) and as you are running your rest server in a docker container and are attaching to the network which all the hyperledger fabric containers are connected to you cannot use hostnames and addresses such as localhost, 127.0.0.1 or 0.0.0.0 to try to address the different hyperledger fabric processes (all of these will actually refer to your rest server container). You need to use the correct hostnames to identify them. For example
orderer.example.com for the orderer
peer0.org1.example.com for peer0.org1.example.com (and similar for the other peers)
ca0 for the certificate authority in org1, ca1 for the certificate authority in org2
Try replacing your peer0.org1.example.com, peer0.org1.example.com, ca.org1.example.com and orderer.example.com in
sed -e 's/localhost:7051/peer0.org1.example.com:7051/' \
-e 's/localhost:7053/peer0.org1.example.com:7053/' \
-e 's/localhost:7054/ca.org1.example.com:7054/' \
-e 's/localhost:7050/orderer.example.com:7050/' \
< $HOME/.composer/cards/restadmin#trade-network/connection.json \
> /tmp/connection.json && \
cp -p /tmp/connection.json $HOME/.composer/cards/restadmin#trade-network/
command with your ip adddress like :
sed -e 's/localhost:7051/192.168.0.170:7051/' \
-e 's/localhost:7053/192.168.0.170:7053/' \
-e 's/localhost:7054/192.168.0.170:7054/' \
-e 's/localhost:7050/192.168.0.170:7050/' \
< $HOME/.composer/cards/restadmin#trade-network/connection.json \
> /tmp/connection.json && \
cp -p /tmp/connection.json $HOME/.composer/cards/restadmin#trade-network/

Setting Up a Network For Development in Hyperledger Fabric v0.5-preview

My demo project is running OK already, but it is only one peer in network. I want to add more peers into network.
I followed this guide ==> https://github.com/hyperledger-archives/fabric/blob/540c4db5f64dba4bd1b18e896c96a8d17d7ec552/docs/dev-setup/devnet-setup.md.
Please kindly help to check the log below,
the directory was wrong? or what is the right way to run this start up of peer?
vagrant#hyperledger-devenv:v-:/opt/gopath/src/github.com/hyperledger/fabric$ docker run --rm -it -e CORE_VM_ENDPOINT=http://172.17.0.1:2375 -e CORE_PEER_ID=vp0 -e CORE_PEER_ADDRESSAUTODETECT=true hyperledger-peer peer node start
Unable to find image 'hyperledger-peer:latest' locally
Pulling repository docker.io/library/hyperledger-peer
docker: Error: image library/hyperledger-peer not found.
See 'docker run --help'.
Is it possible that first node in network was started not in Docker container? (For example it could be started as a process using peer node start)
We can verify which docker images are available in vagrant machine. Just run docker images command:
vagrant#hyperledger-devenv:v0.0.9-b4acc4b:$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
hyperledger/fabric-baseimage latest c1d6f4800a55 27 hours ago 1.297 GB
hyperledger/fabric-baseimage x86_64-0.0.9 70328eed56aa 2 weeks ago 990.1 MB
busybox latest 47bcc53f74dc 9 weeks ago 1.113 MB
With such configuration, when “hyperledger-peer” image is not available, the Validation Peer will not be started because of “Unable to find image” error:
vagrant#hyperledger-devenv:v0.0.9-b4acc4b:/opt/gopath/src/github.com/hyperledger/fabric/peer$ docker run --rm -it -e CORE_VM_ENDPOINT=http://172.17.0.1:2375 -e CORE_PEER_ID=vp0 -e CORE_PEER_ADDRESSAUTODETECT=true hyperledger-peer peer node start
Unable to find image 'hyperledger-peer:latest' locally
Pulling repository docker.io/library/hyperledger-peer
docker: Error: image library/hyperledger-peer not found.
"hyperledger-peer:latest" image can be created using:
cd $GOPATH/src/github.com/hyperledger/fabric/core/container
go test -run BuildImage_Peer
Now docker images should show one more available image:
REPOSITORY TAG IMAGE ID CREATED SIZE
hyperledger-peer latest 438b65f18f21 8 seconds ago 1.418 GB
at this point Validation Peer should be started successfully:
vagrant#hyperledger-devenv:v0.0.9-b4acc4b:~$ docker run —rm -it -e CORE_VM_ENDPOINT=http://172.17.0.1:2375 -e CORE_PEER_ID=vp0 -e CORE_PEER_ADDRESSAUTODETECT=true hyperledger-peer peer node start
21:55:51.969 [crypto] main -> INFO 001 Log level recognized 'info', set to INFO
21:55:51.970 [peer] func1 -> INFO 002 Auto detected peer address: 172.17.0.2:30303
21:55:51.971 [peer] func1 -> INFO 003 Auto detected peer address: 172.17.0.2:30303
21:55:51.972 [peer] func1 -> INFO 004 Auto detected peer address: 172.17.0.2:30303
21:55:51.974 [main] serve -> INFO 005 Security enabled status: false
21:55:51.974 [main] serve -> INFO 006 Privacy enabled status: false
…

Resources