Error | entroll the member admin | fabric-ca-client enroll | Amazon Managed Blockchain

471 views Asked by At

I am trying to setup hyperledger fabric blockchain network using amazon managed blockchain following this guide. To entroll, I have used the following command,

fabric-ca-client enroll -u 'https://admin:#D7a22hjjh*[email protected]:30002' --tls.certfiles /home/ec2-user/managedblockchain-tls-chain.pem -M /home/ec2-user/admin-msp

I got the following error,

Error: The URL of the fabric CA server is missing the enrollment ID and secret; found 'https://admin:#D7a22613ac75c9b9@ca.m-zzz.n-zzzz.managedblockchain.us-east-1.amazonaws.com:30002' but expecting 'https://<enrollmentID>:<secret>@admin:'

I thought this is due to # symbol in the password. For testing purpose I remove the # symbol and tried. I got the following error.

Error: Failed to create keystore directory: mkdir /home/ec2-user/admin-msp: permission denied

when I use sudo, I am getting the following error,

sudo: fabric-ca-client: command not found

Help me to fix this issue.

1

There are 1 answers

0
Tyrone321 On

What user are you logged in as? whoami

You should be using ec2-user, which has access to the /home/ec2-user/ directory.

You can try manually creating the admin-msp directory before running enrolling the admin:

cd ~ && mkdir admin-msp

Then try running your command.

If that doesn't work, use sudo to create the directory and then chown it to be owned by ec2-user:

cd ~
sudo mkdir admin-msp
sudo chown ec2-user ~/admin-msp

Then try your command.

Note that you can also wrap the username/password in quotes:

fabric-ca-client enroll -u 'https://"admin":"#D7a22hjjh*9b9"@ca.m-zzz.n-zzzz.managedblockchain.us-east-1.amazonaws.com:30002' --tls.certfiles /home/ec2-user/managedblockchain-tls-chain.pem -M /home/ec2-user/admin-msp