Welcome to the new Linux Foundation Forum!

Lab 7. peer1.org2 can't join channel?

Hello,

in lab 7 i'm experiencing problems on the following task: Join New Peers to the Channel and Install Chaincode
We need to join the channel "allarewelcome" with the allarewelcome.block. But that block is never fetched?

How can i get that block? Seeing this is not in the information...

Comments

  • akoitaakoita Posts: 9

    Hello @benjamin.verhaegen,

    I think the lab 7 worked for me. Can you provide your command and the error message?

  • kmyattkmyatt Posts: 39

    Following up on this, @benjamin.verhaegen, please post your command, logs, possible error output if you have one, as well as a screenshot of what is in your current working directory after you run the command..

    @akoita thank you for the follow up confirmation that you were able to complete the lab as well. keep up the great work!

  • I fixed the error by fetching the allarewelcome.block with peer0.org1.example.com with following command:
    peer channel fetch oldest allarewelcome.block -c allarewelcome --orderer orderer.example.com:7050

    This made the block file available on the cli container, so I could join the channel with my org2 peers.

  • PaulAmehUgw1PaulAmehUgw1 Posts: 19

    Hello,

    Trying to send the changes off to the network for approval:

    peer channel update -f org2SubmitReady.pb -c allarewelcome -o orderer.example.com:7050

    Response:

    2019-06-20 07:08:53.187 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
    Error: got unexpected status: BAD_REQUEST -- error authorizing update: ConfigUpdate for channel '' but envelope for channel 'allarewelcome'

    Any idea what could be missing?

  • PaulAmehUgw1PaulAmehUgw1 Posts: 19

    Hi all, I solved it. There is a print error at

    echo
    '{"payload":{"header":{"channel_header":{"channel_id":"allarewelcome",
    "type":2}},"data":{"config_update":'$(cat configProposal_Org2.json)'}}}'
    | jq . > org2SubmitReady.json

    Just before jq there is "|" which shouldn't be there. I deleted and the rest worked.

  • kmyattkmyatt Posts: 39
    edited June 20

    @PaulAmehUgw1 The command in the pdf with the | Is incorrect. That is intentional. So actually the problem is not a print error from the book. Your error is coming from somewhere else before. You probably just missed an simple character(happens to us all). I've confirmed the pdf is on track by rerunning the update commands, and received a successful update.

    So I can help you, Please post the history of commands from the time you fetched the original config block to the time you sent the update to the network so I can take a further look at it, for you.

  • PaulAmehUgw1PaulAmehUgw1 Posts: 19

    Hi,

    Running this command:
    peer channel update -f org2SubmitReady.pb -c allarewelcome -o \
    orderer.example.com:7050

    Returns a bad request error:

    2019-06-20 17:45:31.370 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized

    Error: got unexpected status: BAD_REQUEST -- error authorizing update: ConfigUpdate for channel '' but envelope for channel 'allarewelcome'

    Error: failed to create deliver client: orderer client failed to connect to orderer.example.com:7050: failed to create new connection: context deadline exceeded

    Any idea?

  • kmyattkmyatt Posts: 39
    edited June 20

    I believe The first has to deal with the header, problem possibly occurred somewhere from when the update file was sealed and reencoded . The second error looks Like an issue w/ your orderer

  • kmyattkmyatt Posts: 39

    So I can help you, Please post the history of commands from the time you fetched the original config block to the time you sent the update to the network so I can take a further look at it, for you.

  • PaulAmehUgw1PaulAmehUgw1 Posts: 19

    @kmyatt i redo the steps and i was able to resolve it by making sure my FABRIC_CA_SERVER_CA_KEYFILE was correctly defined.

    And now, I'm having errors with the endorsement policy.

    peer chaincode upgrade -n ccForAll -v 1.1 -o orderer.example.com:7050 --policy "AND('Org1.peer', 'Org2.peer' OR ('Org1.admin'))" -C '{"Args":["Mach", "50"]}'

    Error:
    2019-06-21 11:59:23.606 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default escc
    2019-06-21 11:59:23.606 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default vscc
    Error: invalid policy AND('Org1.peer', 'Org2.peer' OR ('Org1.admin'))
    Usage:

    I also included channel below but other error persist.

    peer chaincode upgrade -n ccForAll -v 1.1 -C allarewelcome -o orderer.example.com:7050 --policy "AND ('ORg1.peer', 'Org2.peer', OR ('Org1.admin') )" -c '{"Args":["Mach","50"]}'

    Response:
    2019-06-21 12:12:34.070 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default escc
    2019-06-21 12:12:34.070 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default vscc
    Error: could not assemble transaction, err proposal response was not successful, error code 500, msg cannot get package for chaincode (ccForAll:1.1)

  • PaulAmehUgw1PaulAmehUgw1 Posts: 19

    @kmyatt Even though I got invalid policy error error, i ran this command:
    peer chaincode list --instantiated -C allarewelcome

    Result:

    Get instantiated chaincodes on channel allarewelcome:
    Name: ccForAll, Version: 1.1, Escc: escc, Vscc: vscc

    If the output means it worked, then the initial invalid policy response could be a bug. Please confirm.

    Thanks

  • PaulAmehUgw1PaulAmehUgw1 Posts: 19

    I noticed this log result:
    mem3_shards:load_shards_from_disk/1(line:370) <= mem3_shards:load_shards_from_disk/2(line:399) <= mem3_shards:for_docid/3(line:86) <= fabric_doc_open:go/3(line:38) <= chttpd_auth_cache:ensure_auth_ddoc_exists/2(line:187) <= chttpd_auth_cache:listen_for_changes/1(line:134)
    couchdbOrg1Peer1 | [error] 2019-06-21T15:08:42.413526Z [email protected] emulator -------- Error in process <0.555.0> with exit value:
    couchdbOrg1Peer1 | {database_does_not_exist,[{mem3_shards,load_shards_from_db,"_users",[{file,"src/mem3_shards.erl"},{line,395}]},{mem3_shards,load_shards_from_disk,1,[{file,"src/mem3_shards.erl"},{line,370}]},{mem3_shards,load_shards_from_disk,2,[{file,"src/mem3_shards.erl"},{line,399}]},{mem3_shards,for_docid,3,[{file,"src/mem3_shards.erl"},{line,86}]},{fabric_doc_open,go,3,[{file,"src/fabric_doc_open.erl"},{line,38}]},{chttpd_auth_cache,ensure_auth_ddoc_exists,2,[{file,"src/chttpd_auth_cache.erl"},{line,187}]},{chttpd_auth_cache,listen_for_changes,1,[{file,"src/chttpd_auth_cache.erl"},{line,134}]}]}

  • kmyattkmyatt Posts: 39
    edited June 24

    For the error: "Error: invalid policy AND('Org1.peer', 'Org2.peer' OR ('Org1.admin'))"

    I believe the command entered is a missing comma. Rerun this:

    peer chaincode upgrade -n ccForAll -v 1.1 -C allarewelcome -c '{"Args":["Mach","50"]}' --policy "AND('Org1.peer','Org2.peer', OR('Org1.member','org2.peer'))"

    As far as the fact that you've returned 1.1 even after the error, I believe that it's because of that time you instantiated it earlier in the thread. If you ran that and It successfully output the instantiation/upgrade then that version stays on the channel until you re-upgrade to a higher version. In order to truly see if everything you are running now (at v1.1) is taking effect you must remove the channel and redo it. It's probably easier, and quicker to simply teardown and start back up.

    Including this note just in case as well..(Do remember the instantiation is at channel level, so it doesn't need to be run more than once (at each version) if you've already successfully done it before.

    Last, for the error: _ Error: could not assemble transaction, err proposal response was not successful, error code 500, msg cannot get package for chaincode (ccForAll:1.1)_

    that output looks like you may have an issue with your state db for peer1Org1 you should make sure it's running and if it's not, recheck the configuration, take the container down, and bring it back up again. Additionally, if couchdb for Peer1Org1 is down, then it most likely caused Peer1Org1's container to exit as well.

    Hope this all helps

  • PaulAmehUgw1PaulAmehUgw1 Posts: 19

    @kmyatt Thanks, it helped!. I did it again from scratch and was able to figure it out

  • kmyattkmyatt Posts: 39

    @PaulAmehUgw1 Wonderful, I'm glad it helped! :smile:

  • indirajithindirajith Posts: 32
    edited July 3

    Hi all, In lab 7 while joining new peers, I can fetch the genesis block but can not join the channel (No errors). But when I join the channel it says not genesis block. allarewelcome block not found. Is there anyway I can get hint of what went wrong? Thanks!

  • maniankaramaniankara Posts: 11

    @indirajith I think you are fetching the config to Org2AddedConfig.pb but trying to look for allarewelcome.block.

  • indirajithindirajith Posts: 32

    @maniankara Can you explain a tad more? The channel is still allarewelcome and we add the 2nd organisation. So, we fetch the Org2AddedConfig.pb and join it to the allarewelcome channel. This is my understanding. And I use the commands provided in the lab manual. Thank you!

  • indirajithindirajith Posts: 32

    @benjamin.verhaegen said:
    I fixed the error by fetching the allarewelcome.block with peer0.org1.example.com with following command:
    peer channel fetch oldest allarewelcome.block -c allarewelcome --orderer orderer.example.com:7050

    This made the block file available on the cli container, so I could join the channel with my org2 peers.

    I even fetched the allarewelcome.block using org1 but still I can not join the channel from org2. Can anyone please help me in this? I am struck in this for more than a week.

    Thank you very much!

  • indirajithindirajith Posts: 32


  • indirajithindirajith Posts: 32

    Oops, Sorry all. It was just a typo error(allarewelocme). My bad. Now I can make peer0.org2 join the channel. But is this the way of doing the work? Fetching the genesis block using org1 then using that block to join the org2? Thank you all for your time and patience!

  • NiklaskkkkNiklaskkkk Posts: 49

    I followed the steps in the tutorial without issues, then created the org2SubmitReady.pb file
    However, when I try to sign the configuration update with CLI (as Org1) I receive the following error:

    fabric/peer# peer channel signconfigtx -f org2SubmitReady.pb
    2019-07-17 10:14:56.472 UTC [main] InitCmd -> WARN 001 CORE_LOGGING_LEVEL is no longer supported, please use the FABRIC_LOGGING_SPEC environment variable
    2019-07-17 10:14:56.475 UTC [main] SetOrdererEnv -> WARN 002 CORE_LOGGING_LEVEL is no longer supported, please use the FABRIC_LOGGING_SPEC environment variable
    2019-07-17 10:14:56.475 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
    Error: error unmarshaling Envelope: proto: can't skip unknown wire type 7

    @kmyatt

Sign In or Register to comment.