Hyperledger Fabric 2.3.3 install TypeScript chaincode issue can't invoke despite chaincode being installed? - docker

Good day to you!
I'm doing some fairly advanced work with Hyperledger Fabric network setup, using Kubernetes and a bunch of custom shell scripts--each with commands inspired by fabric-samples--to run each phase of chaincode packaging and installation and I have debugged an issue I'm facing WRT switching an existing HLF project from Go chaincode to TS to the nth degree (have tried all sorts too) and I am baffled as to why it is not working...
I have plenty of context and output I can provide, however in a nutshell:
the chaincode packages, installs, approves & commits 100% successfully on all three of my peer organizations (org1, org2, org3)
all peer lifecycle chaincode <query> commands return successes (installed, approved, committed)
each command which can be passed the --init-required flag has it, and the invoke command uses flag --isInit
When trying to invoke however, it throws an error (redacted environment specific outputs):
make sure the chaincode <cc_name> has been successfully defined on channel <channel_id> and try again: chaincode definition for '<cc_name>' exists, but chaincode is not installed
Meanwhile, if I query the committed chaincode (works on all 3 orgs):
peer lifecycle chaincode querycommitted -C ${CHANNEL_ID} -n ${CC_NAME} >&log.txt
cat log.txt
Outputs:
Committed chaincode definition for chaincode '<cc_name>' on channel '<channel_id>'
Version: 1.0, Sequence: 1, Endorsement Plugin: escc, Validation Plugin: vscc, Approvals: [Org1MSP: true, Org2MSP: true, Org3MSP: true]
Also, if I run peer lifecycle chaincode queryinstalled:
=========================
Querying installed chaincode inside Docker container [admin] for Organization org1...
Installed chaincodes on peer:
Package ID: <package_id>, Label: <label>
Query installed successful on peer0.org1 on channel allorgs [via admin].
=========================
Querying installed chaincode inside Docker container [admin] for Organization org2...
Installed chaincodes on peer:
Package ID: <package_id>, Label: <label>
Query installed successful on peer0.org2 on channel allorgs [via admin].
=========================
Querying installed chaincode inside Docker container [admin] for Organization org3...
Installed chaincodes on peer:
Package ID: <package_id>, Label: <label>
Query installed successful on peer0.org3 on channel allorgs [via admin].
=========================
To all intents and purposes, this is doing everything I have seen it do in the Go examples and should be considered installed, I'm not sure what else to try at this stage. I've had it configured where the package IDs generated on each org are different, but currently they all install the same packaged chaincode so all of those <package_id> entries match.
Finally, just to avoid wasting any time, this is the output for peer lifecycle chaincode queryapproved ...:
=========================
Querying approved chaincode inside Docker container [admin] for Organization org1...
Approved chaincode definition for chaincode '<cc_name>' on channel '<channel_id>':
sequence: 1, version: 1.0, init-required: true, package-id: <package_id>, endorsement plugin: escc, validation plugin: vscc
Query approved successful on peer0.org1 on channel <channel_id> [via admin].
=========================
Querying approved chaincode inside Docker container [admin] for Organization org2...
Approved chaincode definition for chaincode '<cc_name>' on channel '<channel_id>':
sequence: 1, version: 1.0, init-required: true, package-id: <package_id>, endorsement plugin: escc, validation plugin: vscc
Query approved successful on peer0.org2 on channel <channel_id> [via admin].
=========================
Querying approved chaincode inside Docker container [admin] for Organization org3...
Approved chaincode definition for chaincode '<cc_name>' on channel '<channel_id>':
sequence: 1, version: 1.0, init-required: true, package-id: <package_id>, endorsement plugin: escc, validation plugin: vscc
Query approved successful on peer0.org3 on channel <channel_id> [via admin].
=========================
Is it possible this error is happening for some other unclear reason such as the chaincode failing to execute... or? All suggestions welcome. I tried asking in the Hyperledger chat but no response from anyone there yet.
Thanks in advance,
Alex

I vaguely remember having a similar problem and you need to make sure package-ids and labels match up. Look on your peers where the chaincode package is installed. If you use the standard docker test images then you can exec into them and look in dir /var/hyperledger/production/lifecycle/chaincodes/
For example, my package-id is basic_1.0:db124ba32ae478421c66bb26fcd151326ae4ce5fa01e198a7ad9415ce31aa8c4 my chaincode name is basic and the version is 1.0 when creating the chaincode definition
my installed chaincode
/var/hyperledger/production/lifecycle/chaincodes # ls
basic_1.0.db124ba32ae478421c66bb26fcd151326ae4ce5fa01e198a7ad9415ce31aa8c4.tar.gz
my packaged chaincode metadata is
{"path":"../../chaincode/node","type":"node","label":"basic_1.0"}
Make sure everything matches correctly (the label is a concatenation of name and version)

Related

Isilon Cluster - SyncIQ Job Failed with No node on source cluster was able to connect to target cluster

enter image description here
Note : Disbaled encryption in both cluster and I'm using trial licencse, Both cluster's OneFS version is 9.1 and i tried 9.1 between 9.4 too.
The SyncIQ log /var/log/isi_migrate.log shows "Killing policy: No node on source cluster was able to connect to target cluster." message.
When i try to start job, I'm getting above error. can you tell what am i missing or is there Some configuration needs to done before run the job?

How to fix HyperLedger Composer network start error that reports failure to start container?

I am having difficulty starting a new business network using HyperLedger Composer. I have been following this developer’s guide:
https://hyperledger.github.io/composer/latest/tutorials/developer-tutorial.
I have successfully completed all of the steps leading up to the composer network start command, including installing the network. When I run:
composer network start --networkName tutorial-network --networkVersion 0.0.1 --networkAdmin admin --networkAdminEnrollSecret adminpw --card PeerAdmin#hlfv1 --file networkadmin.card
I receive the following error:
“ ✖ 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
eda196cff575945b24d2e123823f1b4ba3fefdf8c1525794f7869b47acad906e:
error starting container: error starting container: Failed to generate
platform-specific docker build: Error returned from build: 127
"/bin/sh: npm: not found
Command failed “
A few notes:
- I have used "composer archive list -a tutorial-network.bna” to confirm the version and network name
- I have checked that the network name is correct in the start command
- A few of the posts I have read and followed regarding this issue are listed below, and they have not solved the problem I am facing:
https://github.com/hyperledger/composer/issues/4043
https://github.com/hyperledger/composer/issues/3794
v0.19.2 hyperledger composer network start failed
One thing I have noticed is that the peer admin card is not associated with a business network, as determined by running:
composer network list --card PeerAdmin#hlfv1
I am not sure how to associate the card with a network, or if that is causing any issues.
Any suggestions regarding what may be causing this issue would be greatly appreciated, thank you.

Getting No valid responses from any peers. error when trying to "network start"

I am following the tutorial on: https://hyperledger.github.io/composer/v0.19/applications/web
To implement a frontend to my chain code. But when I try to put in the command:
composer network start --networkName perishable-network --networkVersion 0.2.7-deploy.0 --networkAdmin admin --networkAdminEnrollSecret adminpw --card PeerAdmin#hlfv1
It gives me the error:
✖ 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: 2 UNKNOWN: chaincode error (status: 500, message: is
not a valid endorsement system chaincode) Command failed
When I did composer install on my bna however I got this information which I am using in the network start command.
✔ Installing business network. This may take a minute... Successfully
installed business network perishable-network, version 0.2.7-deploy.0
Command succeeded
How can I fix this error?
You are trying to use Composer 0.20 with Hyperledger Fabric 1.1. Unfortunately they are not compatible. You should either downgrade to Composer 0.19 or upgrade your fabric for 1.2

HYPERLEDGER : Error While Starting Business Network

I am researching on Hyperledger. After going through the basic tutorials and documentation, I have started setting up a Blockchain Business Network With Hyperledger Fabric & Composer Running on Multiple Physical Machine as described on https://www.skcript.com/svr/setting-up-a-blockchain-business-network-with-hyperledger-fabric-and-composer-running-in-multiple-physical-machine/.
I am already done with setting up the Hyperledger environment. We are able to create business network archives (.bna) and business cards (.card) as well. But while I try to start the created business network (using composer network deploy and composer network start commands on Ubuntu CLI) the CLI responds with an error saying,
composer network start --networkAdmin admin --networkAdminEnrollSecret
adminpw --card admin#admin_conn --file admin.card -a
basic-sample-network.bna Starting business network from archive:
basic-sample-network.bna Business network definition:
Identifier: basic-sample-network#0.2.0-20180102082548
Description: The Hello World of Hyperledger Composer samples
Processing these Network Admins:
userName: admin
Starting business network definition. This may take a minute... Error:
Error trying to instantiate composer runtime. Error: No valid
responses from any peers. Response from attempted peer comms was an
error: Error: chaincode error (status: 500, message: cannot get
package for the chaincode to be instantiated
(basic-sample-network:0.16.6)-open
/var/hyperledger/production/chaincodes/basic-sample-network.0.16.6: no
such file or directory)
And on the playground UI,
It would be great if any of you could guide me to solve this problem.
Thanks in advance.
UPDATE :
Version of Composer : v0.19.0
Worked Out Link : https://hyperledger.github.io/composer/latest/business-network/bnd-deploy
This is where I got stucked now.
composer network install command worked fine. But network start command is not working fine.
user1#peer2:~/fabric-tools/rosternetwork$ composer network start --networkName rosternetwork --networkVersion 1.0.0 --card PeerAdmin#hlfv1 --networkAdmin admin -S adminpw
Response from attempted peer comms was an error: Error: 2 UNKNOWN: chain code error (status: 500, message: cannot get package for chaincode (rosternetwork:1.0.0))
Command failed
Starting business network rosternetwork at version 1.0.0
Processing these Network Admins:
userName: admin
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: 2 UNKNOWN: chaincode error (status: 500, message: cannot get package for chaincode (rosternetwork:1.0.0))
Command failed
Searched with the error message, but didn't found any solution.

DataStax AMI installed in VPC hangs at Installation started

I experienced this issue today with ami-ada2b6c4 creating a new instance in a VPC without a public IP - logged in via SSH and the terminal hangs on Installation started.
I used Ctrl-C to interrupt and this printed on the terminal:
Installation started ^CTraceback (most recent call last):
File "datastax_ami/ds4_motd.py", line 239, in <module>
run()
File "datastax_ami/ds4_motd.py", line 228, in run
waiting_for_status()
File "datastax_ami/ds4_motd.py", line 100, in waiting_for_status
time.sleep(5)
KeyboardInterrupt
I followed a link to github posted by joaquin for a similar problem and added an entry to /etc/hosts. Logged off the instance and then reconnected. this time, got a different error.
Raiding complete
Waiting for nodetool...
The cluster is now in it's finalization phase. This should only take a moment...
Note: You can also use CTRL+C to view the logs if desired:
AMI log: ~/datastax_ami/ami.log
Cassandra log: /var/log/cassandra/system.log
Note: Ownership information does not include topology; for complete information, specify a keyspace
Datacenter: Solr
================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
-- Address Load Owns Host ID Token Rack
UN 10.0.10.92 53 KB 100.0% c010f1d3-3d74-4c2b-ae88-9e3fecfc447c -9223372036854755808 rack1
Opscenter: http://10.0.10.92:8888/
Please wait 60 seconds if this is the cluster's first start...
Tools:
Run: datastax_tools
Demos:
Run: datastax_demos
Support:
Run: datastax_support
------------------------------------
DataStax AMI for DataStax Enterprise
and DataStax Community
AMI version 2.5
DataStax Enterprise version 4.5.2-1
------------------------------------
These notices occurred during the startup of this instance:
[ERROR] 10/15/14-18:16:08 git pull:
error: Failed connect to github.com:443; Connection timed out while accessing https://github.com/riptano/ComboAMI.git/info/refs
The security group does allow access to the internet - I was able to sudo apt-get update, for example.
A couple of learnings from my experience. Joaquin from Datastax was very helpful with his suggestions.
I passed in userdata using the advanced config in AWS Management GUI -
--clustername EIP_ami --totalnodes 3 --version enterprise --username some.guy_some.com --password changeme --searchnodes 3
but didn't change the number of instances to 3 in the GUI so only one node was created. this may have contributed to the problem.
After interrupting the initial hanging installation -
added this entry to /etc/hosts:
127.0.1.1 ip-10-0-1-234
added an elastic IP to the instance and rebooted
I got to the 2nd error:
These notices occurred during the startup of this instance:
[ERROR] 10/15/14-18:16:08 git pull:
error: Failed connect to github.com:443; Connection timed out while accessing https://github.com/riptano/ComboAMI.git/info/refs
When I got to a bash prompt, I tested the git pull manually per Joaquin's advice:
ubuntu#ip-10-0-1-234:~/datastax_ami$ git pull
Already up-to-date.
per Joaquin:
Yes, that error message will stick around for the life of the machine.
Perhaps the git pull issue was a fluke.
Nodetool status says the node is up and acting normally. So, the learning here is to ignore the errors - none of them seem to affect the creation or operation of the node.

Resources