Search code examples
kuberneteshyperledger-fabricdocker-in-docker

How to browse logs of a Hyperledger Fabric 2.2.2 Java chaincode deployed in Kubernetes using DinD (tcp)


I am having a problem in a Fabric network (v2.2.2) deployed in Kubernetes using Docker (DinD). I get a 500 error returned when I do a "peer chaincode query...":

Error: endorsement failure during query. response: status:500 message:"error in simulation: transaction returned with failure: Unexpected error"

but I can't find any logs in the peer node (just a GET entry showing 200). I also can't find anywhere the chaincode pod... how can I locate the pod where the chaincode is running? (Or any other alternative way to see it logs... not it's Kubernetes, not Docker). the Java chaincode was correctly installed, approved and commited by Hyperledger Bevel, and I can execute peer chaincode invoke commands (and I see the channel "height" increase, so the blockchain is being updated. I just can't query. I suspect it is a code problem of the specific method I am querying but I can't see any info other than 500. What should I look for that instance? (The Docker pod also shows no logs)


Solution

  • The answer was pretty simple, once you realice that DinD (Docker in Docker) is completely isolated from Kubernetes, so Kubernetes cluster will never know anything about the dockers created inside a docker. It will never be shown as a pod or container. They are not Pods. Just "kubectl exec..." into the docker pod and do "docker ps" to see running dockers. Then a "docker log..." will show logs on the specific docker (the one running the Java Chaincode in my case)