Peer chaincode instantiation timeout expired

+1 vote

I use CA to create a multi-node fabric network.

This is the code I am using: https://github.com/fnpac/fabric-web/blob/master/fabric-ca/scripts/run-fabric.sh

Peer config: https://github.com/fnpac/fabric-web/blob/ce7929e59b0ba1bc3a55d16ea66fa08131c294dc/fabric-ca/makeDocker.sh#L207-L272

When I instantiate chaincode, it will report the following error:

##### 2018-05-22 09:14:49 Instantiating chaincode on peer1-org2 ...
2018-05-22 09:14:49.374 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2018-05-22 09:14:49.375 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2018-05-22 09:14:49.382 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default escc
2018-05-22 09:14:49.382 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default vscc
2018-05-22 09:14:49.383 UTC [chaincodeCmd] getChaincodeSpec -> DEBU 005 java chaincode disabled
2018-05-22 09:14:49.383 UTC [msp/identity] Sign -> DEBU 006 Sign: plaintext: 0AAB090A6708031A0C0889BF8FD80510...324D53500A04657363630A0476736363 
2018-05-22 09:14:49.383 UTC [msp/identity] Sign -> DEBU 007 Sign: digest: 754973C8F271A44D0933CD73D9219A51DA5FDD2E84938E6EA10F9DA3E2981692 
Error: Error endorsing chaincode: rpc error: code = Unknown desc = timeout expired while starting chaincode mycc:1.0(networkid:dev,peerid:peer1-org2,tx:a93b69c5243e04171ca16188e733d03671d93bb606819b101125642410d0c911)
Usage:
  peer chaincode instantiate [flags]

Flags:
  -C, --channelID string            The channel on which this command should be executed

And the Orderer's log :

2018-05-22 09:19:49.391 UTC [dockercontroller] stopInternal -> DEBU 5e1 Kill container dev-peer1-org2-mycc-1.0 (API error (409): {"message":"Cannot kill container: dev-peer1-org2-mycc-1.0: Container 9751bded21b329c2b516386d78fd7a751833fccdde5104a96dcf3f22304ff0d8 is not running"}
)
2018-05-22 09:19:49.400 UTC [dockercontroller] stopInternal -> DEBU 5e2 Removed container dev-peer1-org2-mycc-1.0
2018-05-22 09:19:49.400 UTC [container] unlockContainer -> DEBU 5e3 container lock deleted(dev-peer1-org2-mycc-1.0)
2018-05-22 09:19:49.400 UTC [chaincode] func1 -> DEBU 5e4 chaincode mycc:1.0 launch seq completed
2018-05-22 09:19:49.400 UTC [chaincode] Launch -> ERRO 5e5 launchAndWaitForRegister failed: timeout expired while starting chaincode mycc:1.0(networkid:dev,peerid:peer1-org2,tx:a93b69c5243e04171ca16188e733d03671d93bb606819b101125642410d0c911)
github.com/hyperledger/fabric/core/chaincode.(*ChaincodeSupport).launchAndWaitForRegister
    /opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/chaincode_support.go:569
github.com/hyperledger/fabric/core/chaincode.(*ChaincodeSupport).Launch
    /opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/chaincode_support.go:731
github.com/hyperledger/fabric/core/chaincode.Execute
    /opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/exectransaction.go:45
github.com/hyperledger/fabric/core/endorser.(*SupportImpl).Execute
    /opt/gopath/src/github.com/hyperledger/fabric/core/endorser/support.go:83
github.com/hyperledger/fabric/core/endorser.(*Endorser).callChaincode
    /opt/gopath/src/github.com/hyperledger/fabric/core/endorser/endorser.go:164
github.com/hyperledger/fabric/core/endorser.(*Endorser).simulateProposal
    /opt/gopath/src/github.com/hyperledger/fabric/core/endorser/endorser.go:265
github.com/hyperledger/fabric/core/endorser.(*Endorser).ProcessProposal
    /opt/gopath/src/github.com/hyperledger/fabric/core/endorser/endorser.go:491
github.com/hyperledger/fabric/core/handlers/auth/filter.(*expirationCheckFilter).ProcessProposal
    /opt/gopath/src/github.com/hyperledger/fabric/core/handlers/auth/filter/expiration.go:61
github.com/hyperledger/fabric/core/handlers/auth/filter.(*filter).ProcessProposal
    /opt/gopath/src/github.com/hyperledger/fabric/core/handlers/auth/filter/filter.go:31
github.com/hyperledger/fabric/protos/peer._Endorser_ProcessProposal_Handler
    /opt/gopath/src/github.com/hyperledger/fabric/protos/peer/peer.pb.go:112
github.com/hyperledger/fabric/vendor/google.golang.org/grpc.(*Server).processUnaryRPC
    /opt/gopath/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/server.go:781
github.com/hyperledger/fabric/vendor/google.golang.org/grpc.(*Server).handleStream
    /opt/gopath/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/server.go:981
github.com/hyperledger/fabric/vendor/google.golang.org/grpc.(*Server).serveStreams.func1.1
    /opt/gopath/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/server.go:551
runtime.goexit
    /opt/go/src/runtime/asm_amd64.s:2337
2018-05-22 09:19:49.400 UTC [endorser] callChaincode -> DEBU 5e6 [mychannel][a93b69c5] Exit
2018-05-22 09:19:49.400 UTC [endorser] simulateProposal -> ERRO 5e7 [mychannel][a93b69c5] failed to invoke chaincode name:"lscc" , error: timeout expired while starting chaincode mycc:1.0(networkid:dev,peerid:peer1-org2,tx:a93b69c5243e04171ca16188e733d03671d93bb606819b101125642410d0c911)
github.com/hyperledger/fabric/core/chaincode.(*ChaincodeSupport).launchAndWaitForRegister
    /opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/chaincode_support.go:569
github.com/hyperledger/fabric/core/chaincode.(*ChaincodeSupport).Launch
    /opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/chaincode_support.go:731

how can i resolve?

Sep 19, 2018 in Blockchain by slayer
• 29,370 points
3,302 views

2 answers to this question.

+1 vote
Best answer

Hey, i think you made a slight blunder. Seems like you ran the script on different machine.

# Instantiate the chain code on the first peer node of the first peer organization
 makePolicy
 initPeerVars ${PORGS[0]} 1
 switchToAdminIdentity
 Logr "Instantiating chaincode on $PEER_HOST ..."
 Peer chaincode instantiate -C $CHANNEL_NAME -n mycc -v 1.0 -c '{"Args":["init","a","100","b","200"]}' -P "$POLICY" $ORDERER_CONN_ARGS

The above script should be executed on the machine of the first peer node of the first peer organization. If you execute the script on other machines, it will be Timeout

answered Sep 19, 2018 by digger
• 26,740 points

selected May 1, 2019 by Omkar
–1 vote
hey check chaincode versions
answered Mar 2, 2019 by blockchainer
Hi.. thanks for the advice but the chain code versions are same. But still got this error. Any other solutions?

Related Questions In Blockchain

0 votes
0 answers
+1 vote
0 answers
+15 votes
5 answers
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
1,947 views
0 votes
1 answer

Hyperledger Sawtooth vs Quorum in concurrency and speed Ask

Summary: Both should provide similar reliability of ...READ MORE

answered Sep 26, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
1,470 views
+1 vote
1 answer

Language in which cryptokitties is programmed?

Cryptokitties is built on the Ethereum network. The ...READ MORE

answered Mar 27, 2018 in Blockchain by Johnathon
• 9,090 points
682 views
0 votes
1 answer
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP