Composer 0.13.0 - Error: Missing id - hyperledger-composer

I have a problem with the new version of composer. My chaincode worked fine with the 0.11, now with the 0.13, when I add an asset outside of a chaincode, I have the error:
Error: Missing id"
Of course, the ID is present in the new asset after the creation ;-)
When I put the analog code in a chaincode to add the asset, I have the following error:
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)
Here an extract of the code (nothing special)
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
The identity which plays the code is the default admin user
Perhaps, I found something in logs, but I don'y know how to interpret it
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)"}$
The only info I found is this post Hyperledger Composer:: Error: The current identity must be activated (ACTIVATION_REQUIRED) but, in my case, versions of composer and packages are the same
I can't understand what's happening since I upgrade from 0.11 to 0.13
Any idea?

I found where the problem comes from.
It is not a design problem or something wrong with the ACL.
In Composer 0.11, in an event, if you have a relationship to an asset, in your code, you can access directly to its fields
Behavior change in Composer 0.13, the relationship to an element is only a reference, you can not access directly to its fields
Worst, the error is not rised when you call the method factory.newRelationship(), it is rised when you call the method assetRegistry.add()
So be careful

This sounds more like an issue with the model - you are trying to create a resource which has a required field called id and you are not supplying a value for that field.
Do you have a stack trace you can include?

If the Default rule - "All resource:" should be set to "zzz.yyy.xxx.*"
Then deploy your newly updated network and try again.

Related

Parse error: Failed parsing args: missing field > account_id" on NEAR dApp

I deployed the contract on another computer and it worked, and now on a new envirenment and account the NEAR dApp is failing; here is the code:
https://github.com/bobmakesmagics/Multi-Near-NFT-Minter
// Get blockchian state once on component load and wallet is connected:f
nft.nftSupply(wallet.accountId)
.then(setTotalSupply)
.catch(console)
Error: [-32700] Parse error: Failed parsing args: missing field
account_id"
before I make the RPC call I actually console.log the args.. and there you see the account_id not missing... so what's the problem?

There is no .trace file found for performance profile ‘Leaks’

Following this example and using Javascript, get the following error when run my tests. The error is generated on the following command:
enter code heredriver.executeScript('mobile: stopPerfRecord', [
{ profileName: 'Leaks' },
]);
Error:
Got this error “Request failed with status 500 due to An unknown server-side error occurred while processing the command. Original error: There is no .trace file found for performance profile ‘Time Profiler’ and device XXXX. Make sure the selected profile is supported on this device”

: API error (404): network hlfv11_hyperledger not found

✖ Starting business network definition. This may take a minute...
Error: Error trying to start business network. Error: No valid responses from any peers.
Response from attempted peer comms was an error: Error: failed to execute transaction b5c260c02b4792c4ae4b85b3d4ccb4565a495da399d27917dccc1a84244e631f: error starting container: error starting container: API error (404): network hlfv11_hyperledger not found
Response from attempted peer comms was an error: Error: failed to execute transaction b5c260c02b4792c4ae4b85b3d4ccb4565a495da399d27917dccc1a84244e631f: error starting container: error starting container: API error (404): network hlfv11_hyperledger not found
This looks like it is a Docker problem trying to start a new ChainCode container on a Docker Network bridge called "hlfv11_hyperledger" which doesn't exist.
(The word 'network' here is ambiguous in the error message :-( )
This is the same problem and hopefully the same solution as a previous post.

Hyperledger composer multi user identity

I am following below tutorial
https://hyperledger.github.io/composer/integrating/enabling-rest-authentication.html
I am able to complete the steps till setting up default wallet identity. After this when i try system ping method I get the error.
{
"error": {
"statusCode": 500,
"name": "Error",
"message": "Error trying to ping. Error: Error trying to query chaincode. Error: chaincode error (status: 500, message: Error: The current identity has not been registered:maeid1)",
"stack": "Error: Error trying to ping. Error: Error trying to query chaincode. Error: chaincode error (status: 500, message: Error: The current identity has not been registered:maeid1)\n at _checkRuntimeVersions.then.catch (/home/praval/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/composer-connector-hlfv1/lib/hlfconnection.js:696:34)"
}
}
The same error I get while testing from access token.
curl -v http://localhost:3000/api/system/ping?access_token=xxxxx
Though I can run network ping successfully.
composer network ping -p hlfv1 -n 'digitalproperty-network' -i maeid1 -s NfUhmXtiaSUH
Thanks for help.
The problem you are seeing is described by this issue
https://github.com/hyperledger/composer/issues/1761
Both the CLI and Rest server have enrolled the user but this results in both environments storing certificates for the same identity that differ (for example issue and expiry dates). Whichever environment used their certificate first for that identity and activated that identity/participant in the runtime has their certificate registered. When the other environment presents their certificate it isn't found (because it is different to the first environment) and so reports that the identity is not registered.
The way to address this is if you plan to use the identity in the rest server, don't ping it from the CLI first.

Can't Setup Ratchet

I am trying to setup Ratchet on my system and have followed socketo.me
I have done everything till installing ZMQ and React/Zmq and it was all successful.
But when I try to run push-server.php, the following error occurs:
Fatal error: Uncaught exception 'InvalidArgumentException' with message 'The provided listener was not a valid callable.' in C:\wamp\www\ratchet\vendor\evenement\evenement\src\Evenement\EventEmitter.php on line 21
InvalidArgumentException: The provided listener was not a valid callable. in C:\wamp\www\ratchet\vendor\evenement\evenement\src\Evenement\EventEmitter.php on line 21
I have already set the PATH variable and enabled the php_zmq extension(I am on Windows using WAMP).
I have searched a lot but can't get through this problem, please help.
What have you done ?
You have changed the event to be called
$pull->on('message', array($pusher, 'onBlogEntry'));
you have changed the onBlogEntry with a function that you didn't declare in your pusher ..
that's it

Resources