I'm following Hyperledger's tutorial 1 and setting up an Fabric environment. I have all the right dependencies installed with the right versions. My docker is version 19.03.1 and docker-compose is 1.8.0. Using IBM Blockchain Platform in VS code, when I click Local Fabric (Click to Start
it can't spin up the docker images. Instead it gives me an error Failed to start Local Fabric: Error: Failed to execute command "/bin/sh" with arguments "generate.sh" return code 126
I thought at first I needed to setup better permissions so I allowed docker to run without sudo and still get the same error. I've ran the docker images with Hyperledger's First-Network and Fabcar tutorials successfully, but can't get the Blockchain Platform to spin it up. Here is the entire log.
[2019-09-05 12:20:47 a.m.] [INFO] connecting to fabric environment
[2019-09-05 12:20:47 a.m.] [INFO] startFabricRuntime
[2019-09-05 12:20:47 a.m.] [INFO] # don't rewrite paths for Windows Git Bash users
[2019-09-05 12:20:47 a.m.] [INFO] export MSYS_NO_PATHCONV=1
[2019-09-05 12:20:47 a.m.] [INFO] CHANNEL_NAME=mychannel
[2019-09-05 12:20:47 a.m.] [INFO] # teardown any existing network
[2019-09-05 12:20:47 a.m.] [INFO] ./teardown.sh
[2019-09-05 12:20:47 a.m.] [INFO] # Shut down the Docker containers for the system tests.
[2019-09-05 12:20:47 a.m.] [INFO] docker-compose -f docker-compose.yml kill && docker-compose -f docker-compose.yml down -v
[2019-09-05 12:20:47 a.m.] [INFO] Version in "./docker-compose.yml" is unsupported. You might be seeing this error because you're using the wrong Compose file version. Either specify a version of "2" (or "2.0") and place your service definitions under the `services` key, or omit the `version` key and place your service definitions at the root of the file to use version 1.
[2019-09-05 12:20:47 a.m.] [INFO] For more on the Compose file format versions, see https://docs.docker.com/compose/compose-file/
[2019-09-05 12:20:47 a.m.] [INFO] # remove chaincode docker images
[2019-09-05 12:20:47 a.m.] [INFO] (docker ps -aq --filter "name=fabricvscodelocalfabric-*" | xargs docker rm -f) || true
[2019-09-05 12:20:47 a.m.] [INFO] Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.40/containers/json?all=1&filters=%7B%22name%22%3A%7B%22fabricvscodelocalfabric-%2A%22%3Atrue%7D%7D: dial unix /var/run/docker.sock: connect: permission denied
[2019-09-05 12:20:48 a.m.] [INFO] "docker rm" requires at least 1 argument.
[2019-09-05 12:20:48 a.m.] [INFO] See 'docker rm --help'.
[2019-09-05 12:20:48 a.m.] [INFO] Usage: docker rm [OPTIONS] CONTAINER [CONTAINER...]
[2019-09-05 12:20:48 a.m.] [INFO] Remove one or more containers
[2019-09-05 12:20:48 a.m.] [INFO] (docker images -aq "fabricvscodelocalfabric-*" | xargs docker rmi -f) || true
[2019-09-05 12:20:48 a.m.] [INFO] Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.40/images/json?all=1&filters=%7B%22reference%22%3A%7B%22fabricvscodelocalfabric-%2A%22%3Atrue%7D%7D: dial unix /var/run/docker.sock: connect: permission denied
[2019-09-05 12:20:48 a.m.] [INFO] "docker rmi" requires at least 1 argument.
[2019-09-05 12:20:48 a.m.] [INFO] See 'docker rmi --help'.
[2019-09-05 12:20:48 a.m.] [INFO] Usage: docker rmi [OPTIONS] IMAGE [IMAGE...]
[2019-09-05 12:20:48 a.m.] [INFO] Remove one or more images
[2019-09-05 12:20:48 a.m.] [INFO] # remove previous crypto material and config transactions
[2019-09-05 12:20:48 a.m.] [INFO] rm -fr admin-msp/* configtx/* crypto-config/* wallets/local_fabric_wallet/*
[2019-09-05 12:20:48 a.m.] [INFO] # Your system is now clean
[2019-09-05 12:20:48 a.m.] [INFO] rm -f generate.complete
[2019-09-05 12:20:48 a.m.] [INFO] fix_permissions () {
[2019-09-05 12:20:48 a.m.] [INFO] docker run --rm -v $PWD:/etc/hyperledger/fabric -w /etc/hyperledger/fabric hyperledger/fabric-tools:1.4.2 chown -R $(id -u):$(id -g) ./configtx ./crypto-config ./admin-msp
[2019-09-05 12:20:48 a.m.] [INFO] }
[2019-09-05 12:20:48 a.m.] [INFO] # generate crypto material
[2019-09-05 12:20:48 a.m.] [INFO] docker run --rm -v $PWD:/etc/hyperledger/fabric -w /etc/hyperledger/fabric hyperledger/fabric-tools:1.4.2 cryptogen generate --config=./crypto-config.yaml
[2019-09-05 12:20:48 a.m.] [INFO] docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.40/containers/create: dial unix /var/run/docker.sock: connect: permission denied.
[2019-09-05 12:20:48 a.m.] [INFO] See 'docker run --help'.
[2019-09-05 12:20:48 a.m.] [ERROR] Failed to start Local Fabric: Error: Failed to execute command "/bin/sh" with arguments "generate.sh" return code 126
Here is the link to the tutorial, though it shows in VScode https://developer.ibm.com/tutorials/ibm-blockchain-platform-vscode-smart-contract/. I followed it up to the point where you spin up the docker images.