peer node unable to create chaincode container - dial unix /host/var/run/docker.sock: connect: permission denied error

随声附和 提交于 2019-12-14 02:57:49

问题


I am trying to setup hyperledger network on centos

Using 1.1.0 images from ibmblockchain docker hub.

I am able to start up the network without any issues. that is 1 orderer, 3 kafkas, 3 zookeepers and 2 peers.

But every time i try to instantiate chaincode, I see the below error in the peer docker containers. Can anyone help me with this issue.

2018-07-19 19:05:30.570 UTC [dockercontroller] Start -> ERRO 3ac start-could not recreate container , because of Post http://unix.sock/containers/create?name=dev-peer1.bns-250A-v1.0.2-b3: dial unix /host/var/run/docker.sock: connect: permission denied 2018-07-19 19:05:30.570 UTC [container] unlockContainer -> DEBU 3ad container lock deleted(dev-peer1.bns-250A-v1.0.2-b3) 2018-07-19 19:05:30.570 UTC [chaincode] launchAndWaitForRegister -> DEBU 3ae stopping due to error while launching: Post http://unix.sock/containers/create?name=dev-peer1-chaincode1-v1.0.2-b3: dial unix /host/var/run/docker.sock: connect: permission denied error starting container.

Thank you.


回答1:


the problem is a permission issue with /var/run/docker.sock

Check your /var/run/docker.sock permission

ls -l /var/run/docker.sock will let u know if you have the correct permission

sudo chmod 666 /var/run/socker.sock should give it correct rw access




回答2:


I was able to fix this by adding Username, UserID and GroupID permissions to the docker run command.

Ex:

peer0.org1.example.com: container_name: peer0.org1.example.com image: ibmblockchain/fabric-peer-$ARCH:1.1.0 environment: - CORE_LOGGING_LEVEL=debug - CORE_CHAINCODE_LOGGING_LEVEL=DEBUG - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock - CORE_PEER_ID=peer0.org1.example.com - CORE_PEER_ADDRESS=peer0.org1.example.com:7051 - CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=composer_default - CORE_PEER_LOCALMSPID=Org1MSP - CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/peer/msp - CORE_LEDGER_STATE_STATEDATABASE=CouchDB - CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb:5984 - USERNAME=(your userid) - USER_ID=1000 - GROUP_ID=999

This is mentioned as the solution in ibmblockchain github repo : https://github.com/IBM-Blockchain/ibm-blockchain-issues/issues/125



来源:https://stackoverflow.com/questions/51430319/peer-node-unable-to-create-chaincode-container-dial-unix-host-var-run-docker

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