Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

./generate-peer.sh is broken? #75

Open
kilpio opened this issue Aug 14, 2019 · 1 comment
Open

./generate-peer.sh is broken? #75

kilpio opened this issue Aug 14, 2019 · 1 comment
Assignees
Labels

Comments

@kilpio
Copy link
Contributor

kilpio commented Aug 14, 2019

./generate-peer.sh exits with
bash: crypto-config/fabric-ca-server-config-org1.yaml: Is a directory

Seems that
envSubst "templates/fabric-ca-server-template.yaml" "crypto-config/fabric-ca-server-config-$ORG.yaml" "export LDAP_BASE_DN=${LDAP_BASE_DN}"
expects the crypto-config/fabric-ca-server-config-$ORG.yaml to be a file, but when the ca serice is started, scripts try to mount it as a directory.
May be the $DOMAIN var is missing?
envSubst "templates/fabric-ca-server-template.yaml" "crypto-config/fabric-ca-server-config-$ORG.$DOMAIN.yaml" "export LDAP_BASE_DN=${LDAP_BASE_DN}"

@kilpio
Copy link
Contributor Author

kilpio commented Aug 27, 2019

So how this all could be reproduced.
I use freshly installed Ubuntu 18.04.3 LTS on my vps (I also get this problem on the AWS EC2) with apt-get update && apt-get upgrade
Then I create the 'ubuntu' user and add it to sudoers.

After that I just follow the fabric-starter installation instructions:

sudo apt update
sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
sudo apt update
sudo apt-get install docker-ce

sudo curl -L "https://github.com/docker/compose/releases/download/1.22.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

sudo usermod -aG docker ${USER}


sudo curl -L "https://github.com/docker/compose/releases/download/1.23.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

Then I logout/login as the ubuntu and clone the fabric-starter:

git clone https://github.com/olegabu/fabric-starter
cd ./fabric-starter/

The first step is OK:

./clean.sh
./generate-orderer.sh
docker-compose -f docker-compose-orderer.yaml up

Then I open another console and run the
./generate-peer.sh
It exits with the following error:

...

Execute: docker-compose -f ./docker-compose.yaml    run --rm cli.peer bash -c export LDAP_BASE_DN=dc=example,dc=com && envsubst <templates/fabric-ca-server-template.yaml >crypto-config/fabric-ca-server-config-org1.yaml && chown 1000 crypto-config/fabric-ca-server-config-org1.yaml
WARNING: Found orphan containers (www.example.com, cli.example.com, orderer.example.com) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up.
Starting pre-install.example.com ... done
Starting ca.org1.example.com     ... done
Starting peer0.org1.example.com  ... done
bash: crypto-config/fabric-ca-server-config-org1.yaml: Is a directory
Error occurred. See console output above.

And yes, that's so: the crypto-config/fabric-ca-server-config-org1.yaml is the directory. If I delete it and create the empty file the ./generate-peer.sh fills it with yaml but then it tries to mount the fabric-ca-server-config-org1.yaml, it occures to be a file and the script exits with error nevertheless.

Explicit exporting the COMPOSE_PROJECT_NAME, ORG and all the stuff does not help either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants