【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


提交成功:



目录
相关文章
|
4月前
|
安全 网络安全 开发者
OpenScManager failed , error code = 5
【10月更文挑战第7天】OpenScManager failed , error code = 5
181 3
|
9月前
|
Java
failed to solve with frontend dockerfile.v0: failed to create LLB definition: unexpected status code
failed to solve with frontend dockerfile.v0: failed to create LLB definition: unexpected status code
150 0
|
9月前
|
应用服务中间件 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
291 0
schannel: next InitializeSecurityContext failed: SEC_E_ILLEGAL_MESSAGE (0x80090326)
schannel: next InitializeSecurityContext failed: SEC_E_ILLEGAL_MESSAGE (0x80090326)
440 0
schannel: next InitializeSecurityContext failed: SEC_E_ILLEGAL_MESSAGE (0x80090326)
Error information: “Error: SignerSign() failed.“ (-2147012889/0x80072ee7)
Error information: “Error: SignerSign() failed.“ (-2147012889/0x80072ee7)
140 0
SignTool Error: An error occurred while attempting/Error information: “SignerTimeStamp() failed.“
SignTool Error: An error occurred while attempting/Error information: “SignerTimeStamp() failed.“
162 0
abort: error: Temporary failure in name resolution
abort: error: Temporary failure in name resolution
207 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
176 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).解决方法
504 0
Whitelabel Error Page There was an unexpected error (type=Not Found, status=404). No message availab
Whitelabel Error Page There was an unexpected error (type=Not Found, status=404). No message availab
203 0