Composer 0.13.0 - Error: Missing id
Composer 0.13.0 - Error: Missing id
我对新版本的作曲家有疑问。我的链码在 0.11 上运行良好,现在在 0.13 上运行良好,当我在链码之外添加资产时,出现错误:
Error: Missing id"
当然,ID 在创建后出现在新资产中 ;-)
当我将模拟代码放入链代码中添加资产时,出现以下错误:
Error: Error trying invoke business network. Error: chaincode error (status: 500, message: Error: Object with ID 'Resource {id=zzz.yyy.xxx.tttt#e60e56d92a6928d3f4d1c5bc9bb828c3fc0a292c26ccc35935c594ac0e160c28}' in collection with ID 'Asset:zzz.yyy.xxx.tttt' does not exist)
这里是代码的摘录(没什么特别的)
return getAssetRegistry(NS + '.ttt')
.then(function (tttRegistry) {
// Create the asset
var ttt = factory.newResource(NS, 'ttt', '12345');
// Add new ttt
return tttRegistry.add(ttt)
.then(function () {
// Emit an event
打码的身份是默认admin用户
也许,我在日志中发现了一些东西,但我不知道如何解释它
2017-09-26T20:09:39.841Z ERROR HLFConnectionManager :fabric-client() [client-utils.js]: sendPeersProposal - Promise is rejected: Error: chaincode error (status: 500, message: Error: The current identity must be activated (ACTIVATION_REQUIRED)) at /home/hyperledger/node_modules/grpc/src/node/src/client.js:554:15 {}$
2017-09-26T20:09:39.842Z ERROR HLFConnection :queryChainCode() {"message":"Error trying to query business network. Error: chaincode error (status: 500, message: Error: The current identity must be activated (ACTIVATION_REQUIRED))","stack":"Error: Error trying to query business network. Error: chaincode error (status: 500, message: Error: The current identity must be activated (ACTIVATION_REQUIRED))\n at channel.queryByChaincode.then.catch (/home/hyperledger/node_modules/composer-connector-hlfv1/lib/hlfconnection.js:754:34)"}$
2017-09-26T20:09:39.842Z ERROR HLFConnection :ping() {"message":"Error trying to ping. Error: Error trying to query business network. Error: chaincode error (status: 500, message: Error: The current identity must be activated (ACTIVATION_REQUIRED))","stack":"Error: Error trying to ping. Error: Error trying to query business network. Error: chaincode error (status: 500, message: Error: The current identity must be activated (ACTIVATION_REQUIRED))\n at _checkRuntimeVersions.then.catch (/home/hyperledger/node_modules/composer-connector-hlfv1/lib/hlfconnection.js:668:34)"}$
我找到的唯一信息是 post Hyperledger Composer:: Error: The current identity must be activated (ACTIVATION_REQUIRED) 但是,就我而言,作曲家和软件包的版本是相同的
我从 0.11 升级到 0.13 后无法理解发生了什么
有什么想法吗?
这听起来更像是模型的问题 - 您正在尝试创建一个资源,其中包含一个名为 id
的必填字段,但您没有为该字段提供值。
你有可以包含的堆栈跟踪吗?
如果默认规则 - "All resource:" 应设置为 "zzz.yyy.xxx.*"
然后部署您新更新的网络并重试。
我找到问题出在哪里了。
不是设计问题,也不是ACL有问题。
在 Composer 0.11 中,在事件中,如果您与资产有关系,在您的代码中,您可以直接访问其字段
Composer 0.13 中的行为变化,与元素的关系只是一个引用,你不能直接访问它的字段
最糟糕的是,当你调用方法factory.newRelationship()
时错误没有上升,当你调用方法assetRegistry.add()
时它上升了
所以要小心
我对新版本的作曲家有疑问。我的链码在 0.11 上运行良好,现在在 0.13 上运行良好,当我在链码之外添加资产时,出现错误:
Error: Missing id"
当然,ID 在创建后出现在新资产中 ;-)
当我将模拟代码放入链代码中添加资产时,出现以下错误:
Error: Error trying invoke business network. Error: chaincode error (status: 500, message: Error: Object with ID 'Resource {id=zzz.yyy.xxx.tttt#e60e56d92a6928d3f4d1c5bc9bb828c3fc0a292c26ccc35935c594ac0e160c28}' in collection with ID 'Asset:zzz.yyy.xxx.tttt' does not exist)
这里是代码的摘录(没什么特别的)
return getAssetRegistry(NS + '.ttt')
.then(function (tttRegistry) {
// Create the asset
var ttt = factory.newResource(NS, 'ttt', '12345');
// Add new ttt
return tttRegistry.add(ttt)
.then(function () {
// Emit an event
打码的身份是默认admin用户
也许,我在日志中发现了一些东西,但我不知道如何解释它
2017-09-26T20:09:39.841Z ERROR HLFConnectionManager :fabric-client() [client-utils.js]: sendPeersProposal - Promise is rejected: Error: chaincode error (status: 500, message: Error: The current identity must be activated (ACTIVATION_REQUIRED)) at /home/hyperledger/node_modules/grpc/src/node/src/client.js:554:15 {}$
2017-09-26T20:09:39.842Z ERROR HLFConnection :queryChainCode() {"message":"Error trying to query business network. Error: chaincode error (status: 500, message: Error: The current identity must be activated (ACTIVATION_REQUIRED))","stack":"Error: Error trying to query business network. Error: chaincode error (status: 500, message: Error: The current identity must be activated (ACTIVATION_REQUIRED))\n at channel.queryByChaincode.then.catch (/home/hyperledger/node_modules/composer-connector-hlfv1/lib/hlfconnection.js:754:34)"}$
2017-09-26T20:09:39.842Z ERROR HLFConnection :ping() {"message":"Error trying to ping. Error: Error trying to query business network. Error: chaincode error (status: 500, message: Error: The current identity must be activated (ACTIVATION_REQUIRED))","stack":"Error: Error trying to ping. Error: Error trying to query business network. Error: chaincode error (status: 500, message: Error: The current identity must be activated (ACTIVATION_REQUIRED))\n at _checkRuntimeVersions.then.catch (/home/hyperledger/node_modules/composer-connector-hlfv1/lib/hlfconnection.js:668:34)"}$
我找到的唯一信息是 post Hyperledger Composer:: Error: The current identity must be activated (ACTIVATION_REQUIRED) 但是,就我而言,作曲家和软件包的版本是相同的
我从 0.11 升级到 0.13 后无法理解发生了什么
有什么想法吗?
这听起来更像是模型的问题 - 您正在尝试创建一个资源,其中包含一个名为 id
的必填字段,但您没有为该字段提供值。
你有可以包含的堆栈跟踪吗?
如果默认规则 - "All resource:" 应设置为 "zzz.yyy.xxx.*"
然后部署您新更新的网络并重试。
我找到问题出在哪里了。 不是设计问题,也不是ACL有问题。
在 Composer 0.11 中,在事件中,如果您与资产有关系,在您的代码中,您可以直接访问其字段 Composer 0.13 中的行为变化,与元素的关系只是一个引用,你不能直接访问它的字段
最糟糕的是,当你调用方法factory.newRelationship()
时错误没有上升,当你调用方法assetRegistry.add()
所以要小心