【ERROR】Error: transaction invalidated with status (ENDORSEMENT_POLICY_FAILURE)

简介: 【ERROR】Error: transaction invalidated with status (ENDORSEMENT_POLICY_FAILURE)

fabric提交链码时报错:Error: transaction invalidated with status (ENDORSEMENT_POLICY_FAILURE)


peer lifecycle chaincode commit -o orderer.example.com:7050 --channelID mychannel --name oilcc --version 1.0 --sequence 1 --init-required --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem --peerAddresses peer0.department1.example.com:7051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/department1.example.com/peers/peer0.department1.example.com/tls/ca.crt




报错说得很明白,department2节点没有进行背书。

先查询一下链码定义是否已经被所有组织批准: peer lifecycle chaincode queryapproved --channelID mychannel --name oilcc --sequence 1 --output json



两个组织都为true,说明问题应该不是出在背书策略上。

返回去查看commit命令,发现该命令只写了一个department1组织,但该网络中一共有两个组织,必须所有的组织都进行提交才能将链码正常运行在fabric通道中。结合报错的大意:department1提交成功,但department2缺少相应背书策略。

补上另一个组织department2:


peer lifecycle chaincode commit -o orderer.example.com:7050 --channelID mychannel --name oilcc --version 1.0 --sequence 1 --init-required --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem --peerAddresses peer0.department1.example.com:7051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/department1.example.com/peers/peer0.department1.example.com/tls/ca.crt --peerAddresses peer0.department2.example.com:9051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/department2.example.com/peers/peer0.department2.example.com/tls/ca.crt


提交成功:



目录
相关文章
|
7月前
|
应用服务中间件 Python 容器
ERROR [ntContainer#0-1] o.s.a.r.l.SimpleMessageListenerContainer 1917: Failed to check/redeclare aut
ERROR [ntContainer#0-1] o.s.a.r.l.SimpleMessageListenerContainer 1917: Failed to check/redeclare aut
242 0
|
7月前
|
NoSQL Redis
解决(error) ERR Errors trying to SHUTDOWN. Check logs.问题~
解决(error) ERR Errors trying to SHUTDOWN. Check logs.问题~
187 0
|
数据安全/隐私保护
Do Sync Disk 0 Part 0 Failed, code=S3_F42, msg=Sync Failed after retry 5 times
Do Sync Disk 0 Part 0 Failed, code=S3_F42, msg=Sync Failed after retry 5 times
191 1
ERR Errors trying to SHUTDOWN. Check logs.
ERR Errors trying to SHUTDOWN. Check logs.
122 0
schannel: next InitializeSecurityContext failed: SEC_E_ILLEGAL_MESSAGE (0x80090326)
schannel: next InitializeSecurityContext failed: SEC_E_ILLEGAL_MESSAGE (0x80090326)
416 0
schannel: next InitializeSecurityContext failed: SEC_E_ILLEGAL_MESSAGE (0x80090326)
SignTool Error: An error occurred while attempting/Error information: “SignerTimeStamp() failed.“
SignTool Error: An error occurred while attempting/Error information: “SignerTimeStamp() failed.“
149 0
Error information: “Error: SignerSign() failed.“ (-2147012889/0x80072ee7)
Error information: “Error: SignerSign() failed.“ (-2147012889/0x80072ee7)
128 0
abort: error: Temporary failure in name resolution
abort: error: Temporary failure in name resolution
199 0
unknown type name err_status_t; did you mean srtp_err_status_t/err_status_ok/err_status_replay_fail
unknown type name err_status_t; did you mean srtp_err_status_t/err_status_ok/err_status_replay_fail
163 0
|
Go iOS开发
The operation couldn’t be completed. Unable to log in with account 'myappleid'. An unexpected failure occurred while logging in (Underlying error code 1100).解决方法
The operation couldn’t be completed. Unable to log in with account 'myappleid'. An unexpected failure occurred while logging in (Underlying error code 1100).解决方法
455 0