Hyperledger Docker endpoint not found

匿名 (未验证) 提交于 2019-12-03 10:24:21

问题:

I have setup a 2 node Hyperledger network using Docker images on Ubuntu 14.04 by creating 2 containers as per the steps provided @ http://hyperledger-fabric.readthedocs.io/en/latest/Setup/Network-setup/#leveraging-published-docker-images

Then I tried to deploy a chaincode, which compiles without errors, by calling POST /chaincode API and got response 200 with the hash returned for the deployed chaincode.

But immediately after that I got the following error in the docker logs:

08:44:26.560 [consensus/noops] processTransactions -> DEBU 053 Starting TX batch with timestamp: seconds:1473929066 nanos:560229743 08:44:26.560 [consensus/noops] processTransactions -> DEBU 054 Executing batch of 1 transactions with timestamp seconds:1473929066 nanos:560229743 08:44:26.563 [chaincode] getArgsAndEnv -> DEBU 055 Executable is /opt/gopath/bin/1e90b51f9129b97d5312d5c24364085777602a06d40d6e2c9209b4f30d7e66facb26e956443028611539962acc6de550eba03bbb1fd0e7bbd655cb19c5a6ef84 08:44:26.564 [chaincode] Deploy -> DEBU 056 deploying chaincode 1e90b51f9129b97d5312d5c24364085777602a06d40d6e2c9209b4f30d7e66facb26e956443028611539962acc6de550eba03bbb1fd0e7bbd655cb19c5a6ef84(networkid:dev,peerid:vp0) 08:44:26.564 [container] lockContainer -> DEBU 057 waiting for container(dev-vp0-1e90b51f9129b97d5312d5c24364085777602a06d40d6e2c9209b4f30d7e66facb26e956443028611539962acc6de550eba03bbb1fd0e7bbd655cb19c5a6ef84) lock 08:44:26.564 [container] lockContainer -> DEBU 058 got container (dev-vp0-1e90b51f9129b97d5312d5c24364085777602a06d40d6e2c9209b4f30d7e66facb26e956443028611539962acc6de550eba03bbb1fd0e7bbd655cb19c5a6ef84) lock  **08:44:26.565 [dockercontroller] deployImage -> ERRO 059 Error building images: cannot connect to Docker endpoint** 

So how do I resolve this?

Another update. I did the following:

1) Edited /etc/default/docker to add the entry: DOCKER_OPTS="--api-cors-header='*' -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock "

2) Restarted docker

3) Started a node using docker-compose up command

Tried deploying chaincode and now I get a different error:

    vp0_1 | 06:09:33.441 [consensus/noops] handleChannels -> DEBU 048 Process block due to time      vp0_1 | 06:09:33.441 [consensus/noops] processTransactions -> DEBU 049 Starting TX batch with timestamp: seconds:1475042973 nanos:441383619      vp0_1 | 06:09:33.441 [consensus/noops] processTransactions -> DEBU 04a Executing batch of 1 transactions with timestamp seconds:1475042973 nanos:441383619      vp0_1 | 06:09:33.446 [chaincode] getArgsAndEnv -> DEBU 04b Executable is /opt/gopath/bin/1e90b51f9129b97d5312d5c24364085777602a06d40d6e2c9209b4f30d7e66facb26e956443028611539962acc6de550eba03bbb1fd0e7bbd655cb19c5a6ef84      vp0_1 | 06:09:33.446 [chaincode] Deploy -> DEBU 04c deploying chaincode 1e90b51f9129b97d5312d5c24364085777602a06d40d6e2c9209b4f30d7e66facb26e956443028611539962acc6de550eba03bbb1fd0e7bbd655cb19c5a6ef84(networkid:dev,peerid:vp0)      vp0_1 | 06:09:33.446 [container] lockContainer -> DEBU 04d waiting for container(dev-vp0-1e90b51f9129b97d5312d5c24364085777602a06d40d6e2c9209b4f30d7e66facb26e956443028611539962acc6de550eba03bbb1fd0e7bbd655cb19c5a6ef84) lock      vp0_1 | 06:09:33.446 [container] lockContainer -> DEBU 04e got container (dev-vp0-1e90b51f9129b97d5312d5c24364085777602a06d40d6e2c9209b4f30d7e66facb26e956443028611539962acc6de550eba03bbb1fd0e7bbd655cb19c5a6ef84) lock      vp0_1 | 06:09:37.608 [peer] ensureConnected -> DEBU 04f Touch service indicates no dropped connections      vp0_1 | 06:09:37.608 [peer] ensureConnected -> DEBU 050 Connected to: [] vp0_1 | 06:09:37.608 [peer] ensureConnected -> DEBU 051 Discovery knows about: []      vp0_1 | 06:09:39.533 [dockercontroller] deployImage -> ERRO 052 Error building images: Tag latest not found in repository docker.io/hyperledger/fabric-baseimage      vp0_1 | 06:09:39.533 [dockercontroller] deployImage -> ERRO 053 Image Output: 

回答1:

Did you check your container environment variable:

CORE_VM_ENDPOINT=unix:///var/run/docker.sock 

Make sure this file is accessible from within your container as for some reason it was not the case for me and I had to mount it.

Then if you get deployImage -> ERRO 052 Error building images: Tag latest not found... it is a known issue (ex. Error building images: Tag latest not found in repository docker.io/hyperledger/fabric-baseimage).

I downloaded one of the available images and retagged it

docker pull hyperledger/fabric-baseimage:x86_64-0.1.0 docker tag hyperledger/fabric-baseimage:x86_64-0.1.0 hyperledger/fabric-baseimage:latest 


易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!