hyperledger-labs / blockchain-carbon-accounting

This project implements blockchain applications for climate action and accounting, including emissions calculations, carbon trading, and validation of climate claims. It is part of the Linux Foundation's Hyperledger Climate Action and Accounting SIG.
https://wiki.hyperledger.org/display/CASIG/Carbon+Accounting+and+Certification+WG
Apache License 2.0
195 stars 104 forks source link

Unable to POST recordEmissions #21

Closed ethicalvats closed 3 years ago

ethicalvats commented 4 years ago

Error from peer node

2020-10-26 09:43:59.456 UTC [comm.grpc.server] 1 -> INFO 097 unary call completed grpc.service=discovery.Discovery grpc.method=Discover grpc.peer_address=172.19.0.1:54056 grpc.peer_subject="CN=fabric-common" grpc.code=OK grpc.call_duration=3.095995ms
2020-10-26 09:43:59.575 UTC [comm.grpc.server] 1 -> INFO 098 unary call completed grpc.service=discovery.Discovery grpc.method=Discover grpc.peer_address=172.19.0.1:54056 grpc.peer_subject="CN=fabric-common" grpc.code=OK grpc.call_duration=2.636469ms
2020-10-26 09:44:02.047 UTC [endorser] callChaincode -> INFO 099 finished chaincode: emissionscontract duration: 2420ms channel=utilityemissionchannel txID=d6c2483d
2020-10-26 09:44:02.048 UTC [endorser] SimulateProposal -> ERRO 09a failed to invoke chaincode emissionscontract, error: container exited with 1
github.com/hyperledger/fabric/core/chaincode.(*RuntimeLauncher).Launch.func1
        /go/src/github.com/hyperledger/fabric/core/chaincode/runtime_launcher.go:118
runtime.goexit
        /usr/local/go/src/runtime/asm_amd64.s:1373
chaincode registration failed
could not launch chaincode emissionscontract_1.0:0673e1940851448d9f182d24c28b0788f0747ecc16801d7bb33d71fba7aaa69c
github.com/hyperledger/fabric/core/chaincode.(*ChaincodeSupport).Launch
        /go/src/github.com/hyperledger/fabric/core/chaincode/chaincode_support.go:85
github.com/hyperledger/fabric/core/chaincode.(*ChaincodeSupport).Invoke
        /go/src/github.com/hyperledger/fabric/core/chaincode/chaincode_support.go:197
github.com/hyperledger/fabric/core/chaincode.(*ChaincodeSupport).Execute
        /go/src/github.com/hyperledger/fabric/core/chaincode/chaincode_support.go:155
github.com/hyperledger/fabric/core/endorser.(*SupportImpl).Execute
        /go/src/github.com/hyperledger/fabric/core/endorser/support.go:126
github.com/hyperledger/fabric/core/endorser.(*Endorser).callChaincode
        /go/src/github.com/hyperledger/fabric/core/endorser/endorser.go:119
github.com/hyperledger/fabric/core/endorser.(*Endorser).SimulateProposal
        /go/src/github.com/hyperledger/fabric/core/endorser/endorser.go:187
github.com/hyperledger/fabric/core/endorser.(*Endorser).ProcessProposalSuccessfullyOrError
        /go/src/github.com/hyperledger/fabric/core/endorser/endorser.go:397
github.com/hyperledger/fabric/core/endorser.(*Endorser).ProcessProposal
        /go/src/github.com/hyperledger/fabric/core/endorser/endorser.go:340
github.com/hyperledger/fabric/core/handlers/auth/filter.(*expirationCheckFilter).ProcessProposal
        /go/src/github.com/hyperledger/fabric/core/handlers/auth/filter/expiration.go:61
github.com/hyperledger/fabric/core/handlers/auth/filter.(*filter).ProcessProposal
        /go/src/github.com/hyperledger/fabric/core/handlers/auth/filter/filter.go:32
github.com/hyperledger/fabric-protos-go/peer._Endorser_ProcessProposal_Handler.func1
        /go/src/github.com/hyperledger/fabric/vendor/github.com/hyperledger/fabric-protos-go/peer/peer.pb.go:107
github.com/hyperledger/fabric/internal/peer/node.unaryGrpcLimiter.func1
        /go/src/github.com/hyperledger/fabric/internal/peer/node/grpc_limiters.go:51
github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1.1
        /go/src/github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:25
github.com/hyperledger/fabric/common/grpclogging.UnaryServerInterceptor.func1
        /go/src/github.com/hyperledger/fabric/common/grpclogging/server.go:92
github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1.1
        /go/src/github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:25
github.com/hyperledger/fabric/common/grpcmetrics.UnaryServerInterceptor.func1
        /go/src/github.com/hyperledger/fabric/common/grpcmetrics/interceptor.go:31
github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1.1
        /go/src/github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:25
github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1
        /go/src/github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:34
github.com/hyperledger/fabric-protos-go/peer._Endorser_ProcessProposal_Handler
        /go/src/github.com/hyperledger/fabric/vendor/github.com/hyperledger/fabric-protos-go/peer/peer.pb.go:109
google.golang.org/grpc.(*Server).processUnaryRPC
        /go/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/server.go:1082
google.golang.org/grpc.(*Server).handleStream
        /go/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/server.go:1405
google.golang.org/grpc.(*Server).serveStreams.func1.1
        /go/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/server.go:746
runtime.goexit
        /usr/local/go/src/runtime/asm_amd64.s:1373
failed to execute transaction d6c2483dfcc735db341106d9da51c9a5cdf0610931df4cc17fe2757e0cd3a01c
github.com/hyperledger/fabric/core/chaincode.processChaincodeExecutionResult
        /go/src/github.com/hyperledger/fabric/core/chaincode/chaincode_support.go:161
github.com/hyperledger/fabric/core/chaincode.(*ChaincodeSupport).Execute
        /go/src/github.com/hyperledger/fabric/core/chaincode/chaincode_support.go:156
github.com/hyperledger/fabric/core/endorser.(*SupportImpl).Execute
        /go/src/github.com/hyperledger/fabric/core/endorser/support.go:126
github.com/hyperledger/fabric/core/endorser.(*Endorser).callChaincode
        /go/src/github.com/hyperledger/fabric/core/endorser/endorser.go:119
github.com/hyperledger/fabric/core/endorser.(*Endorser).SimulateProposal
        /go/src/github.com/hyperledger/fabric/core/endorser/endorser.go:187
github.com/hyperledger/fabric/core/endorser.(*Endorser).ProcessProposalSuccessfullyOrError
        /go/src/github.com/hyperledger/fabric/core/endorser/endorser.go:397
github.com/hyperledger/fabric/core/endorser.(*Endorser).ProcessProposal
        /go/src/github.com/hyperledger/fabric/core/endorser/endorser.go:340
github.com/hyperledger/fabric/core/handlers/auth/filter.(*expirationCheckFilter).ProcessProposal
        /go/src/github.com/hyperledger/fabric/core/handlers/auth/filter/expiration.go:61
github.com/hyperledger/fabric/core/handlers/auth/filter.(*filter).ProcessProposal
        /go/src/github.com/hyperledger/fabric/core/handlers/auth/filter/filter.go:32
github.com/hyperledger/fabric-protos-go/peer._Endorser_ProcessProposal_Handler.func1
        /go/src/github.com/hyperledger/fabric/vendor/github.com/hyperledger/fabric-protos-go/peer/peer.pb.go:107
github.com/hyperledger/fabric/internal/peer/node.unaryGrpcLimiter.func1
        /go/src/github.com/hyperledger/fabric/internal/peer/node/grpc_limiters.go:51
github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1.1
        /go/src/github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:25
github.com/hyperledger/fabric/common/grpclogging.UnaryServerInterceptor.func1
        /go/src/github.com/hyperledger/fabric/common/grpclogging/server.go:92
github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1.1
        /go/src/github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:25
github.com/hyperledger/fabric/common/grpcmetrics.UnaryServerInterceptor.func1
        /go/src/github.com/hyperledger/fabric/common/grpcmetrics/interceptor.go:31
github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1.1
        /go/src/github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:25
github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1
        /go/src/github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:34
github.com/hyperledger/fabric-protos-go/peer._Endorser_ProcessProposal_Handler
        /go/src/github.com/hyperledger/fabric/vendor/github.com/hyperledger/fabric-protos-go/peer/peer.pb.go:109
google.golang.org/grpc.(*Server).processUnaryRPC
        /go/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/server.go:1082
google.golang.org/grpc.(*Server).handleStream
        /go/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/server.go:1405
google.golang.org/grpc.(*Server).serveStreams.func1.1
        /go/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/server.go:746
runtime.goexit
        /usr/local/go/src/runtime/asm_amd64.s:1373 channel=utilityemissionchannel txID=d6c2483d
2020-10-26 09:44:02.048 UTC [comm.grpc.server] 1 -> INFO 09b unary call completed grpc.service=protos.Endorser grpc.method=ProcessProposal grpc.peer_address=172.19.0.1:54086 grpc.peer_subject="CN=fabric-common" grpc.code=OK grpc.call_duration=2.424982668s

API response


# RECORDING EMISSIONS DATA TO UTILITYEMISSIONS CHANNEL
OrgName: auditor1
Loaded the network configuration located at /Users/vats/Projects/Hyperledger-Climate_Action_SIG/blockchain-carbon-accounting/utility-emissions-channel/docker-compose-setup/organizations/peerOrganizations/auditor1.carbonAccounting.com/connection-auditor1.json
OrgName: auditor1
+++++++++++++++++ Walletpath: /Users/vats/Projects/Hyperledger-Climate_Action_SIG/blockchain-carbon-accounting/utility-emissions-channel/application/src/blockchain-gateway/wallets/auditor1
Built a file system wallet at /Users/vats/Projects/Hyperledger-Climate_Action_SIG/blockchain-carbon-accounting/utility-emissions-channel/application/src/blockchain-gateway/wallets/auditor1
2020-10-26T09:44:02.073Z - error: [Transaction]: Error: No valid responses from any peers. Errors:
    peer=peer1.auditor2.carbonAccounting.com:8051, status=500, message=error in simulation: failed to execute transaction d6c2483dfcc735db341106d9da51c9a5cdf0610931df4cc17fe2757e0cd3a01c: could not launch chaincode emissionscontract_1.0:0673e1940851448d9f182d24c28b0788f0747ecc16801d7bb33d71fba7aaa69c: chaincode registration failed: container exited with 1
    peer=peer1.auditor1.carbonAccounting.com:7051, status=500, message=error in simulation: failed to execute transaction d6c2483dfcc735db341106d9da51c9a5cdf0610931df4cc17fe2757e0cd3a01c: could not launch chaincode emissionscontract_1.0:0673e1940851448d9f182d24c28b0788f0747ecc16801d7bb33d71fba7aaa69c: chaincode registration failed: container exited with 1
Failed to submit transaction: Error: No valid responses from any peers. Errors:
    peer=peer1.auditor2.carbonAccounting.com:8051, status=500, message=error in simulation: failed to execute transaction d6c2483dfcc735db341106d9da51c9a5cdf0610931df4cc17fe2757e0cd3a01c: could not launch chaincode emissionscontract_1.0:0673e1940851448d9f182d24c28b0788f0747ecc16801d7bb33d71fba7aaa69c: chaincode registration failed: container exited with 1
    peer=peer1.auditor1.carbonAccounting.com:7051, status=500, message=error in simulation: failed to execute transaction d6c2483dfcc735db341106d9da51c9a5cdf0610931df4cc17fe2757e0cd3a01c: could not launch chaincode emissionscontract_1.0:0673e1940851448d9f182d24c28b0788f0747ecc16801d7bb33d71fba7aaa69c: chaincode registration failed: container exited with 1
{ info:
   'Failed to submit transaction: Error: No valid responses from any peers. Errors:\n    peer=peer1.auditor2.carbonAccounting.com:8051, status=500, message=error in simulation: failed to execute transaction d6c2483dfcc735db341106d9da51c9a5cdf0610931df4cc17fe2757e0cd3a01c: could not launch chaincode emissionscontract_1.0:0673e1940851448d9f182d24c28b0788f0747ecc16801d7bb33d71fba7aaa69c: chaincode registration failed: container exited with 1\n    peer=peer1.auditor1.carbonAccounting.com:7051, status=500, message=error in simulation: failed to execute transaction d6c2483dfcc735db341106d9da51c9a5cdf0610931df4cc17fe2757e0cd3a01c: could not launch chaincode emissionscontract_1.0:0673e1940851448d9f182d24c28b0788f0747ecc16801d7bb33d71fba7aaa69c: chaincode registration failed: container exited with 1',
  utilityId: 'ASD',
  partyId: 'ASD123',
  fromDate: '2018-06-01',
  thruDate: '2018-06-30',
  energyUseAmount: 150,
  energyUseUom: 'KWH' }`
sichen1234 commented 4 years ago

Did you load the egrid-data-loader data into amazon dynamodb?

Also you need to use a real utility, for example utilityId 11208 for Los Angeles Department of Water & Power. It is going to try to look for real emissions factors of real utilities.

sichen1234 commented 4 years ago

Hey @ethicalvats Did you get it working? If not send me an email and we'll help get it up and running.

ethicalvats commented 4 years ago

I have not setup my AWS account. Will do it later and test this setup

sichen1234 commented 4 years ago

Sure. Send me an email at sichen@opensourcestrategies.com I'd like to find out more about what you're doing and see how we could help.

Si Chen Open Source Strategies, Inc.

Save the Date! 2020-11-05 6 PM EST/3AM PST Climate Accounting and Action with Hyperledger https://www.meetup.com/Hyperledger-Toronto/events/274129711/

On Mon, Nov 2, 2020 at 3:36 AM Vatsal Mishra notifications@github.com wrote:

I have not setup my AWS account. Will do it later and test this setup

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/opentaps/blockchain-carbon-accounting/issues/21#issuecomment-720418090, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANAS4POCZQGPHHUXYMRRQDSN2KSPANCNFSM4S7ESAGQ .

sichen1234 commented 3 years ago

You can now use localdynamodb. We've updated our instructions. Pls take a look and let us know if this continues to be a problem.

sichen1234 commented 3 years ago

I don't think this is an issue any more, especially since we're using the fabric channel to store the emissions factor data and not using dynamodb any more.