Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to approve chaincode #167

Open
puneetmathur-87 opened this issue May 31, 2023 · 3 comments
Open

Not able to approve chaincode #167

puneetmathur-87 opened this issue May 31, 2023 · 3 comments

Comments

@puneetmathur-87
Copy link

I am trying a simple demo setup using the steps provided but I am stuck at the chaincode approve step and it shows the below error:

kubectl hlf chaincode approveformyorg --config=org1.yaml --user=admin --peer=org1-peer0.hyperledger    --package-id=$PACKAGE_ID --name=asset --channel=demo
Error: failed to get discovery service: could not get chConfig cache reference: QueryBlockConfig failed: QueryBlockConfig failed: queryChaincode failed: Multiple errors occurred: - Transaction processing for endorser [peer1-org1.localho.st:443]: Chaincode status Code: (500) UNKNOWN. Description: channel 'demo' not found - Transaction processing for endorser [peer0-org1.localho.st:443]: Chaincode status Code: (500) UNKNOWN. Description: channel 'demo' not found

But the channel and the chaincode both exists :

kubectl get fabricmainchannel -A
NAME   STATE   AGE
demo           27h
kubectl get fabricchaincodes -A 
NAMESPACE     NAME    STATE   AGE
default       asset           23h
hyperledger   asset           25h

One strange thing I noticed in the peer pod logs that the grpc stream calls always cancelled whereas the unary calls are always successful:

2023-05-31 17:11:26.124 UTC 0020 INFO [gossip.comm] GossipStream -> Peer 7820ccd89778b0a09cfe6546ffd5fc6949bad9f53d0f745ca177ac7094d449e3 (127.0.0.1:35946) probed us
2023-05-31 17:11:26.125 UTC 0021 INFO [comm.grpc.server] 1 -> streaming call completed grpc.service=gossip.Gossip grpc.method=GossipStream grpc.request_deadline=2023-05-31T17:11:36.124Z grpc.peer_address=127.0.0.1:35946 grpc.peer_subject="CN=peer,OU=peer" grpc.code=OK grpc.call_duration=843.525µs
2023-05-31 17:11:26.127 UTC 0022 INFO [comm.grpc.server] 1 -> unary call completed grpc.service=gossip.Gossip grpc.method=Ping grpc.request_deadline=2023-05-31T17:11:28.127Z grpc.peer_address=127.0.0.1:35960 grpc.peer_subject="CN=peer,OU=peer" grpc.code=OK grpc.call_duration=52.861µs
2023-05-31 17:11:26.128 UTC 0023 INFO [comm.grpc.server] 1 -> streaming call completed grpc.service=gossip.Gossip grpc.method=GossipStream grpc.peer_address=127.0.0.1:35960 grpc.peer_subject="CN=peer,OU=peer" error="rpc error: code = Canceled desc = context canceled" grpc.code=Canceled grpc.call_duration=1.06331ms
2023-05-31 17:11:56.130 UTC 0024 INFO [comm.grpc.server] 1 -> unary call completed grpc.service=gossip.Gossip grpc.method=Ping grpc.request_deadline=2023-05-31T17:11:58.129Z grpc.peer_address=127.0.0.1:59284 grpc.peer_subject="CN=peer,OU=peer" grpc.code=OK grpc.call_duration=80.821µs
2023-05-31 17:11:56.132 UTC 0025 INFO [comm.grpc.server] 1 -> streaming call completed grpc.service=gossip.Gossip grpc.method=GossipStream grpc.peer_address=127.0.0.1:59284 grpc.peer_subject="CN=peer,OU=peer" error="rpc error: code = Canceled desc = context canceled" grpc.code=Canceled grpc.call_duration=1.668438ms
2023-05-31 17:11:56.139 UTC 0026 INFO [comm.grpc.server] 1 -> unary call completed grpc.service=gossip.Gossip grpc.method=Ping grpc.request_deadline=2023-05-31T17:11:58.139Z grpc.peer_address=10.244.1.3:55994 grpc.peer_subject="CN=peer,OU=peer" grpc.code=OK grpc.call_duration=52.413µs
2023-05-31 17:11:56.141 UTC 0027 INFO [comm.grpc.server] 1 -> streaming call completed grpc.service=gossip.Gossip grpc.method=GossipStream grpc.peer_address=10.244.1.3:55994 grpc.peer_subject="CN=peer,OU=peer" error="rpc error: code = Canceled desc = context canceled" grpc.code=Canceled grpc.call_duration=1.145974ms
@puneetmathur-87
Copy link
Author

Can someone help on this issue?

@pshgpt
Copy link

pshgpt commented Jun 5, 2023

export SEQUENCE=1
export VERSION="1.0"
kubectl hlf chaincode approveformyorg --config=org1.yaml --user=admin --peer=org1-peer0.default
--package-id=$PACKAGE_ID
--version "$VERSION" --sequence "$SEQUENCE" --name=asset
--policy="OR('Org1MSP.member')" --channel=demo

This is the correct command for approving the chaincode. Please check if you are using the correct one or not

@djseku
Copy link

djseku commented May 24, 2024

Having the exact same usse, did you manage to fix it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants