when trying to chaincode instantiate,error - hyperledger-fabric

i'm studying the fabric ca operations guide document.
But when i trying to instantiate the chaincode , error occured.
Instantiate command:
peer chaincode instantiate -C mychannel -n mycc -v 1.0 -c '{"Args":["init","a","100","b","200"]}' -o orderer1-org0:7050 --tls --cafile /tmp/hyperledger/org2/peer1/tls-msp/tlscacerts/tls-0-0-0-0-7052.pem
error message :
2020-02-21 04:13:57.176 UTC [grpc] switchBalancer -> DEBU 045 ClientConn switching balancer to "pick_first"
2020-02-21 04:13:57.176 UTC [grpc] HandleSubConnStateChange -> DEBU 046 pickfirstBalancer: HandleSubConnStateChange: 0xc0003c3d70, CONNECTING
2020-02-21 04:13:57.179 UTC [grpc] HandleSubConnStateChange -> DEBU 047 pickfirstBalancer: HandleSubConnStateChange: 0xc0003c3d70, READY
2020-02-21 04:13:57.179 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 048 Using default escc
2020-02-21 04:13:57.179 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 049 Using default vscc
2020-02-21 04:13:57.180 UTC [msp.identity] Sign -> DEBU 04a Sign: plaintext: 0AD8080A6608031A0B0885B2BDF20510...30300A000A04657363630A0476736363
2020-02-21 04:13:57.180 UTC [msp.identity] Sign -> DEBU 04b Sign: digest: 5480C64F725F648C381B7820B6EA079636CA6C6A8C1D51319B30116653888FF1
Error: could not assemble transaction, err proposal response was not successful, error code 500, msg transaction returned with failure: Attribute 'abac.init' was not found
Can anyone explain to me? Thanks

Your Init function is being called when instantiating, but it is failing.
I suppose your chaincode is https://github.com/hyperledger/fabric-samples/blob/release-1.4/chaincode/abac/go/abac.go. The fact is that the requestor certificate should have the attribute "abac.init" to true, but yours haven't. That's defined during the Fabric CA registration and included in your enrolled certificate.

Related

Hyperledger Fabric chaincode throwing error while installation

I am trying to install chaincode written in golang. When I execute the installation command - peer chaincode install -n chaincode -v $CC_VERSION -p chaincode, it returns the following error after few seconds:
Error: error getting chaincode code chaincode: error getting chaincode package bytes: Error obtaining imports: command <go list -f {{ join .Imports "\n"}} chaincode>: failed with error: "timed out after 1m0s"
Last few lines of logs:
2021-01-03 04:49:24.666 UTC [msp] setupSigningIdentity -> DEBU 035 Signing identity expires at 2029-11-11 17:12:00 +0000 UTC
2021-01-03 04:49:24.666 UTC [msp] Validate -> DEBU 036 MSP Org1MSP validating identity
2021-01-03 04:49:24.756 UTC [grpc] DialContext -> DEBU 037 parsed scheme: ""
2021-01-03 04:49:24.756 UTC [grpc] DialContext -> DEBU 038 scheme "" not registered, fallback to default scheme
2021-01-03 04:49:24.756 UTC [grpc] watcher -> DEBU 039 ccResolverWrapper: sending new addresses to cc: [{peer0-org1:7051 0 <nil>}]
2021-01-03 04:49:24.756 UTC [grpc] switchBalancer -> DEBU 03a ClientConn switching balancer to "pick_first"
2021-01-03 04:49:24.756 UTC [grpc] HandleSubConnStateChange -> DEBU 03b pickfirstBalancer: HandleSubConnStateChange: 0xc0001f6b00, CONNECTING
2021-01-03 04:49:24.774 UTC [grpc] HandleSubConnStateChange -> DEBU 03c pickfirstBalancer: HandleSubConnStateChange: 0xc0001f6b00, READY
2021-01-03 04:49:24.825 UTC [grpc] DialContext -> DEBU 03d parsed scheme: ""
2021-01-03 04:49:24.825 UTC [grpc] DialContext -> DEBU 03e scheme "" not registered, fallback to default scheme
2021-01-03 04:49:24.825 UTC [grpc] watcher -> DEBU 03f ccResolverWrapper: sending new addresses to cc: [{peer0-org1:7051 0 <nil>}]
2021-01-03 04:49:24.825 UTC [grpc] switchBalancer -> DEBU 040 ClientConn switching balancer to "pick_first"
2021-01-03 04:49:24.825 UTC [grpc] HandleSubConnStateChange -> DEBU 041 pickfirstBalancer: HandleSubConnStateChange: 0xc000272e90, CONNECTING
2021-01-03 04:49:24.828 UTC [grpc] HandleSubConnStateChange -> DEBU 042 pickfirstBalancer: HandleSubConnStateChange: 0xc000272e90, READY
2021-01-03 04:49:24.889 UTC [msp] GetDefaultSigningIdentity -> DEBU 043 Obtaining default signing identity
2021-01-03 04:49:24.889 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 044 Using default escc
2021-01-03 04:49:24.889 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 045 Using default vscc
2021-01-03 04:49:25.312 UTC [chaincode.platform.golang] getCodeFromFS -> DEBU 046 getCodeFromFS chaincode
Error: error getting chaincode code chaincode: error getting chaincode package bytes: Error obtaining imports: command <go list -f {{ join .Imports "\n"}} chaincode>: failed with error: "timed out after 1m0s"
I also tried to compile and build the chaincode by executing go build command and it successfully generated the binary without throwing any error.

Hyperledger Fabric endorsement failing: txid exists

I am currently trying to successfully invoke a chaincode on an Hyperledger Fabric network using Docker Swarm, based on this example. My network is the following:
org1 with peer0.org1.com + 1 CA org1 + CLI org1 + orderer.example.com from ordererOrg on PC1
org2 with peer0.org2.com + 1 CA org2 on PC2
It seems that my network is working, but once a chaincode is instantiated on a peer then invoked, the operation is not propagated. E.g I insert data into the ledger, the chaincode container logs show that they process the data, the peer container used to invoke the chaincode seems to have correctly endorsed and simulated the query too. All of this using commands manually from inside the CLI.
peer0.org1.com container logs
2019-07-09 08:52:08.753 UTC [endorser] EndorseWithPlugin -> DEBU 3784 Entering endorsement for {plugin: escc, channel: mychannel, tx: 50732326bbe19c9eb8de42fa327ee67fc2c8102337ef96cdf9ca49fb7a0b7703, chaincode: fabcar}
2019-07-09 08:52:08.753 UTC [msp.identity] Sign -> DEBU 3785 Sign: plaintext: 0A2040CDC0100B7F12FA1505C311EF86...455254494649434154452D2D2D2D2D0A
2019-07-09 08:52:08.753 UTC [msp.identity] Sign -> DEBU 3786 Sign: digest: 5E7E6A043E851C3316B08F5CB4A05D31840D213793C55BF14EBE64213E852F84
2019-07-09 08:52:08.756 UTC [endorser] EndorseWithPlugin -> DEBU 3787 Exiting {plugin: escc, channel: mychannel, tx: 50732326bbe19c9eb8de42fa327ee67fc2c8102337ef96cdf9ca49fb7a0b7703, chaincode: fabcar}
2019-07-09 08:52:08.756 UTC [endorser] endorseProposal -> DEBU 3788 [mychannel][50732326] Exit
2019-07-09 08:52:08.756 UTC [lockbasedtxmgr] Done -> DEBU 3789 Done with transaction simulation / query execution [50732326bbe19c9eb8de42fa327ee67fc2c8102337ef96cdf9ca49fb7a0b7703]
2019-07-09 08:52:08.756 UTC [endorser] func1 -> DEBU 378a Exit: request from 10.0.0.4:34978
2019-07-09 08:52:08.756 UTC [comm.grpc.server] 1 -> INFO 378b unary call completed grpc.service=protos.Endorser grpc.method=ProcessProposal grpc.peer_address=10.0.0.4:34978 grpc.code=OK grpc.call_duration=8.895639ms
A (successfully executed) query on the ledger then shows that the ledger state didn't change.
However, if I use the node SDK provided in the fabcar example from the official samples repo (invoke.js) to invoke the same chaincode operation I get an error:
node sdk error with node invoke.js
2019-07-09T09:22:03.277Z - warn: [DiscoveryEndorsementHandler]: _build_endorse_group_member >> G0:1 - endorsement failed - Error: failed to execute transaction a0a2570dd9a4ce0c696ab08263320927382c6f3db046843dca70a96b63a97da9: error sending: txid: a0a2570dd9a4ce0c696ab08263320927382c6f3db046843dca70a96b63a97da9(mychannel) exists
Failed to submit transaction: Error: Endorsement has failed
peer0.org1.com container logs after node invoke
2019-07-09 09:22:03.273 UTC [endorser] callChaincode -> INFO 15480 [mychannel][a0a2570d] Entry chaincode: name:"fabcar"
2019-07-09 09:22:03.273 UTC [chaincode] Execute -> DEBU 15481 Entry
2019-07-09 09:22:03.273 UTC [chaincode] Execute -> DEBU 15482 Exit
2019-07-09 09:22:03.273 UTC [endorser] callChaincode -> INFO 15483 [mychannel][a0a2570d] Exit chaincode: name:"fabcar" (0ms)
2019-07-09 09:22:03.273 UTC [chaincode] handleMessage -> DEBU 15484 [a0a2570d] Fabric side handling ChaincodeMessage of type: PUT_STATE in state ready
2019-07-09 09:22:03.273 UTC [endorser] SimulateProposal -> ERRO 15485 [mychannel][a0a2570d] failed to invoke chaincode name:"fabcar" , error: txid: a0a2570dd9a4ce0c696ab08263320927382c6f3db046843dca70a96b63a97da9(mychannel) exists
github.com/hyperledger/fabric/core/chaincode.(*TransactionContexts).Create
/opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/transaction_contexts.go:59
github.com/hyperledger/fabric/core/chaincode.(*Handler).Execute
/opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/handler.go:1207
github.com/hyperledger/fabric/core/chaincode.(*ChaincodeSupport).execute
/opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/chaincode_support.go:313
github.com/hyperledger/fabric/core/chaincode.(*ChaincodeSupport).Invoke
/opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/chaincode_support.go:302
github.com/hyperledger/fabric/core/chaincode.(*ChaincodeSupport).Execute
/opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/chaincode_support.go:239
github.com/hyperledger/fabric/core/endorser.(*SupportImpl).Execute
/opt/gopath/src/github.com/hyperledger/fabric/core/endorser/support.go:147
github.com/hyperledger/fabric/core/endorser.(*Endorser).callChaincode
/opt/gopath/src/github.com/hyperledger/fabric/core/endorser/endorser.go:146
github.com/hyperledger/fabric/core/endorser.(*Endorser).SimulateProposal
/opt/gopath/src/github.com/hyperledger/fabric/core/endorser/endorser.go:247
github.com/hyperledger/fabric/core/endorser.(*Endorser).ProcessProposal
/opt/gopath/src/github.com/hyperledger/fabric/core/endorser/endorser.go:500
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:32
github.com/hyperledger/fabric/protos/peer._Endorser_ProcessProposal_Handler.func1
/opt/gopath/src/github.com/hyperledger/fabric/protos/peer/peer.pb.go:169
github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1
/opt/gopath/src/github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:31
github.com/hyperledger/fabric/core/comm.(*Throttle).UnaryServerIntercptor
/opt/gopath/src/github.com/hyperledger/fabric/core/comm/throttle.go:54
github.com/hyperledger/fabric/core/comm.(*Throttle).UnaryServerIntercptor-fm
/opt/gopath/src/github.com/hyperledger/fabric/peer/node/start.go:224
github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1
/opt/gopath/src/github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:34
github.com/hyperledger/fabric/common/grpclogging.UnaryServerInterceptor.func1
/opt/gopath/src/github.com/hyperledger/fabric/common/grpclogging/server.go:91
github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1
/opt/gopath/src/github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:34
github.com/hyperledger/fabric/common/grpcmetrics.UnaryServerInterceptor.func1
/opt/gopath/src/github.com/hyperledger/fabric/common/grpcmetrics/interceptor.go:30
github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1
/opt/gopath/src/github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:39
github.com/hyperledger/fabric/protos/peer._Endorser_ProcessProposal_Handler
/opt/gopath/src/github.com/hyperledger/fabric/protos/peer/peer.pb.go:171
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:982
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:1208
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:686
runtime.goexit
/opt/go/src/runtime/asm_amd64.s:1333
error sending
failed to execute transaction a0a2570dd9a4ce0c696ab08263320927382c6f3db046843dca70a96b63a97da9
github.com/hyperledger/fabric/core/chaincode.processChaincodeExecutionResult
/opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/chaincode_support.go:245
github.com/hyperledger/fabric/core/chaincode.(*ChaincodeSupport).Execute
/opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/chaincode_support.go:240
github.com/hyperledger/fabric/core/endorser.(*SupportImpl).Execute
/opt/gopath/src/github.com/hyperledger/fabric/core/endorser/support.go:147
github.com/hyperledger/fabric/core/endorser.(*Endorser).callChaincode
/opt/gopath/src/github.com/hyperledger/fabric/core/endorser/endorser.go:146
github.com/hyperledger/fabric/core/endorser.(*Endorser).SimulateProposal
/opt/gopath/src/github.com/hyperledger/fabric/core/endorser/endorser.go:247
github.com/hyperledger/fabric/core/endorser.(*Endorser).ProcessProposal
/opt/gopath/src/github.com/hyperledger/fabric/core/endorser/endorser.go:500
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:32
github.com/hyperledger/fabric/protos/peer._Endorser_ProcessProposal_Handler.func1
/opt/gopath/src/github.com/hyperledger/fabric/protos/peer/peer.pb.go:169
github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1
/opt/gopath/src/github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:31
github.com/hyperledger/fabric/core/comm.(*Throttle).UnaryServerIntercptor
/opt/gopath/src/github.com/hyperledger/fabric/core/comm/throttle.go:54
github.com/hyperledger/fabric/core/comm.(*Throttle).UnaryServerIntercptor-fm
/opt/gopath/src/github.com/hyperledger/fabric/peer/node/start.go:224
github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1
/opt/gopath/src/github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:34
github.com/hyperledger/fabric/common/grpclogging.UnaryServerInterceptor.func1
/opt/gopath/src/github.com/hyperledger/fabric/common/grpclogging/server.go:91
github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1
/opt/gopath/src/github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:34
github.com/hyperledger/fabric/common/grpcmetrics.UnaryServerInterceptor.func1
/opt/gopath/src/github.com/hyperledger/fabric/common/grpcmetrics/interceptor.go:30
github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1
/opt/gopath/src/github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:39
github.com/hyperledger/fabric/protos/peer._Endorser_ProcessProposal_Handler
/opt/gopath/src/github.com/hyperledger/fabric/protos/peer/peer.pb.go:171
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:982
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:1208
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:686
runtime.goexit
/opt/go/src/runtime/asm_amd64.s:1333
2019-07-09 09:22:03.273 UTC [endorser] SimulateProposal -> DEBU 15486 [mychannel][a0a2570d] Exit
2019-07-09 09:22:03.273 UTC [lockbasedtxmgr] Done -> DEBU 15487 Done with transaction simulation / query execution [a0a2570dd9a4ce0c696ab08263320927382c6f3db046843dca70a96b63a97da9]
2019-07-09 09:22:03.273 UTC [endorser] func1 -> DEBU 15488 Exit: request from 172.18.0.1:51702
2019-07-09 09:22:03.273 UTC [chaincode] HandleTransaction -> DEBU 15489 [a0a2570d] handling PUT_STATE from chaincode
2019-07-09 09:22:03.273 UTC [comm.grpc.server] 1 -> INFO 1548a unary call completed grpc.service=protos.Endorser grpc.method=ProcessProposal grpc.peer_address=172.18.0.1:51702 grpc.code=OK grpc.call_duration=4.573006ms
2019-07-09 09:22:03.274 UTC [chaincode] HandleTransaction -> DEBU 1548b [a0a2570d] Completed PUT_STATE. Sending RESPONSE
2019-07-09 09:22:03.274 UTC [chaincode] handleMessage -> DEBU 1548c [a0a2570d] Fabric side handling ChaincodeMessage of type: PUT_STATE in state ready
2019-07-09 09:22:03.274 UTC [chaincode] HandleTransaction -> DEBU 1548d [a0a2570d] handling PUT_STATE from chaincode
2019-07-09 09:22:03.274 UTC [chaincode] HandleTransaction -> DEBU 1548e [a0a2570d] Completed PUT_STATE. Sending RESPONSE
2019-07-09 09:22:03.275 UTC [chaincode] handleMessage -> DEBU 1548f [a0a2570d] Fabric side handling ChaincodeMessage of type: COMPLETED in state ready
2019-07-09 09:22:03.275 UTC [chaincode] Notify -> DEBU 15490 [a0a2570d] notifying Txid:a0a2570dd9a4ce0c696ab08263320927382c6f3db046843dca70a96b63a97da9, channelID:mychannel
2019-07-09 09:22:03.275 UTC [chaincode] Execute -> DEBU 15491 Exit
2019-07-09 09:22:03.275 UTC [endorser] callChaincode -> INFO 15492 [mychannel][a0a2570d] Exit chaincode: name:"fabcar" (3ms)
2019-07-09 09:22:03.275 UTC [lockbasedtxmgr] GetTxSimulationResults -> DEBU 15493 Simulation completed, getting simulation results
2019-07-09 09:22:03.275 UTC [lockbasedtxmgr] Done -> DEBU 15494 Done with transaction simulation / query execution [a0a2570dd9a4ce0c696ab08263320927382c6f3db046843dca70a96b63a97da9]
2019-07-09 09:22:03.275 UTC [endorser] SimulateProposal -> DEBU 15495 [mychannel][a0a2570d] Exit
2019-07-09 09:22:03.275 UTC [endorser] endorseProposal -> DEBU 15496 [mychannel][a0a2570d] Entry chaincode: name:"fabcar"
2019-07-09 09:22:03.275 UTC [endorser] endorseProposal -> DEBU 15497 [mychannel][a0a2570d] escc for chaincode name:"fabcar" is escc
2019-07-09 09:22:03.275 UTC [endorser] EndorseWithPlugin -> DEBU 15498 Entering endorsement for {plugin: escc, channel: mychannel, tx: a0a2570dd9a4ce0c696ab08263320927382c6f3db046843dca70a96b63a97da9, chaincode: fabcar}
2019-07-09 09:22:03.275 UTC [msp.identity] Sign -> DEBU 15499 Sign: plaintext: 0A20828C242C3048295EE0453AD5EA85...455254494649434154452D2D2D2D2D0A
2019-07-09 09:22:03.275 UTC [msp.identity] Sign -> DEBU 1549a Sign: digest: F3BEDFED5C78408FD01F0A41C0714245508FD2F5AEF8A34F33E7F3C61DEFF987
2019-07-09 09:22:03.275 UTC [endorser] EndorseWithPlugin -> DEBU 1549b Exiting {plugin: escc, channel: mychannel, tx: a0a2570dd9a4ce0c696ab08263320927382c6f3db046843dca70a96b63a97da9, chaincode: fabcar}
2019-07-09 09:22:03.276 UTC [endorser] endorseProposal -> DEBU 1549c [mychannel][a0a2570d] Exit
2019-07-09 09:22:03.276 UTC [lockbasedtxmgr] Done -> DEBU 1549d Done with transaction simulation / query execution [a0a2570dd9a4ce0c696ab08263320927382c6f3db046843dca70a96b63a97da9]
2019-07-09 09:22:03.276 UTC [endorser] func1 -> DEBU 1549e Exit: request from 172.18.0.1:51702
2019-07-09 09:22:03.276 UTC [comm.grpc.server] 1 -> INFO 1549f unary call completed grpc.service=protos.Endorser grpc.method=ProcessProposal grpc.peer_address=172.18.0.1:51702 grpc.code=OK grpc.call_duration=6.750666ms
I tried some solutions found on SO such as:
having anchor peers set for each org: was already done
setting CORE_PEER_LISTENADDRESS=org1.example.com:7051 -> failed the peer containers. If I set the address to 0.0.0.0:7051 the containers starts again but the error stays the same
restarting Docker / removing volumes / redownloading images: didn't change a thing
Further points:
The orderer doesn't seem to be notified, as we can see in its logs.
When I use node invoke.js I sometimes get this error, which disappears when I launch the command again. Peer logs don't show an error.
node invoke.js inconsistent error
2019-07-09T14:13:21.232Z - error: [AbstractStrategy]: constructor: No event hubs for strategy
Failed to submit transaction: Error: No event hubs for strategy
When I query using node, I'll sometimes get the following error:
node query.js inconsistent error
2019-07-09T13:23:13.602Z - error: [SingleQueryHandler]: evaluate: message=No peers available to query. Errors: [], stack=FabricError: No peers available to query. Errors: []
at SingleQueryHandler.evaluate (/home/path_to_dir/app/javascript/node_modules/fabric-network/lib/impl/query/singlequeryhandler.js:39:17)
at Transaction.evaluate (/home/path_to_dir/app/javascript/node_modules/fabric-network/lib/transaction.js:246:29)
at Contract.evaluateTransaction (/home/path_to_dir/app/javascript/node_modules/fabric-network/lib/contract.js:172:39)
at main (/home/path_to_dir/app/javascript/query.js:47:39)
at <anonymous>, name=FabricError
Failed to evaluate transaction: FabricError: No peers available to query. Errors: []
This error usually disappears when I start a query again but will pop off from time to time. When the query comes from the CLIorg1 it never happens.
Some probably useful files:
configtx.yaml
crypto-config.yaml
docker-compose-org1.yaml
docker-compose-org2.yaml
EDIT: added insert.js file and logs after trying to node insert.js (see comments)
Configuration information
HLF 1.4.1 ; Docker 18.09.7 ; docker-compose 1.23.2 ; node v8.16.0 ; npm 6.4.1 ; Ubuntu 18.04.2 LTS
Apologies for the multitude of errors which makes the question broad, but I assume they are somehow all connected to an endorsement issue. If not, do not hesitate to edit / ping me to narrow it down.

How many chaincodes can be initiated on single channel?

I was unable to instantiate a new chaincode on existing channel.
Whenever I am instantiating the chaincode it is not completing the process it just stopped at the below step; it is not even giving any error.
2019-01-11 11:38:33.117 UTC [msp] Validate -> DEBU 035 MSP DEFAULT validating identity
2019-01-11 11:38:33.118 UTC [grpc] DialContext -> DEBU 036 parsed scheme: ""
2019-01-11 11:38:33.119 UTC [grpc] DialContext -> DEBU 037 scheme "" not registered, fallback to default scheme
2019-01-11 11:38:33.119 UTC [grpc] watcher -> DEBU 038 ccResolverWrapper: sending new addresses to cc: [{peer:7051 0 <nil>}]
2019-01-11 11:38:33.119 UTC [grpc] switchBalancer -> DEBU 039 ClientConn switching balancer to "pick_first"
2019-01-11 11:38:33.120 UTC [grpc] HandleSubConnStateChange -> DEBU 03a pickfirstBalancer: HandleSubConnStateChange: 0xc00049ecd0, CONNECTING
2019-01-11 11:38:33.122 UTC [grpc] HandleSubConnStateChange -> DEBU 03b pickfirstBalancer: HandleSubConnStateChange: 0xc00049ecd0, READY
2019-01-11 11:38:33.122 UTC [grpc] DialContext -> DEBU 03c parsed scheme: ""
2019-01-11 11:38:33.123 UTC [grpc] DialContext -> DEBU 03d scheme "" not registered, fallback to default scheme
2019-01-11 11:38:33.123 UTC [grpc] watcher -> DEBU 03e ccResolverWrapper: sending new addresses to cc: [{peer:7051 0 <nil>}]
2019-01-11 11:38:33.124 UTC [grpc] switchBalancer -> DEBU 03f ClientConn switching balancer to "pick_first"
2019-01-11 11:38:33.124 UTC [grpc] HandleSubConnStateChange -> DEBU 040 pickfirstBalancer: HandleSubConnStateChange: 0xc0005031d0, CONNECTING
2019-01-11 11:38:33.125 UTC [grpc] HandleSubConnStateChange -> DEBU 041 pickfirstBalancer: HandleSubConnStateChange: 0xc0005031d0, READY
2019-01-11 11:38:33.126 UTC [msp] GetDefaultSigningIdentity -> DEBU 042 Obtaining default signing identity
2019-01-11 11:38:33.127 UTC [msp.identity] Sign -> DEBU 043 Sign: plaintext: 0AC3070A5B08011A0B08B980E2E10510...6967426C6F636B0A076D6172626C6550
2019-01-11 11:38:33.127 UTC [msp.identity] Sign -> DEBU 044 Sign: digest: C15AF406B7792459D13D2577F6E0EDD7399C78D9EA0BE381005FFF38D1A6EC68
What is the problem here?
how many chaincodes can be instantiate on a single channel?
If only one What is the reason?
Edited:
In fabric samples there are many chaincodes in go
so first I instantiated the sacc chaincode then I was trying to instantiating the marbles02 chaincode on the same channel but the chaincode name was different for both.
Thanks for the help

Can not deploy a network using loacl playground version?

Problem : I am very new to blockchain stuff. I start the local fabric and create a PeerAdmin card and I start local playground by issuing the command composer-playground in my windows machine. In the Playground, I tried to deploy a sample marbles network by giving the admin name and ID and secret. Then it notifies me with this error.
Error: Error trying to start business network.
Error: Unable to initalize channel. Attempted to contact 1 Peers.
Last error was Error: Error: 2 UNKNOWN: access denied:
channel [composerchannel] creator org [Org1MSP]
This the output when I start the fabric.
TharinduSA#LP-HQ-15957 MINGW64 ~/Desktop/fabric-dev-servers
$ ./startFabric.sh
Development only script for Hyperledger Fabric control
Running 'startFabric.sh'
FABRIC_VERSION is unset, assuming hlfv12
FABRIC_START_TIMEOUT is unset, assuming 15 (seconds)
Removing peer0.org1.example.com ... done
Removing orderer.example.com ... done
Removing ca.org1.example.com ... done
Removing couchdb ... done
Removing network composer_default
Creating network "composer_default" with the default driver
Creating ca.org1.example.com ... done
Creating orderer.example.com ... done
Creating couchdb ... done
Creating peer0.org1.example.com ... done
sleeping for 15 seconds to wait for fabric to complete start up
2018-11-01 05:07:09.804 UTC [viperutil] getKeysRecursively -> DEBU 001 Found map[string]interface{} value for peer.BCCSP
2018-11-01 05:07:09.805 UTC [viperutil] unmarshalJSON -> DEBU 002 Unmarshal JSON: value cannot be unmarshalled: invalid character 'S' looking for beginning of value
2018-11-01 05:07:09.805 UTC [viperutil] getKeysRecursively -> DEBU 003 Found real value for peer.BCCSP.Default setting to string SW
2018-11-01 05:07:09.806 UTC [viperutil] getKeysRecursively -> DEBU 004 Found map[string]interface{} value for peer.BCCSP.SW
2018-11-01 05:07:09.806 UTC [viperutil] getKeysRecursively -> DEBU 005 Found map[string]interface{} value for peer.BCCSP.SW.FileKeyStore
2018-11-01 05:07:09.806 UTC [viperutil] unmarshalJSON -> DEBU 006 Unmarshal JSON: value cannot be unmarshalled: unexpected end of JSON input
2018-11-01 05:07:09.806 UTC [viperutil] getKeysRecursively -> DEBU 007 Found real value for peer.BCCSP.SW.FileKeyStore.KeyStore setting to string
2018-11-01 05:07:09.807 UTC [viperutil] unmarshalJSON -> DEBU 008 Unmarshal JSON: value cannot be unmarshalled: invalid character 'S' looking for beginning of value
2018-11-01 05:07:09.807 UTC [viperutil] getKeysRecursively -> DEBU 009 Found real value for peer.BCCSP.SW.Hash setting to string SHA2
2018-11-01 05:07:09.807 UTC [viperutil] unmarshalJSON -> DEBU 00a Unmarshal JSON: value is not a string: 256
2018-11-01 05:07:09.807 UTC [viperutil] getKeysRecursively -> DEBU 00b Found real value for peer.BCCSP.SW.Security setting to int 256
2018-11-01 05:07:09.808 UTC [viperutil] getKeysRecursively -> DEBU 00c Found map[string]interface{} value for peer.BCCSP.PKCS11
2018-11-01 05:07:09.808 UTC [viperutil] unmarshalJSON -> DEBU 00d Unmarshal JSON: value is not a string: <nil>
2018-11-01 05:07:09.808 UTC [viperutil] getKeysRecursively -> DEBU 00e Found real value for peer.BCCSP.PKCS11.Label setting to <nil> <nil>
2018-11-01 05:07:09.809 UTC [viperutil] unmarshalJSON -> DEBU 00f Unmarshal JSON: value is not a string: <nil>
2018-11-01 05:07:09.809 UTC [viperutil] getKeysRecursively -> DEBU 010 Found real value for peer.BCCSP.PKCS11.Pin setting to <nil> <nil>
2018-11-01 05:07:09.810 UTC [viperutil] unmarshalJSON -> DEBU 011 Unmarshal JSON: value is not a string: <nil>
2018-11-01 05:07:09.811 UTC [viperutil] getKeysRecursively -> DEBU 012 Found real value for peer.BCCSP.PKCS11.Hash setting to <nil> <nil>
2018-11-01 05:07:09.811 UTC [viperutil] unmarshalJSON -> DEBU 013 Unmarshal JSON: value is not a string: <nil>
2018-11-01 05:07:09.812 UTC [viperutil] getKeysRecursively -> DEBU 014 Found real value for peer.BCCSP.PKCS11.Security setting to <nil> <nil>
2018-11-01 05:07:09.813 UTC [viperutil] getKeysRecursively -> DEBU 015 Found map[string]interface{} value for peer.BCCSP.PKCS11.FileKeyStore
2018-11-01 05:07:09.813 UTC [viperutil] unmarshalJSON -> DEBU 016 Unmarshal JSON: value is not a string: <nil>
2018-11-01 05:07:09.814 UTC [viperutil] getKeysRecursively -> DEBU 017 Found real value for peer.BCCSP.PKCS11.FileKeyStore.KeyStore setting to <nil> <nil>
2018-11-01 05:07:09.814 UTC [viperutil] unmarshalJSON -> DEBU 018 Unmarshal JSON: value is not a string: <nil>
2018-11-01 05:07:09.814 UTC [viperutil] getKeysRecursively -> DEBU 019 Found real value for peer.BCCSP.PKCS11.Library setting to <nil> <nil>
2018-11-01 05:07:09.814 UTC [viperutil] EnhancedExactUnmarshalKey -> DEBU 01a map[peer.BCCSP:map[Default:SW SW:map[FileKeyStore:map[KeyStore:] Hash:SHA2 Security:256] PKCS11:map[Label:<nil> Pin:<nil> Hash:<nil> Security:<nil> FileKeyStore:map[KeyStore:<nil>] Library:<nil>]]]
2018-11-01 05:07:09.817 UTC [bccsp_sw] openKeyStore -> DEBU 01b KeyStore opened at [/etc/hyperledger/peer/msp/keystore]...done
2018-11-01 05:07:09.818 UTC [bccsp] initBCCSP -> DEBU 01c Initialize BCCSP [SW]
2018-11-01 05:07:09.818 UTC [msp] getPemMaterialFromDir -> DEBU 01d Reading directory /etc/hyperledger/peer/msp/signcerts
2018-11-01 05:07:09.821 UTC [msp] getPemMaterialFromDir -> DEBU 01e Inspecting file /etc/hyperledger/peer/msp/signcerts/peer0.org1.example.com-cert.pem
2018-11-01 05:07:09.823 UTC [msp] getPemMaterialFromDir -> DEBU 01f Reading directory /etc/hyperledger/peer/msp/cacerts
2018-11-01 05:07:09.826 UTC [msp] getPemMaterialFromDir -> DEBU 020 Inspecting file /etc/hyperledger/peer/msp/cacerts/ca.org1.example.com-cert.pem
2018-11-01 05:07:09.832 UTC [msp] getPemMaterialFromDir -> DEBU 021 Reading directory /etc/hyperledger/peer/msp/admincerts
2018-11-01 05:07:09.840 UTC [msp] getPemMaterialFromDir -> DEBU 022 Inspecting file /etc/hyperledger/peer/msp/admincerts/Admin#org1.example.com-cert.pem
2018-11-01 05:07:09.843 UTC [msp] getPemMaterialFromDir -> DEBU 023 Reading directory /etc/hyperledger/peer/msp/intermediatecerts
2018-11-01 05:07:09.844 UTC [msp] getMspConfig -> DEBU 024 Intermediate certs folder not found at [/etc/hyperledger/peer/msp/intermediatecerts]. Skipping. [stat /etc/hyperledger/peer/msp/intermediatecerts: no such file or directory]
2018-11-01 05:07:09.844 UTC [msp] getPemMaterialFromDir -> DEBU 025 Reading directory /etc/hyperledger/peer/msp/tlscacerts
2018-11-01 05:07:09.847 UTC [msp] getPemMaterialFromDir -> DEBU 026 Inspecting file /etc/hyperledger/peer/msp/tlscacerts/tlsca.org1.example.com-cert.pem
2018-11-01 05:07:09.850 UTC [msp] getPemMaterialFromDir -> DEBU 027 Reading directory /etc/hyperledger/peer/msp/tlsintermediatecerts
2018-11-01 05:07:09.851 UTC [msp] getMspConfig -> DEBU 028 TLS intermediate certs folder not found at [/etc/hyperledger/peer/msp/tlsintermediatecerts]. Skipping. [stat /etc/hyperledger/peer/msp/tlsintermediatecerts: no such file or directory]
2018-11-01 05:07:09.851 UTC [msp] getPemMaterialFromDir -> DEBU 029 Reading directory /etc/hyperledger/peer/msp/crls
2018-11-01 05:07:09.853 UTC [msp] getMspConfig -> DEBU 02a crls folder not found at [/etc/hyperledger/peer/msp/crls]. Skipping. [stat /etc/hyperledger/peer/msp/crls: no such file or directory]
2018-11-01 05:07:09.855 UTC [msp] getMspConfig -> DEBU 02b MSP configuration file not found at [/etc/hyperledger/peer/msp/config.yaml]: [stat /etc/hyperledger/peer/msp/config.yaml: no such file or directory]
2018-11-01 05:07:09.855 UTC [msp] newBccspMsp -> DEBU 02c Creating BCCSP-based MSP instance
2018-11-01 05:07:09.855 UTC [msp] New -> DEBU 02d Creating Cache-MSP instance
2018-11-01 05:07:09.855 UTC [msp] loadLocaMSP -> DEBU 02e Created new local MSP
2018-11-01 05:07:09.856 UTC [msp] Setup -> DEBU 02f Setting up MSP instance Org1MSP
2018-11-01 05:07:09.856 UTC [msp/identity] newIdentity -> DEBU 030 Creating identity instance for cert -----BEGIN CERTIFICATE-----
MIICQjCCAemgAwIBAgIQDJbOh88U+tlJ9He5sjUwBDAKBggqhkjOPQQDAjBzMQsw
CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy
YW5jaXNjbzEZMBcGA1UEChMQb3JnMS5leGFtcGxlLmNvbTEcMBoGA1UEAxMTY2Eu
b3JnMS5leGFtcGxlLmNvbTAeFw0xNzA2MjYxMjQ5MjZaFw0yNzA2MjQxMjQ5MjZa
MHMxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1T
YW4gRnJhbmNpc2NvMRkwFwYDVQQKExBvcmcxLmV4YW1wbGUuY29tMRwwGgYDVQQD
ExNjYS5vcmcxLmV4YW1wbGUuY29tMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE
kQ216YBD8kks+IzKJyBmdLqh/L/sEZ5twTqYpsK1ztNhIUDplsletAFOJQWRH+kb
hzFFNvS1qwveGRU6ztN5haNfMF0wDgYDVR0PAQH/BAQDAgGmMA8GA1UdJQQIMAYG
BFUdJQAwDwYDVR0TAQH/BAUwAwEB/zApBgNVHQ4EIgQgGatlq7sEgH2tEuTAqaqm
ZJ5who46vQIXoyLYnkfhpq4wCgYIKoZIzj0EAwIDRwAwRAIgCyrj/lUjtBYaEgMt
x98l5z+iLU6r+gp4CsdcDYzKLugCIGXlcU56avWSUtRAGn8Avpb6TOxtkrKIpeTE
QfM8VsS/
-----END CERTIFICATE-----
2018-11-01 05:07:09.857 UTC [msp/identity] newIdentity -> DEBU 031 Creating identity instance for cert -----BEGIN CERTIFICATE-----
MIICGjCCAcCgAwIBAgIRANuOnVN+yd/BGyoX7ioEklQwCgYIKoZIzj0EAwIwczEL
MAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBG
cmFuY2lzY28xGTAXBgNVBAoTEG9yZzEuZXhhbXBsZS5jb20xHDAaBgNVBAMTE2Nh
Lm9yZzEuZXhhbXBsZS5jb20wHhcNMTcwNjI2MTI0OTI2WhcNMjcwNjI0MTI0OTI2
WjBbMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMN
U2FuIEZyYW5jaXNjbzEfMB0GA1UEAwwWQWRtaW5Ab3JnMS5leGFtcGxlLmNvbTBZ
MBMGByqGSM49AgEGCCqGSM49AwEHA0IABGu8KxBQ1GkxSTMVoLv7NXiYKWj5t6Dh
WRTJBHnLkWV7lRUfYaKAKFadSii5M7Z7ZpwD8NS7IsMdPR6Z4EyGgwKjTTBLMA4G
A1UdDwEB/wQEAwIHgDAMBgNVHRMBAf8EAjAAMCsGA1UdIwQkMCKAIBmrZau7BIB9
rRLkwKmqpmSecIaOOr0CF6Mi2J5H4aauMAoGCCqGSM49BAMCA0gAMEUCIQC4sKQ6
CEgqbTYe48az95W9/hnZ+7DI5eSnWUwV9vCd/gIgS5K6omNJydoFoEpaEIwM97uS
XVMHPa0iyC497vdNURA=
-----END CERTIFICATE-----
2018-11-01 05:07:09.890 UTC [msp/identity] newIdentity -> DEBU 032 Creating identity instance for cert -----BEGIN CERTIFICATE-----
MIICGTCCAb+gAwIBAgIQTx2TvwYtAf62KKQliP6UoTAKBggqhkjOPQQDAjBzMQsw
CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy
YW5jaXNjbzEZMBcGA1UEChMQb3JnMS5leGFtcGxlLmNvbTEcMBoGA1UEAxMTY2Eu
b3JnMS5leGFtcGxlLmNvbTAeFw0xNzA2MjYxMjQ5MjZaFw0yNzA2MjQxMjQ5MjZa
MFsxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1T
YW4gRnJhbmNpc2NvMR8wHQYDVQQDExZwZWVyMC5vcmcxLmV4YW1wbGUuY29tMFkw
EwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEPPHUp7+EYb2xIbleWfRClMgqbtQqRmIS
2a5F8T0L3J6IZp9wm7K+w4LIBIgw1Cz9D8nqHW6f4OYBrbp0cSGnR6NNMEswDgYD
VR0PAQH/BAQDAgeAMAwGA1UdEwEB/wQCMAAwKwYDVR0jBCQwIoAgGatlq7sEgH2t
EuTAqaqmZJ5who46vQIXoyLYnkfhpq4wCgYIKoZIzj0EAwIDSAAwRQIhAK4i2Hz2
K398TvjJk62neDoenYhkMY7rBN3BN/GI0G0SAiAOTx36wuy9/4BBV8NVBCZ9V+Iw
msdI9CyZ59oVMVmNYQ==
-----END CERTIFICATE-----
2018-11-01 05:07:09.897 UTC [bccsp_sw] loadPrivateKey -> DEBU 033 Loading private key [dfb17cf51dc061d585b4850599be0e4b8b7cc8cc363a67c23bc03c6c5393b0e0] at [/etc/hyperledger/peer/msp/keystore/dfb17cf51dc061d585b4850599be0e4b8b7cc8cc363a67c23bc03c6c5393b0e0_sk]...
2018-11-01 05:07:09.901 UTC [msp/identity] newIdentity -> DEBU 034 Creating identity instance for cert -----BEGIN CERTIFICATE-----
MIICGTCCAb+gAwIBAgIQTx2TvwYtAf62KKQliP6UoTAKBggqhkjOPQQDAjBzMQsw
CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy
YW5jaXNjbzEZMBcGA1UEChMQb3JnMS5leGFtcGxlLmNvbTEcMBoGA1UEAxMTY2Eu
b3JnMS5leGFtcGxlLmNvbTAeFw0xNzA2MjYxMjQ5MjZaFw0yNzA2MjQxMjQ5MjZa
MFsxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1T
YW4gRnJhbmNpc2NvMR8wHQYDVQQDExZwZWVyMC5vcmcxLmV4YW1wbGUuY29tMFkw
EwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEPPHUp7+EYb2xIbleWfRClMgqbtQqRmIS
2a5F8T0L3J6IZp9wm7K+w4LIBIgw1Cz9D8nqHW6f4OYBrbp0cSGnR6NNMEswDgYD
VR0PAQH/BAQDAgeAMAwGA1UdEwEB/wQCMAAwKwYDVR0jBCQwIoAgGatlq7sEgH2t
EuTAqaqmZJ5who46vQIXoyLYnkfhpq4wCgYIKoZIzj0EAwIDSAAwRQIhAK4i2Hz2
K398TvjJk62neDoenYhkMY7rBN3BN/GI0G0SAiAOTx36wuy9/4BBV8NVBCZ9V+Iw
msdI9CyZ59oVMVmNYQ==
-----END CERTIFICATE-----
2018-11-01 05:07:09.902 UTC [msp] setupSigningIdentity -> DEBU 035 Signing identity expires at 2027-06-24 12:49:26 +0000 UTC
2018-11-01 05:07:09.902 UTC [msp] Validate -> DEBU 036 MSP Org1MSP validating identity
2018-11-01 05:07:09.903 UTC [msp] GetDefaultSigningIdentity -> DEBU 037 Obtaining default signing identity
2018-11-01 05:07:09.903 UTC [grpc] Printf -> DEBU 038 parsed scheme: ""
2018-11-01 05:07:09.903 UTC [grpc] Printf -> DEBU 039 scheme "" not registered, fallback to default scheme
2018-11-01 05:07:09.903 UTC [grpc] Printf -> DEBU 03a ccResolverWrapper: sending new addresses to cc: [{orderer.example.com:7050 0 <nil>}]
2018-11-01 05:07:09.903 UTC [grpc] Printf -> DEBU 03b ClientConn switching balancer to "pick_first"
2018-11-01 05:07:09.904 UTC [grpc] Printf -> DEBU 03c pickfirstBalancer: HandleSubConnStateChange: 0xc4201fe4f0, CONNECTING
2018-11-01 05:07:09.908 UTC [grpc] Printf -> DEBU 03d pickfirstBalancer: HandleSubConnStateChange: 0xc4201fe4f0, READY
2018-11-01 05:07:09.908 UTC [channelCmd] InitCmdFactory -> INFO 03e Endorser and orderer connections initialized
Error: channel create configuration tx file not found open C:/Program Files/Git/etc/hyperledger/configtx/composer-channel.tx: no such file or directory
This is the output when I create the peerAdmin card.
TharinduSA#LP-HQ-15957 MINGW64 ~/Desktop/fabric-dev-servers
$ ./createPeerAdminCard.sh
Development only script for Hyperledger Fabric control
Running 'createPeerAdminCard.sh'
FABRIC_VERSION is unset, assuming hlfv12
FABRIC_START_TIMEOUT is unset, assuming 15 (seconds)
Using composer-cli at v0.20.2
Successfully created business network card file to
Output file: C:/Users/THARIN~1/AppData/Local/Temp/PeerAdmin#hlfv1.card
Command succeeded
Deleted Business Network Card: PeerAdmin#hlfv1
Command succeeded
Successfully imported business network card
Card file: C:/Users/THARIN~1/AppData/Local/Temp/PeerAdmin#hlfv1.card
Card name: PeerAdmin#hlfv1
Command succeeded
The following Business Network Cards are available:
Connection Profile: hlfv1
┌─────────────────┬───────────┬──────────────────┐
│ Card Name │ UserId │ Business Network │
├─────────────────┼───────────┼──────────────────┤
│ PeerAdmin#hlfv1 │ PeerAdmin │ │
└─────────────────┴───────────┴──────────────────┘
Issue composer card list --card <Card Name> to get details a specific card
Command succeeded
Hyperledger Composer PeerAdmin card has been imported, host of fabric specified as 'localhost'
This is the output when I hit composer-playground.
info: [Hyperledger-Composer] :LoadModule :loadModule() Loading composer-wallet-filesystem from C:\Users\tharindusa\AppData\Roaming\npm\node_modules\composer-playground\node_modules\composer-wallet-filesystem
info: [Hyperledger-Composer] :PlaygroundAPI :createServer() Playground API started on port 8080
info: [Hyperledger-Composer] :PlaygroundAPI :createServer() Client with ID 'fEhxXlG7SBsqKZxUAAAA' on host '::1' connected
info: [Hyperledger-Composer] :PlaygroundAPI :createServer() Client with ID 'LCrMJRc_V_nuQIWJAAAB' on host '::1' connected
info: [Hyperledger-Composer] :ConnectionProfileManager :getConnectionManagerByTyp Looking up a connection manager for type 0=hlfv1
info: [Hyperledger-Composer] :ConnectionProfileManager :getConnectionManagerByTyp Using this connection manager
warn: [Hyperledger-Composer] :HLFConnection :_checkCCListener() could not find any connected event hubs out of 1 defined hubs to listen on for chaincode events
info: [Hyperledger-Composer] :ConnectionProfileManager :getConnectionManagerByTyp Looking up a connection manager for type 0=hlfv1
error: [Hyperledger-Composer] :HLFConnection :ping() Error: Error trying to ping. Error: No business network has been specified for this connection
at _checkRuntimeVersions.then.catch (C:\Users\tharindusa\AppData\Roaming\npm\node_modules\composer-playground\node_modules\composer-connector-hlfv1\lib\hlfconnection.js:798:34)
at <anonymous>
at runMicrotasksCallback (internal/process/next_tick.js:121:5)
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickCallback (internal/process/next_tick.js:180:9)
error: [Hyperledger-Composer] :ConnectorServer :connectionPing() Error: Error trying to ping. Error: No business network has been specified for this connection
at _checkRuntimeVersions.then.catch (C:\Users\tharindusa\AppData\Roaming\npm\node_modules\composer-playground\node_modules\composer-connector-hlfv1\lib\hlfconnection.js:798:34)
at <anonymous>
at runMicrotasksCallback (internal/process/next_tick.js:121:5)
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickCallback (internal/process/next_tick.js:180:9)
warn: [Hyperledger-Composer] :HLFConnection :_checkCCListener() could not find any connected event hubs out of 1 defined hubs to listen on for chaincode events
Output of docker ps command
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
cddafd948bdf hyperledger/fabric-peer:1.2.1 "peer node start" 10 minutes ago Up 9 minutes 0.0.0.0:7051->7051/tcp, 0.0.0.0:7053->7053/tcp peer0.org1.example.com
b53ec378bb91 hyperledger/fabric-couchdb:0.4.10 "tini -- /docker-ent…" 10 minutes ago Up 10 minutes 4369/tcp, 9100/tcp, 0.0.0.0:5984->5984/tcp couchdb
d24e5af42fce hyperledger/fabric-orderer:1.2.1 "orderer" 10 minutes ago Up 10 minutes 0.0.0.0:7050->7050/tcp orderer.example.com
fe77de34ac17 hyperledger/fabric-ca:1.2.1 "sh -c 'fabric-ca-se…" 10 minutes ago Up 10 minutes 0.0.0.0:7054->7054/tcp ca.org1.example.com
I search a lot about this on the Internet. But I was unable to find a solution for this. Can someone help me to solve a problem?
Thank you!!
I see you are using windows, unfortunately windows is not a supported platform for hyperledger composer. The recommended approach would be to use a hypervisor such as virtualbox, vmware or hyperV and run a linux distribution inside of it. Windows does have Windows subsystem for linux but you can't use this as the full linux distribution as it will have problems as well.
You can try this:
Insert this one line in fabric-tools\hlfv11\startFabric.sh
export MSYS_NO_PATHCONV=1
before
# Create the channel
docker exec peer0.org1.example.com peer channel create -o orderer.example.com:7050 -c composerchannel -f /etc/hyperledger/configtx/composer-channel.tx
After this run commands from fabric-tools directory:
./stopFabric.sh
./teardownFabric.sh
./startFabric.sh
Then composer network install and composer network start from the tutorial steps should run correctly.

error when run Fabric example e2e_cli network_setup.sh

Im try to run the fabric-1.2.0 examples/e2e_cli,
an error coming out as below:
____ _____ _ ____ _____ _____ ____ _____
/ ___| |_ _| / \ | _ \ |_ _| | ____| |___ \ | ____|
\___ \ | | / _ \ | |_) | | | _____ | _| __) | | _|
___) | | | / ___ \ | _ < | | |_____| | |___ / __/ | |___
|____/ |_| /_/ \_\ |_| \_\ |_| |_____| |_____| |_____|
Channel name : mychannel
Check orderering service availability...
Attempting to fetch system channel 'e2e-orderer-syschan' ...3 secs
Attempting to fetch system channel 'e2e-orderer-syschan' ...7 secs
Attempting to fetch system channel 'e2e-orderer-syschan' ...11 secs
Attempting to fetch system channel 'e2e-orderer-syschan' ...14 secs
Attempting to fetch system channel 'e2e-orderer-syschan' ...17 secs
Attempting to fetch system channel 'e2e-orderer-syschan' ...20 secs
Attempting to fetch system channel 'e2e-orderer-syschan' ...24 secs
Attempting to fetch system channel 'e2e-orderer-syschan' ...27 secs
Attempting to fetch system channel 'e2e-orderer-syschan' ...30 secs
Attempting to fetch system channel 'e2e-orderer-syschan' ...33 secs
Attempting to fetch system channel 'e2e-orderer-syschan' ...36 secs
Attempting to fetch system channel 'e2e-orderer-syschan' ...39 secs
Attempting to fetch system channel 'e2e-orderer-syschan' ...42 secs
Attempting to fetch system channel 'e2e-orderer-syschan' ...46 secs
Attempting to fetch system channel 'e2e-orderer-syschan' ...49 secs
Attempting to fetch system channel 'e2e-orderer-syschan' ...52 secs
Attempting to fetch system channel 'e2e-orderer-syschan' ...55 secs
Attempting to fetch system channel 'e2e-orderer-syschan' ...58 secs
Attempting to fetch system channel 'e2e-orderer-syschan' ...61 secs
2018-08-01 09:42:03.782 UTC [viperutil] getKeysRecursively -> DEBU 001 Found map[string]interface{} value for peer.BCCSP
2018-08-01 09:42:03.783 UTC [viperutil] unmarshalJSON -> DEBU 002 Unmarshal JSON: value cannot be unmarshalled: invalid character 'S' looking for beginning of value
unmarshalJSON -> DEBU 002 Unmarshal JSON: value cannot be unmarshalled: invalid character 'S' looking for beginning of value
there is a lot similar errors below
......
2018-08-01 09:42:03.791 UTC [viperutil] getKeysRecursively -> DEBU 019 Found real value for peer.BCCSP.PKCS11.Security setting to <nil> <nil>
2018-08-01 09:42:03.791 UTC [viperutil] EnhancedExactUnmarshalKey -> DEBU 01a map[peer.BCCSP:map[Default:SW SW:map[FileKeyStore:map[KeyStore:] Hash:SHA2 Security:256] PKCS11:map[Library:<nil> Label:<nil> Pin:<nil> Hash:<nil> Security:<nil> FileKeyStore:map[KeyStore:<nil>]]]]
2018-08-01 09:42:03.791 UTC [bccsp_sw] openKeyStore -> DEBU 01b KeyStore opened at [/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/keystore]...done
2018-08-01 09:42:03.791 UTC [bccsp] initBCCSP -> DEBU 01c Initialize BCCSP [SW]
2018-08-01 09:42:03.791 UTC [msp] getPemMaterialFromDir -> DEBU 01d Reading directory /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/signcerts
2018-08-01 09:42:03.792 UTC [msp] getPemMaterialFromDir -> DEBU 01e Inspecting file /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/signcerts/orderer.example.com-cert.pem
2018-08-01 09:42:03.792 UTC [msp] getPemMaterialFromDir -> DEBU 01f Reading directory /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/cacerts
2018-08-01 09:42:03.792 UTC [msp] getPemMaterialFromDir -> DEBU 020 Inspecting file /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/cacerts/ca.example.com-cert.pem
2018-08-01 09:42:03.792 UTC [msp] getPemMaterialFromDir -> DEBU 021 Reading directory /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/admincerts
2018-08-01 09:42:03.792 UTC [msp] getPemMaterialFromDir -> DEBU 022 Inspecting file /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/admincerts/Admin#example.com-cert.pem
2018-08-01 09:42:03.792 UTC [msp] getPemMaterialFromDir -> DEBU 023 Reading directory /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/intermediatecerts
2018-08-01 09:42:03.792 UTC [msp] getMspConfig -> DEBU 024 Intermediate certs folder not found at [/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/intermediatecerts]. Skipping. [stat /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/intermediatecerts: no such file or directory]
2018-08-01 09:42:03.792 UTC [msp] getPemMaterialFromDir -> DEBU 025 Reading directory /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts
2018-08-01 09:42:03.792 UTC [msp] getPemMaterialFromDir -> DEBU 026 Inspecting file /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
2018-08-01 09:42:03.792 UTC [msp] getPemMaterialFromDir -> DEBU 027 Reading directory /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlsintermediatecerts
2018-08-01 09:42:03.792 UTC [msp] getMspConfig -> DEBU 028 TLS intermediate certs folder not found at [/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlsintermediatecerts]. Skipping. [stat /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlsintermediatecerts: no such file or directory]
2018-08-01 09:42:03.792 UTC [msp] getPemMaterialFromDir -> DEBU 029 Reading directory /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/crls
2018-08-01 09:42:03.792 UTC [msp] getMspConfig -> DEBU 02a crls folder not found at [/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/crls]. Skipping. [stat /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/crls: no such file or directory]
2018-08-01 09:42:03.792 UTC [msp] getMspConfig -> DEBU 02b MSP configuration file not found at [/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/config.yaml]: [stat /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/config.yaml: no such file or directory]
2018-08-01 09:42:03.793 UTC [msp] newBccspMsp -> DEBU 02c Creating BCCSP-based MSP instance
2018-08-01 09:42:03.793 UTC [msp] New -> DEBU 02d Creating Cache-MSP instance
2018-08-01 09:42:03.793 UTC [msp] loadLocaMSP -> DEBU 02e Created new local MSP
2018-08-01 09:42:03.793 UTC [msp] Setup -> DEBU 02f Setting up MSP instance OrdererMSP
2018-08-01 09:42:03.793 UTC [msp/identity] newIdentity -> DEBU 030 Creating identity instance for cert -----BEGIN CERTIFICATE-----
MIICLzCCAdagAwIBAgIRAIXgXz0/BvDFLJSNteLnAnowCgYIKoZIzj0EAwIwaTEL
MAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBG
cmFuY2lzY28xFDASBgNVBAoTC2V4YW1wbGUuY29tMRcwFQYDVQQDEw5jYS5leGFt
cGxlLmNvbTAeFw0xODA4MDEwOTM1NTJaFw0yODA3MjkwOTM1NTJaMGkxCzAJBgNV
BAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1TYW4gRnJhbmNp
c2NvMRQwEgYDVQQKEwtleGFtcGxlLmNvbTEXMBUGA1UEAxMOY2EuZXhhbXBsZS5j
b20wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAATWwxXc7j10ZZfjY5No3CFjO2H+
19cU9zq9bE/2X9psPTvDzk3Nl0J70OuPpcRvd0ak1OJKZwNDNvbs0t4VX6Tuo18w
XTAOBgNVHQ8BAf8EBAMCAaYwDwYDVR0lBAgwBgYEVR0lADAPBgNVHRMBAf8EBTAD
AQH/MCkGA1UdDgQiBCDij+X04IQQIRlQG3TNTgurGUML19XuTFCPul4lNvFGCDAK
BggqhkjOPQQDAgNHADBEAiBf2vZ3B9pJjm+P9kAb60w9l2bZ+fjyanYVG7KsAAgq
QwIgJaakCmH/qDV41oX47u+Xpwci48V5BHV9iNqju28hNOA=
and there is some "-----BEGIN CERTIFICATE-----" and "-----END CERTIFICATE-----"
.......
-----END CERTIFICATE-----
2018-08-01 09:42:03.822 UTC [msp] setupSigningIdentity -> DEBU 035 Signing identity expires at 2028-07-29 09:35:52 +0000 UTC
2018-08-01 09:42:03.822 UTC [msp] Validate -> DEBU 036 MSP OrdererMSP validating identity
2018-08-01 09:42:03.823 UTC [msp] GetDefaultSigningIdentity -> DEBU 037 Obtaining default signing identity
2018-08-01 09:42:03.824 UTC [grpc] Printf -> DEBU 038 parsed scheme: ""
2018-08-01 09:42:03.824 UTC [grpc] Printf -> DEBU 039 scheme "" not registered, fallback to default scheme
2018-08-01 09:42:03.824 UTC [grpc] Printf -> DEBU 03a ccResolverWrapper: sending new addresses to cc: [{orderer.example.com:7050 0 <nil>}]
2018-08-01 09:42:03.824 UTC [grpc] Printf -> DEBU 03b ClientConn switching balancer to "pick_first"
2018-08-01 09:42:03.825 UTC [grpc] Printf -> DEBU 03c pickfirstBalancer: HandleSubConnStateChange: 0xc4201e0de0, CONNECTING
2018-08-01 09:42:03.829 UTC [grpc] Printf -> DEBU 03d pickfirstBalancer: HandleSubConnStateChange: 0xc4201e0de0, READY
2018-08-01 09:42:03.829 UTC [channelCmd] InitCmdFactory -> INFO 03e Endorser and orderer connections initialized
2018-08-01 09:42:03.829 UTC [msp] GetDefaultSigningIdentity -> DEBU 03f Obtaining default signing identity
2018-08-01 09:42:03.829 UTC [msp] GetDefaultSigningIdentity -> DEBU 040 Obtaining default signing identity
2018-08-01 09:42:03.829 UTC [msp/identity] Sign -> DEBU 041 Sign: plaintext: 0AD6060A1F08051A0608EB8086DB0522...71514367BF7D12080A021A0012021A00
2018-08-01 09:42:03.829 UTC [msp/identity] Sign -> DEBU 042 Sign: digest: BAB296247EB0DFE2ED5F02F263AA72B6F66E783E04E5535096C22E0EA473E87E
2018-08-01 09:42:03.830 UTC [cli/common] readBlock -> INFO 043 Got status: &{SERVICE_UNAVAILABLE}
Error: can't read the block: &{SERVICE_UNAVAILABLE}
!!!!!!!!!!!!!!! Ordering Service is not available, Please try again ... !!!!!!!!!!!!!!!!
================== ERROR !!! FAILED to execute End-2-End Scenario ==================
I have done everything according to the instructions : http://hyperledger-fabric.readthedocs.io/en/latest/install.html.
and i cant get any solution from official website.
So any help will be appreciated.
I met the same problem today. Are you are using the master branch? I think maybe there are some errors in the master branch code. So I checkout the release-1.2 branch and tried again then I solved it. You can have a try.
I met the same problem.By below solution to solve the problem.
Fist you should edit the file ./base/peer-base.yaml
And edit this row
- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=e2e_default
into
- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=e2e_cli_default.
And you should run the command ./network_setup.sh up.And you will meet a error like cannot find the network. And you close the fabric network by ./network_setup.sh down.
Edit the row of the file ./base/peer-base.yaml again.
from - CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=e2e_cli_default to
- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=e2e_default.
reopen the network by ./network_setup.sh up. now everything is ok.

Resources