1

I am using Ubuntu 16.04.2 LTS as VM, and composer v0.19.1. I have installed all the prerequisites as well as hyperledger composer and fabric by folowing the documents at hyperledger composer playgroung. I have followed the tutorial line by line to make a business network. When I want to install the business network by the following command:

composer network install --card PeerAdmin@hlfv1 --archiveFile tutorial-network@0.0.1.bna

It gives me the following error:

No connection type provided, probably because the connection profile has no 'x-type' property defined.

The screen shot of the error is provided as well.

enter image description here

I have checked and made sure that PeerAdminCard exists by

composer card list

And of course Fabric is started. I highly appreciate if someone mentions what I am doing wrong. Thank you.

E. Erfan
  • 1,239
  • 19
  • 37
  • 1
    It may be helpful to mention. I was getting a different error. My composer version was 0.16.1. After I updated it to 0.19.1, I am getting the mentioned error. – E. Erfan Apr 15 '18 at 23:00
  • I am getting the same error after I updated my Fabric installation. From my previous scripts I noticed that the composer command has changed. It used to be "composer runtime install --card PeerAdmin@hlfv1 --businessNetworkName tutorial-network", now it is "composer network install --card PeerAdmin@hlfv1 --archiveFile tutorial-network@0.0.1.bna" – xkcd Apr 16 '18 at 02:36

3 Answers3

3

The 2nd problem you are having is with the createPeerAdminCard.sh script - you are using an 'old' version of the where the default is Fabric v1.0.

The default is assuming hlfv1 because the environment variable FABRIC_VERSION is not set. So the createPeerAdminCard.sh script assumes you want a hlfv1 card and creates the files, but Composer v0.19 can't import that old card at the end of the script.

The fast solution is to export FABRIC_VERSION="hlfv11" then run the createPeerAdminCard.sh

I suspect that you may also have a problem with hlfv1 / v11 with the Fabric. You can check the Fabric version by running docker ps or docker images - if they have 1.0 at the end you need to remove them all and run downloadFabric.sh in the same window as you exported the FABRIC_VERSION variable, then run startFabric.sh

You need to remember to export that environment variable everytime you run one of those Fabric Tools scripts - so the better answer might be to delete the Fabric Tools folder and all docker Images and Containers - then download a new version of Fabric tools which includes the new default for Fabric 1.0

R Thatcher
  • 5,550
  • 1
  • 7
  • 15
  • 1
    Thank you very much. This was great. I have indeed problem with hlfv1/v11. This definitely worths being in a seperate question, because I am sure people face this problem and not everything is explained in composer-playground docs like this one. Can you please put this answer there? – E. Erfan Apr 18 '18 at 12:29
1

I was getting exactly the same error as you. Turns out if you update the Composer from version 0.16 or earlier, the card store still has the old PeerAdmin card which is now not compatible with version 0.19. Even deleting the card using composer card delete --card <CARD_NAME_HERE> doesn't work. The quick and dirty solution is to manually delete the card store. It is normally in ${HOME}/.composer, so to deleting this directory should work.

rm -fr ${HOME}/.composer

For your other problems, the easiest solution is to replace your older version of Hyperledger and do a new install from scratch. That means removing composer as well as killing and removing all previous Docker containers:

docker kill $(docker ps -q)
docker rm $(docker ps -aq)
docker rmi $(docker images dev-* -q)

Basically start from a clean slate if you can!

xkcd
  • 414
  • 5
  • 19
  • This is correct. Delete the folder with old incompatible cards. Make sure you are running Composer v0.19 AND Fabric 1.1 GA. Then re-run createPeerAdminCard.sh – R Thatcher Apr 16 '18 at 09:01
  • I did it. But now I can't even create PeerAdminCard. This is the error I am getting now: (Because the error is too long, I put it in the next 3 comments) – E. Erfan Apr 16 '18 at 09:47
  • ./createPeerAdminCard I get: fan-VirtualBox:~/fabric-tools$ ./createPeerAdminCard.sh Development only script for Hyperledger Fabric control Running 'createPeerAdminCard.sh' FABRIC_VERSION is unset, assuming hlfv1 FABRIC_START_TIMEOUT is unset, assuming 15 (seconds) Using composer-cli at v0.19.1 composer card list List all business network cards Options: --help Show help [boolean] -v, --version Show version number [boolean] --card, -c The name of the card to list [string] --quiet, -q Only display the card name [boolean] Unknown argument: n – E. Erfan Apr 16 '18 at 09:48
  • Unknown argument: n Successfully created business network card file to Output file: /tmp/PeerAdmin@hlfv1.card Command succeeded Failed to import the business network card keyword: required dataPath: schemaPath: #/required params: missingProperty: x-type message: should have required property 'x-type' keyword: required dataPath: schemaPath: #/required params: missingProperty: client message: should have required property 'client' keyword: required dataPath: schemaPath: #/required params: missingProperty: certificateAuthorities ' – E. Erfan Apr 16 '18 at 09:48
  • message: should have required property 'certificateAuthorities' keyword: required dataPath: schemaPath: #/required params: missingProperty: channels message: should have required property 'channels' keyword: type dataPath: .orderers schemaPath: #/type params: type: object message: should be object keyword: type dataPath: .peers schemaPath: #/type params: type: object message: should be object Error: Errors found in the connection profile in the card Command failed – E. Erfan Apr 16 '18 at 09:49
  • @E.Erfan - You also need to update the contents of the fabric-tools directory. Basically backup and remove your old fabric-tools dir and redo the Step 4 of the tutorial page you linked in your question. – xkcd Apr 17 '18 at 20:23
0

When you upgrade the composer modules from an earlier version to the latest version connection profile will not be compatible with the system. An ideal solution is to remove and delete the composer folder and create the .composer folder from the home directory and try creating PeerAdmin card again. Once that is done you are good to go for installing the starting the new business network application.

Bhavesh Patadiya
  • 25,740
  • 15
  • 81
  • 107
  • thank you for your answer. I removed it by rm -fr ${HOME}/.composer but now I am getting an error after PeerAdminCard is being created. This is the error: Failed to import the business network card keyword: required dataPath: schemaPath: #/required params: missingProperty: x-type message: should have required property 'x-type' The error is much longer. But after I check composer card list, there is no PeerAdminCard! – E. Erfan Apr 16 '18 at 09:51
  • I wonder if it is a different question, because in fact PeerAdminCard is deleted this way. But then I am getting this strange error! – E. Erfan Apr 16 '18 at 11:16
  • 1. Delete the .composer folder. 2. go to fabric-tool folder via terminal. 3. call ./createPeerAdmin sh command. This should create the peeradmin admin card for your machine. 3. Create the archive of your project once again. 4. Install the archive with the same peeradmin card in fabric environment. 5. start the network with the command you mentioned into your question. – Bhavesh Patadiya Apr 17 '18 at 05:56