I am following along the Getting Started with Fabric Command Line and have run into a error I don't understand how to resolve. Any ideas?
In the section entitled "Update the deployed business network" an exception is thrown. The terminal output is below. The command used:
composer network update --archiveFile digitalproperty-network#0.0.7.bna --enrollId WebAppAdmin --enrollSecret DJY27pEnl16d
Note that the id is different from the tutorial as the 0.0.7 id was reported during the previous step while creating. The output continued...
Deploying business network from archive digitalproperty-network#0.0.7.bna
Business network definition:
Identifier: digitalproperty-network#0.0.7
Description: Digital Property Network
events.js:160
throw er; // Unhandled 'error' event
^
Error
at ClientDuplexStream._emitStatusIfDone (/home/mnjacobs/.nvm/versions/node/v6.9.5/lib/node_modules/composer-cli/node_modules/grpc/src/node/src/client.js:189:19)
at ClientDuplexStream._readsDone (/home/mnjacobs/.nvm/versions/node/v6.9.5/lib/node_modules/composer-cli/node_modules/grpc/src/node/src/client.js:158:8)
at readCallback (/home/mnjacobs/.nvm/versions/node/v6.9.5/lib/node_modules/composer-cli/node_modules/grpc/src/node/src/client.js:217:12)
I've struggled to get the versions to match the tutorials - they seem inconsistent. Notably, the node (v6.9.5) and nodejs (v6.10.1) versions differ even though node is a symbolic link to nodejs and I notice 6.9.5 is in the stack trace. I'm not sure that difference is relevant to the problem.
Other version information:
Ubuntu 14.04.5
Docker version 17.03.1-ce, build c6d412e (manually installed as auto
install was down level)
docker-compose version 1.12.0-rc2, build 08dc2a4
I've seen exactly that error when Hyperledger Fabric isn't running. If docker ps doesn't show anything, run npm run startHLF in the sample-applications/packages/getting-started directory before trying again.
Related
I got stuck with the first tutorial for the test-network. I can set up a network and a channel with the network.sh-script, checked it with ‘docker ps -a’.
But trying to start the chaincode with
./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-go -ccl go
fails. The console-output complains about inconsistent vendoring and suggests ignoring the vendoring directory:
console output with GOFLAGS='-mod=readonly
If I export ‘-mod=readonly’ before deploying the chaincode the error stays the same, exporting ‘-mod=mod’ produces an error about a failed normalization of the chaincode path:
console output with GOFLAGS='mod=mod'
I’m using linux-mint 20.2 (Uma), the prerequisites are of the following versions:
git 2.25.1
curl 7.68.0
docker 20.10.14
docker-compose 1.25.0 (build unknown)
go 1.13.8
jq 1.6
Setting up the network I once had the monitordocker-skript from the second tutorial running and noticed that it shows a different go-version (1.17.5 but still above the needed 1.13.x). And printing the version of docker-compose in the terminal there are the words “build unknown” behind the version-number, don’t know if that is useful.
Does anyone know why I’m not able to start a chaincode with the test-network?
Tried it with go 1.18, but there's no change.
I am trying to deploy chaincode in devmod on my ubuntu machine. I am following this tutorial.
The issue is when I use this command : CORE_CHAINCODE_LOGLEVEL=debug CORE_PEER_ADDRESS=localhost:7052 npm start
it shows the following error:
2018-09-20T16:27:18.292Z ERROR [lib/handler.js] uncaughtException: The "peer.address" program argument must be set to a legitimate value of <host>:<port>
Full logs can be found here:
https://hastebin.com/arerozesad.sql
I am following this tutorial:
https://hyperledger-fabric.readthedocs.io/en/v1.0.6/peer-chaincode-devmode.html
First, I hope you are using Fabric v1.1 or later as Node.js chaincode is not supported in v1.0.x.
The instructions you listed are for running Go chaincode.
For Node.js chaincode, your command should look like
CORE_CHAINCODE_ID_NAME="mycc:v0" node mycc.js --peer.address grpc://localhost:7052
You should be able to replace node mycc.js with npm start as well.
See https://github.com/hyperledger/fabric-chaincode-node#test-nodejs-chaincode for more information.
I am currently trying to run through the example first application for Hyperledger Fabric here -> http://hyperledger-fabric.readthedocs.io/en/release-1.1/write_first_app.html
I am unable to get past calling node invoke.js
Originally I was getting the same error as this question Error invoking chaincode using Node.js SDK [TypeError: Cannot read property 'getConnectivityState' of undefined]
But after reverting to grpc#1.9.1 I get the following result:
I am able to do everything up to the node query.js method and that returns successfully but can't quite get past this.
Node version: 8.11.1
Docker Version:
fabric client section of package-lock.json
FYI: I am trying to run on Windows 10 mostly using the docker toolbox bash, or a separate git bash CLI.
Last piece of info!
Even though the invoke js command fails with the above error, I can see that the PUT command to couch db does go through and car10 has been successfully added.
If I check the docker logs for peer0.org1.example.com I see the following:
So did it actually work?
Code
Currently I followed this article to develop my BNA to IBM blockchain cloud platform (started plan). Unluckily, I got the error when I try to run this line of code:
composer network start -c admin#mynetwork-fabric -A admin -C ./creds/admin-pub.pem -f delete.card -n my_network -V 0.0.4
Error
I am very sure that all parameters are good, the full errors are:
Error: Error trying to start business network. Error: No valid responses
from any peers.
Response from attempted peer comms was an error: Error: 2 UNKNOWN:
premature execution - chaincode (my_network:0.0.4) launched and
waiting for registration
Or sometimes the error is:
Error: Error trying to start business network. Error: No valid responses
from any peers.
Response from attempted peer comms was an error: Error:
REQUEST_TIMEOUT
I understand sometimes maybe there is a timeout, but I do not really got the launched and waiting for registration error.
P.S.
My hyperledger composer version is 0.19.
I also view this deploying tutorial, there might be some different commands, because of the different versions of Hyperledger Composer. I checked the composer hep to transfer the commands to running on composer 0.19.
Solution:
down grade composer-cli to 0.18.1
change your package.json, composer-cli to 0.18.1
npm install to create new bna
reinstall
restart
If you are using IBM Cloud Starter Plan, then you need to be using v0.18.1 of Composer not v0.19.
Also, this is the doc you should be following:
https://console.bluemix.net/docs/services/blockchain/develop_starter.html#deploying-a-business-networks-on-starter-plan
Steps "git clone...", "startFabric.sh" and "npm.install" complete with no errors. "node query.js" results in:
Set wallet path, and associate user PeerAdmin with application
error: [Client.js]: Failed to load user "PeerAdmin" from local key value store. Error: TypeError: this is not a typed array.
at Function.from (native)
at importKey (/home/peter/fabric-samples/fabcar/node_modules/fabric-client/lib/impl/CryptoSuite_ECDSA_AES.js:180:26)
at fromString (/home/peter/fabric-samples/fabcar/node_modules/fabric-client/lib/User.js:228:28)
at /home/peter/fabric-samples/fabcar/node_modules/fabric-client/lib/Client.js:968:22
error: [Client.js]: Failed to load an instance of requested user "PeerAdmin" from the state store on this Client instance. Error: TypeError: this is not a typed array.
at Function.from (native)
at importKey (/home/peter/fabric-samples/fabcar/node_modules/fabric-client/lib/impl/CryptoSuite_ECDSA_AES.js:180:26)
at fromString (/home/peter/fabric-samples/fabcar/node_modules/fabric-client/lib/User.js:228:28)
at /home/peter/fabric-samples/fabcar/node_modules/fabric-client/lib/Client.js:968:22
Caught Error [TypeError: this is not a typed array.]
Note: after the git clone step, there is no "chaincode" in fabric-samples/fabcar as stated in the docs, but there is a chaincode/fabcar in fabric-samples. This does not seem to cause a problem.
Note: All steps in "Building Your First Network" complete with no problems.
Hyperledger Fabric 1.0 has been tested against Node.js version >= 6.9 and < 7.x. If you get a similar error, recommend updating the version of Node.js (or use a version manager such as nvm) and re-try. If you have already run npm install with an older version of Node, you should delete the node_modules tree and re-run npm install to be sure you are installing the correct dependencies.