ERROR: for peer0.org1.example.com Cannot create container for service peer0.org1.example.com: b'Mount denied:\nThe source path "\\\\var\\\\run:/host/var/run/"\ nis not a valid Windows path'


#1

While trying this tutorial https://hyperledger-fabric.readthedocs.io/en/latest/write_first_app.html

While executing this script, i got the below error. (about path in windows)
./startFabric.sh

don’t rewrite paths for Windows Git Bash users

export MSYS_NO_PATHCONV=1

docker-compose -f docker-compose.yml down
Stopping couchdb … done
Stopping orderer.example.com … done
Stopping ca.example.com … done
Removing couchdb … done
Removing orderer.example.com … done
Removing ca.example.com … done
Removing network net_basic

docker-compose -f docker-compose.yml up -d ca.example.com orderer.example.com pe er0.org1.example.com couchdb
Creating network “net_basic” with the default driver
Creating couchdb … done
Creating orderer.example.com … done
Creating ca.example.com
Creating peer0.org1.example.com … error

ERROR: for peer0.org1.example.com Cannot create container for service peer0.org Creating ca.example.com … done
nis not a valid Windows path’

ERROR: for peer0.org1.example.com Cannot create container for service peer0.org 1.example.com: b’Mount denied:\nThe source path “\\var\\run:/host/var/run/”\ nis not a valid Windows path’
Encountered errors while bringing up the project.


#2

This is because the docker compose uses a .env variable COMPOSE_CONVERT_WINDOWS_PATHS=1 that you need to configure in windows.

The real solution is to know in which folder you have to create this .env file.

Under your ‘fabric-samples’ folder there will be .env file in three different folders.

  1. first-network
  2. basic-network
  3. fabric-ca

So open the .env file in all these three folders and add the below line at the bottom.
COMPOSE_CONVERT_WINDOWS_PATHS=1

Save it and then rerun that script.


#3

Yes, it worked for me.
Thanks