Leon
Leon

Reputation: 31

Cannot bring down hyperledger-fabric started sample networks - permission denied

I followed instructions, given in: edx.courses (LinuxFoundationX: LFS171x Blockchain for Business - An Introduction to Hyperledger Technologies), which is similar to to official guide of hlf (https://hyperledger-fabric.readthedocs.io/en/release-1.1/build_network.html).

Snaped Image: Ubuntu18.04 @VMware Workstation (Host: Win10)

Most interesting parts:

$ curl -sSL https://raw.githubusercontent.com/hyperledger/fabric/master/scripts/bootstrap.sh | bash -s 1.1.0
$ export PATH=$PWD/bin:$PATH
$ git clone https://github.com/hyperledger/fabric-samples.git
$ cd fabric-samples/first-network
$ ./byfn.sh -m generate
$ ./byfn.sh -m up
========= All GOOD, BYFN execution completed =========== 
 _____   _   _   ____   
| ____| | \ | | |  _ \  
|  _|   |  \| | | | | | 
| |___  | |\  | | |_| | 
|_____| |_| \_| |____/  

Now network is up and working. So, let's bring it down without changes:

t1@ubuntu:~/fabric-samples/first-network$ ./byfn.sh -m down
Stopping with channel 'mychannel' and CLI timeout of '10' seconds and CLI delay of '3' seconds
Continue? [Y/n] 
proceeding ...
Stopping cli                    ... error
Stopping peer1.org1.example.com ... error
Stopping peer1.org2.example.com ... error
Stopping peer0.org2.example.com ... error
Stopping peer0.org1.example.com ... error
Stopping orderer.example.com    ... error

ERROR: for cli  cannot stop container: 743f05760adc094bf402c4d80f76212abe4013e274b4ce5fef49ab40d265431d: Cannot kill container 743f05760adc094bf402c4d80f76212abe4013e274b4ce5fef49ab40d265431d: unknown error after kill: docker-runc did not terminate sucessfully: container_linux.go:387: signaling init process caused "permission denied"
: unknown
Removing network net_byfn
ERROR: error while removing network: network net_byfn id d75ceca2566ded50e7e9a2dce912e54df9b6d243baa8b7e2dade3f72da5d3815 has active endpoints
Stopping cli                    ... error
Stopping peer1.org1.example.com ... error
Stopping peer1.org2.example.com ... error
Stopping peer0.org2.example.com ... error
Stopping peer0.org1.example.com ... error
Stopping orderer.example.com    ... error

ERROR: for cli  cannot stop container: 743f05760adc094bf402c4d80f76212abe4013e274b4ce5fef49ab40d265431d: Cannot kill container 743f05760adc094bf402c4d80f76212abe4013e274b4ce5fef49ab40d265431d: unknown error after kill: docker-runc did not terminate sucessfully: container_linux.go:387: signaling init process caused "permission denied"
: unknown
Removing network net_byfn
ERROR: error while removing network: network net_byfn id 

Troubleshooting

$ docker rmi -f $(docker images -q) 

Will not work:

Deleted: sha256:fd96d34cdd7035e9d7c4fdf4dae4e9c8d4a2e9a5f082a13043bafb5109992a0a
Deleted: sha256:809c70fab2ffe494878efb5afda03b2aaeda26a6113428f1a9a907a800c3bbb7
Deleted: sha256:833649a3e04c96faf218d8082b3533fa0674664f4b361c93cad91cf97222b733
Error response from daemon: conflict: unable to delete be773bfc074c (cannot be forced) - image is being used by running container 546cfd593673
Error response from daemon: conflict: unable to delete 0592b563eec8 (cannot be forced) - image is being used by running container d36402eba8e7
Error response from daemon: conflict: unable to delete 4460ed7ada01 (cannot be forced) - image is being used by running container 6247fdfca8f2
Error: No such image: 72617b4fa9b4
Error response from daemon: conflict: unable to delete b7bfddf508bc (cannot be forced) - image is being used by running container 743f05760adc
Error response from daemon: conflict: unable to delete b7bfddf508bc (cannot be forced) - image is being used by running container 743f05760adc
Error response from daemon: conflict: unable to delete ce0c810df36a (cannot be forced) - image is being used by running container 2314bf8b86b0
Error response from daemon: conflict: unable to delete ce0c810df36a (cannot be forced) - image is being used by running container 2314bf8b86b0
Error response from daemon: conflict: unable to delete b023f9be0771 (cannot be forced) - image is being used by running container 98307e956bd5
Error response from daemon: conflict: unable to delete b023f9be0771 (cannot be forced) - image is being used by running container 541ff05a7925
Error: No such image: 82098abb1a17
Error: No such image: c8b4909d8d46
Error: No such image: 92cbb952b6f8
Error: No such image: 554c591b86a8
Error: No such image: 7e73c828fc5b
Error response from daemon: conflict: unable to delete 220e5cf3fb7f (cannot be forced) - image has dependent child images

Thx for ur support. (is my first post here, hope it's all fine for your expectation.)

Upvotes: 2

Views: 715

Answers (3)

Farkhod Abdukodirov
Farkhod Abdukodirov

Reputation: 934

The same problem in case of Linux Ubuntu:

$sudo systemctl daemon-reload
$sudo systemctl restart docker 
$docker ps -qa|xargs docker rm

Upvotes: 0

tech_oreo
tech_oreo

Reputation: 21

Try running below set of command's one by one, it will help you to clean docker containers so you can start fresh

docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
docker volume prune
docker network prune

Note: This wont remove Hyperledger images so no need to worry about reinstalling anything

Upvotes: 1

Anthony Garcia-Labiad
Anthony Garcia-Labiad

Reputation: 3711

First, deleting the images using docker rmi -f $(docker images -q) won't work, because you have unterminated containers using those images.

The ./byfn.sh -m down script tried to stop the containers spawn by fabriq but there was an error as you can see in the log: signaling init process caused "permission denied": unknown.

The cause of this error is usually AppArmor, try to run:

sudo aa-remove-unknown

and/or to stop the AppArmor service using:

sudo service apparmor stop
sudo update-rc.d -f apparmor remove

Upvotes: 1

Related Questions