Problem in ./startFabric.sh: Error response from daemon: Container is not running - docker

I have been using hyperledger composer for a long time. I have installed hyperledger composer on a new machine but on the command ./startFabric.sh it is ending with the following error
Development only script for Hyperledger Fabric control
Running 'startFabric.sh'
FABRIC_VERSION is unset, assuming hlfv12
FABRIC_START_TIMEOUT is unset, assuming 15 (seconds)
Stopping orderer.example.com ... done
Stopping couchdb ... done
Stopping ca.org1.example.com ... done
Removing peer0.org1.example.com ... done
Removing orderer.example.com ... done
Removing couchdb ... done
Removing ca.org1.example.com ... done
Removing network composer_default
Creating network "composer_default" with the default driver
Creating ca.org1.example.com ...
Creating couchdb ...
Creating orderer.example.com ...
Creating orderer.example.com
Creating ca.org1.example.com
Creating orderer.example.com ... done
Creating peer0.org1.example.com ...
Creating peer0.org1.example.com ... done
sleeping for 15 seconds to wait for fabric to complete start up
Error response from daemon: Container abf272793595d47750a9b3ab8f381f183f64bcdf3b9c21fba00bef6de6517060 is not running
This command is running fine on older machine but on new machine it is giving this error I have installed it by following the link https://hyperledger.github.io/composer/latest/installing/installing-index
Please help... I am seriously tired of this. I have also tried solutions on web nothing helped...

I faced the same issue too. after searching all different answers in stackoverflow , i finally managed to find one that works for me .. all thanks to the contributor .
below is the step :
to solve this issue. Needed to add below line under environment: in docker-compose.yaml file for orderer and peer containers in your hlfv12 script subdir.
- GODEBUG=netdns=go
Hope this work for you too .

Related

Port conflicts in starting test-network of Hyperledger Fabric using fabric-samples folder

I'm a new starter and have been struggling for a while about these port errors
When I run ./network.sh in the directory: fabric-samples/test-network
the following port errors occurred:
yujindeMBP:test-network yujin$ ./network.sh up
Starting nodes with CLI timeout of '5' tries and CLI delay of '3' seconds and using database 'leveldb' with crypto from 'cryptogen'
LOCAL_VERSION=2.3.0
DOCKER_IMAGE_VERSION=2.3.0
/Users/yujin/fabric-samples-with-bis/test-network/../bin/cryptogen
Generating certificates using cryptogen tool
Creating Org1 Identities
+ cryptogen generate --config=./organizations/cryptogen/crypto-config-org1.yaml --output=organizations
org1.example.com
+ res=0
Creating Org2 Identities
+ cryptogen generate --config=./organizations/cryptogen/crypto-config-org2.yaml --output=organizations
org2.example.com
+ res=0
Creating Orderer Org Identities
+ cryptogen generate --config=./organizations/cryptogen/crypto-config-orderer.yaml --output=organizations
+ res=0
Generating CCP files for Org1 and Org2
Creating network "net_test" with the default driver
Creating volume "net_orderer.example.com" with default driver
Creating volume "net_peer0.org1.example.com" with default driver
Creating volume "net_peer0.org2.example.com" with default driver
Creating orderer.example.com ... error
Creating peer0.org2.example.com ...
Creating peer0.org1.example.com ...
Creating peer0.org1.example.com ... error
Creating peer0.org2.example.com ... done
ERROR: for peer0.org1.example.com Cannot start service peer0.org1.example.com: Ports are not available: listen tcp 0.0.0.0:7051: bind: address already in use
ERROR: for orderer.example.com Cannot start service orderer.example.com: Ports are not available: listen tcp 0.0.0.0:7050: bind: address already in use
ERROR: for peer0.org1.example.com Cannot start service peer0.org1.example.com: Ports are not available: listen tcp 0.0.0.0:7051: bind: address already in use
ERROR: Encountered errors while bringing up the project.
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
6feb86580f43 hyperledger/fabric-orderer:latest "orderer" 1 second ago Created orderer.example.com
dbfae1aa4c11 hyperledger/fabric-peer:latest "peer node start" 1 second ago Created peer0.org1.example.com
d0367a0d6089 hyperledger/fabric-peer:latest "peer node start" 1 second ago Up Less than a second 7051/tcp, 0.0.0.0:9051->9051/tcp peer0.org2.example.com
It seems the orderer, the org1 and the org2 are using the same ports 7050 and 7051, they got conflicted with each other. I have thought I can avoid these port errors by running docker. However, it seems that I'm wrong. I checked the docker environment before I run ./network.sh and I'm sure no other processes are running in the same time.
yujindeMBP:test-network yujin$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
The docker's processes table is clear before I tried to start the test-network.
I'm really confused and need your help. Thanks a lot!
Try docker ps -a This list all the active container.
Remove containers using the command docker rm -f [container_id/container_name]
once all containers removed then bring back your network.
If you're still facing the issue then go to your crypto-config-org1.yaml, crypto-config-org2.yaml, crypto-config-orderer.yaml edit and change the ports. Also you can ask question on https://chat.hyperledger.org/

docker-compose redis won't start : docker-entrypoint.sh: Permission denied

I try to get started with docker-compose : https://docs.docker.com/compose/gettingstarted/ (i've exactly the files described there)
I do it on a debian (stretch) server.
It all goes well until I do docker-compose up:
the web service goes up all right but redis service can't start docker-entrypoint.sh and exits.
root#12456:~/composeTest# docker-compose up
Creating network "composetest_default" with the default driver
Creating composetest_redis_1 ... done
Creating composetest_web_1 ... done
Attaching to composetest_redis_1, composetest_web_1
redis_1 | su-exec: /usr/local/bin/docker-entrypoint.sh: Permission denied
composetest_redis_1 exited with code 1
...
web_1 | * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
I feel like I'm the only one with this issue, so maybe it's something so dumb everybody figured it out right away!
Thanks.

Unable to bind port 80

I'm using docker compose to run a simple web server project I created. This configuration has been working fine for months but suddenly stopped working after I haven't been to the office for two weeks.
It works when I map my ports like that - 8080:80, but I don't want to have to type out port 8080 every time. I used netstat -a -n -o | findstr /c:80 to find the process ID of the process listening to port 80, and tasklist /fi "pid eq 4" to find out what the name of the process is.
Turns out it's some system process, so I'm not sure what to do about that. I've uninstalled Skype and checked that the World Wide Web Publishing Service isn't turned on. Does anybody have an explanation or ideas as to how to fix this?
Thanks in advance.
update
when I run net stop http and kill all dependant services with it, port 80 is free. Services being stopped: Windows Remote Management (WS-Management), SSDP Discovery, Print Spooler, BranchCache and HTTP of course. Which of these could be the culprit?
update 2
I now stopped those services one by one, and after stopping every one of those it seems BranchCache is responsible for this. more testing ensues
docker-compose.yml
version: "3"
services:
vote-client:
build:
context: .
dockerfile: Dockerfile
ports:
- "80:80"
Dockerfile
FROM nginx
COPY ./html /usr/share/nginx/html
when I run docker-compose up this is my output:
docker-compose up --build
Removing vote-client_vote-client_1
Building vote-client
Step 1/2 : FROM nginx
---> 42b4762643dc
Step 2/2 : COPY ./html /usr/share/nginx/html
---> Using cache
---> a1aade2a299e
Successfully built a1aade2a299e
Successfully tagged vote-client_vote-client:latest
Recreating c2654f31dcff_vote-client_vote-client_1 ... error
ERROR: for c2654f31dcff_vote-client_vote-client_1 Cannot start service vote-client: driver failed programming external connectivity on endpoint vote-client_vote-client_1 (2188c8607a04ba2388a661504601431d6b30825d595dafae0c318f2d2b5685b0): Error starting userland proxy: Bind for 0.0.0.0:80: unexpected error Permission denied
ERROR: for vote-client Cannot start service vote-client: driver failed programming external connectivity on endpoint vote-client_vote-client_1 (2188c8607a04ba2388a661504601431d6b30825d595dafae0c318f2d2b5685b0): Error starting userland proxy: Bind for 0.0.0.0:80: unexpected error Permission denied
ERROR: Encountered errors while bringing up the project.

hyperledger-fabric byfn.sh -m failed with script/scripts.sh not found

I am running the byfn.sh script within docker container on windows 10.
Docker version 18.03.0-ce, build 0520e24302
I am getting the script.sh not found error message, please help.
$ ./byfn.sh -m up
Starting with channel 'mychannel' and CLI timeout of '10' seconds and CLI
delay of '3' seconds
Continue? [Y/n] y
proceeding ...
2018-04-28 20:28:24.254 UTC [main] main -> INFO 001 Exiting.....
LOCAL_VERSION=1.1.0
DOCKER_IMAGE_VERSION=1.1.0
Starting peer1.org2.example.com ... done
Starting peer0.org2.example.com ... done
Starting peer1.org1.example.com ... done
Starting peer0.org1.example.com ... done
Starting orderer.example.com ... done
cli is up-to-date
OCI runtime exec failed: exec failed: container_linux.go:348: starting container process caused "exec: \"scripts/script.sh\": stat scripts/script.sh: no such file or directory": unknown
ERROR !!!! Test failed
Resolved the issue by copying the entire fabric-samples directory to c:\users\ directory.
Having the fabric-samples directory anywhere else on c:\ drive gives the error. Perhaps an explicit path needs to be defined somewhere if placing fabric-samples in any location other than c:\users\
I figured that the volumes from the docker container under Windows are not correctly mounted (not at all). But I don't know how to fix it... I'll get back if I have more information on this issue or even a solution.

Docker on RHEL 6 Cgroup mounting failing

I'm trying to get my head around something that's been working on a Centos+Vagrant, but not on our providers RHEL (Red Hat Enterprise Linux Server release 6.5 (Santiago)). A sudo service docker restart hands this:
Stopping docker: [ OK ]
Starting cgconfig service: Error: cannot mount cpuset to /cgroup/cpuset: Device or resource busy
/sbin/cgconfigparser; error loading /etc/cgconfig.conf: Cgroup mounting failed
Failed to parse /etc/cgconfig.conf [FAILED]
Starting docker: [ OK ]
The service starts okey enough, but images cannot run. A mounting failed error is shown when I try. And the startup-log also gives a warning or two. Regarding the kernelwarning, centos gives the same and has no problems as Epel should resolve this:
WARNING: You are running linux kernel version 2.6.32-431.17.1.el6.x86_64, which might be unstable running docker. Please upgrade your kernel to 3.8.0.
2014/08/07 08:58:29 docker daemon: 1.1.2 d84a070; execdriver: native; graphdriver:
[1233d0af] +job serveapi(unix:///var/run/docker.sock)
[1233d0af] +job initserver()
[1233d0af.initserver()] Creating server
2014/08/07 08:58:29 Listening for HTTP on unix (/var/run/docker.sock)
[1233d0af] +job init_networkdriver()
[1233d0af] -job init_networkdriver() = OK (0)
2014/08/07 08:58:29 WARNING: mountpoint not found
Anyone had any success overcoming this problem or should I throw in the towel and wait for the provider to update to RHEL 7?
I have the same issue.
(1) check cgconfig status
# /etc/init.d/cgconfig status
if it stopped, restart it
# /etc/init.d/cgconfig restart
check cgconfig is running
(2) check cgconfig is on
# chkconfig --list cgconfig
cgconfig 0:off 1:off 2:off 3:off 4:off 5:off 6:off
if cgconfig is off, turn it on
(3) if still does not work, may be some cgroups modules is missing. In the kernel .config file, make menuconfig, add those modules into kernel and recompile and reboot
after that, it should be OK
I ended up asking the same question at Google Groups and in the end finding a solution with some help. What worked for me was this:
umount cgroup
sudo service cgconfig start
The project of making Docker work was put on halt all the same. Later a problem of network connection for the containers. This took to much time to solve and had to give up.
So I spent the whole day trying to rig docker to work on my vps. I was running into this same error. Basically what it came down to was the fact that OpenVZ didn't support docker containers up until a couple months ago. Specifically this RHEL update:
https://openvz.org/Download/kernel/rhel6/042stab105.14
Assuming this is your problem, or some variation of it, the burden of solving it is on your host. They will need to follow these steps:
https://openvz.org/Docker_inside_CT
In my case
/etc/rc.d/rc.cgconfig start
was generating
Starting cgconfig service: Error: cannot mount cpu,cpuacct,memory to
/cgroup/cpu_and_mem: Device or resource busy /usr/sbin/cgconfigparser;
error loading /etc/cgconfig.conf: Cgroup mounting failed Failed to
parse /etc/cgconfig.conf
i had to use:
/etc/rc.d/rc.cgconfig restart
and it automagicly umouted and mounted groups
Stopping cgconfig service: Starting cgconfig service:
it seems like the cgconfig service not running,so check it!
# /etc/init.d/cgconfig status
# mkdir -p /cgroup/cpuacct /cgroup/memory /cgroup/devices /cgroup/freezer net_cls /cgroup/blkio
# cat /etc/cgconfig.conf |tail|grep "="|awk '{print "mount -t cgroup -o",$1,$1,$NF}'>cgroup_mount.sh
# sh ./cgroup_mount.sh
# /etc/init.d/cgconfig restart
# /etc/init.d/docker restart
This situation occurs when the kernel is booted with cgroup_disable=memory and /etc/cgconfig.conf contains memory = /cgroup/memory;
This causes only /cgroup/cpuset to be mounted instead of the full set.
Solution: either remove cgroup_disable=memory from your kernel boot options or comment out memory = /cgroup/memory; from cgconfig.conf.
The cgconfig service startup uses mount and umount which requires an extra privilege bump from docker.
See the --privileged=true flag here for more info.
I was able to overcome this issue by starting my container with:
docker run -it --privileged=true my-image.
Tested in Centos6, Centos6.5.

Resources