Issue bringing up Hyperledger Fabric "Building Your First Network" sample - hyperledger-fabric

while I am running this command from my terminal
sudo ./byfn.sh -m up
I am getting below error:
Starting with channel 'my-channel' and CLI timeout of '10' seconds
and CLI delay of '3' seconds Continue (y/n)? y proceeding ...
Pulling orderer.example.com (hyper-ledger/fabric-orderer:latest)...
ERROR: manifest for hyper-ledger/fabric-orderer:latest not found
ERROR !!!! Unable to start network Error response from daemon: No
such container: cli
How do I resolve this please?

You need to download platform specific binaries, please see how to do it here in the following tutorial. Please also make sure you have all per-requisites, you can find more about what needed here.

Ideally, you should download the platform binaries and images as given in the Fabric documentation - Install Binaries and Docker Images
Or
You should make sure that your terminal has internet access & not behind any corporate proxy. Whatever is needed would be pulled by docker anyway. I am guessing that hyperledger/fabric-baseos image is not pulled by the script above.
If you don't find hyperledger/fabric-baseos:latest,then either docker pull hyperledger/fabric-baseos:tag depends on the fabric version on your own
Or, the chaincode instantiate process in byfn- end to end CLI would do it for you.

I had the same issue. Turns out it was just a broken docker-compose installation. I simply figured it out typing docker-compose in my terminal, and I ran into ImportError: No module named ssl_match_hostname
With a clean docker compose install, I got it to work.

Related

My containers in portainer have disapeared and cannot be redeployed

I'm having issues now with my portainer. I run ubuntu with docker and portainer and I ran the apt-get upgrade and install command through the terminal to update some things. now when I go to the portainer all my containers are gone and when I go to deploy them again I get the:
failed to deploy a stack: Creating Container xxxxx Starting Error response from daemon: error while creating mount source path '/docker/ghost/mysql': mkdir /docker: read-only file system
At the time the only thing I could think of that maybe had created this issue was went ubuntu said there were updates to be installed so I let it install and then also ran the apt-get commands in terminal:
apt-get upgrade
apt-get install
My ubuntu storage has 80GB free (someone said may be a storage issue)
I was on the portainer slack channel trying to get help from a staff member he had me try "docker ps" which didn't work I had to try "sudo docker ps" which gave me that second error message listed above.https://docs.docker.com/engine/install/linux-postinstall/
permission denied while trying to connect to the docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/json": dial unix /var/run/docker.sock: connect: permissions denied
I also went and tried the docker group add from the docker docs and tried adding the $USER to the docker group. I have done that also, it lets me run the hello-world from the terminal but still doesn't let me deploy on portainer.
I still get the same deploy error from portainer:
failed to deploy a stack: Creating Container xxxxx Starting Error response from daemon: error while creating mount source path '/docker/ghost/mysql': mkdir /docker: read-only file system
This was from one of the stacks I tried to redeploy since it has the /docker/"ghost"/mysql. Also, doesnt let me redeploy any other stacks tried that too.
Really unsure what to do and how to fix it since it basically now doesn't let me use any of those containers. Any help will be really appreciated, quite on edge right now! Thanks
I was kinda expecting not to have any of these issues. Not event entirely sure how it happened, I'm assuming maybe when I was using the "apt-get" commands. I don't really know myself. I would just like this fixed so I can get my data and containers back up and going on portainer. Yes, I also know portainer and docker are different and portainer is only a utility for docker.
edit: to add to this I have also re-installed portainer and docker not a full docker refresh but the standard one where it keeps some of the files since I dont want to remove some of the directories where some containers keep there configs and data files

Deploying Chaincode Failed

I was following the tutorial of hyperledger fabric "Using the Fabric Test Network", ang upon deploying the chaincode to the channel I encountered errors that I don't know what's the problem with it. I tried everything I have searched so far but no luck on fixing it. I tried uninstalling everything, and starting from the beginning of the installation but again no luck. I am new to this blockchain platform and is an aspiring developer for it. Anyone Please help.
Here is the result upon running the chaincode deployment :
Please do note that I tried installing golang (go1.13.x versions, go1.18.x and go1.19.x)but none solved the problem, anybody please help.
The screenshot shows that you don't have golang on the path. You need to ensure your $PATH variable includes the directory where the go binary is installed. However a further issue is you must ensure that the correct version of Go is installed that matches the version of Hyperledger Fabric you are using. Refer to the release notes of Hyperledger Fabric found here https://github.com/hyperledger/fabric/releases for your version to determine the appropriate version of golang to use.
A simpler option would be to install the javascript chaincode rather than the Go chaincode as this doesn't require any language support to be installed
./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-javascript -ccl javascript
I see this error in your screenshot:
go: command not found
Check you can run go from your shell:
go version
You likely need to add the go executable to your shell's PATH, as described in the Go installation instructions.

Not able to start up hyperledger fabric network

I'm getting below error when running command ./fabricNetwork.sh up.
error
Error : manifest for hyperledger/fabric-ca:latest not found
Error : no such container : cli
errror screenshot
https://i.stack.imgur.com/DXSIz.jpg
docker files
https://github.com/NavyaGouru/Ashish_HLF
Try hyperledger/fabric-ca:1.4.8. latest tag has been deprecated instead use a specific tag. Fix your Local Image and Docker Image error too by updating Local Images to 1.4.8.
#alpha as already answered the question. I'd just like to add one point to it. You can pass the image tag to be used to launch the network using -i to the command. Its default value latest. You can see this by passing the --help flag to the command ./fabricNetwork.sh up.
The Local Version of the images can be found in the .env file in the directory. DOCKER_IMAGE_VERSION is the version that you pass using the -i flag. These two should have the same value otherwise you'll get this.
=================== WARNING ===================
Local fabric binaries and docker images are
out of sync. This may cause problems.
===============================================
ERROR! Fabric Docker image version of 1.4.8 does not match the versions supported by the test network.

Error when trying to bring up the test network

I trying to follow tutorials and develope on Ubuntu. Then get an error when comes to "Bring up the test network" part. I successfully run the following command to print the script help text of the test network.
./network.sh -h
When I want to run the next command to bring up the network
./network.sh up
I get the message as follow
Starting nodes with CLI timeout of '5' tries and CLI delay of '3' seconds and using database 'leveldb' with crypto from 'cryptogen'
ERROR! Peer binary and configuration files not found..
May somebody tells me what's happened? Kindly helps.
I had the same issue, looks like you need to fetch system specific binaries:
https://hyperledger-fabric.readthedocs.io/en/release-2.2/test_network.html
I ran the curl command in the root dir without specifying the versions.
curl -sSL https://raw.githubusercontent.com/hyperledger/fabric/master/scripts/bootstrap.sh | bash -s
Make sure you add the ./bin to .gitignore
Be sure to use
./network.sh up
from the test network folder and that test network folder is contained in fabric samples, because it could use binaries from different directories contained inside fabric samples and moving it could cause your error.
Also try to set this environment variable
FABRIC_CFG_PATH=$PWD
to force Fabric to be launched in your test network folder
first bring down the network to clean up
cd test-network
./network.sh down
start the network agian
./network.sh up
Before you can deploy the test network, you need to follow the instructions to Install the Samples, Binaries and Docker Images in the Hyperledger Fabric documentation.

Unable to install Docker on Azure VM

I have an Azure VM on which I am trying to install docker. The installation proceeds smoothly. When I try to run the hello world example of docker, I get this error docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
This is the procedure I followed. I have run the docker with sudo. I can't figure out what is causing the problem. Any helps on figuring out this would be much appreciated. I have scoured the internet on fixing this issue. Nothing has worked. I have uninstalled docker completely, and reinstalled it again. Nothing seems to work.
EDIT: I have narrowed down the problem to the fact that the daemon has to be started manually. How do I ensure the daemon starts running as soon as the machine is up or docker is started? Running sudo dockerd and then running docker run hello-world seems to work.
It looks like you are trying to run docker commands as a non-root user.
To achieve that you have to add your user to the docker group, but bear in mind that this can be a security risk, as this group grants root equivalent privileges.
You can find the detailed configuration steps in the post-installation for Linux and information about the risks in the Docker daemon attack surface description
Seems like you daemon isnt running - which VM did you create? Linux based? if so there are few thing regarding to the daemon you must do in order to make the docker work - You need to configure your "daemon.json" or create one if you dont have - Here's the docker documentation that might help you with it -
https://docs.docker.com/config/daemon/
Best of luck!

Resources