Welcome to the new Linux Foundation Forum!

Lab 5 - error changing anchor peer

Hi,

I have set up network as described in the tutorial. However, in Lab5 when I try to switch anchor peer I receive the following error:

peer channel update -o orderer.example.com:7050 -c allarewelcome -f ./config/changeanchorpeerorg1.tx
2019-07-15 13:27:13.560 UTC [main] InitCmd -> WARN 001 CORE_LOGGING_LEVEL is no longer supported, please use the FABRIC_LOGGING_SPEC environment variable
2019-07-15 13:27:13.565 UTC [main] SetOrdererEnv -> WARN 002 CORE_LOGGING_LEVEL is no longer supported, please use the FABRIC_LOGGING_SPEC environment variable

2019-07-15 13:27:13.567 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized

Error: got unexpected status: BAD_REQUEST -- error applying config update to existing channel 'allarewelcome': error authorizing update: error validating ReadSet: proposed update requires that key [Group] /Channel/Application/Org1MSP be at version 0, but it is currently at version 1

I did obviously edit files as described in tutorial, restarted CLI container and set correct admin paths inside the CLI container. However, I still receive the same error. I also checked the ca key in the crypto config, which still match what is written in docker-compose.yml

Any tips? Thanks!

Comments

  • NiklaskkkkNiklaskkkk Posts: 58

    Obviously interested in finding the solution, without pruning the network. I guess it should be possible to fix errors without doing that each time :)

  • NiklaskkkkNiklaskkkk Posts: 58
    edited July 16

    Also, is there a spesific command to see who (which peer) is currently anchor peers within a channel? I tried the "peer channel getinfo c- allarewelcome" command, but no info about anchor peers

  • NiklaskkkkNiklaskkkk Posts: 58

    I did run the teardown.sh script, and then tried to change anchor peer from peer0 to peer1. As expected, I did work without any issues then. So I assume the issue was related to old certificated being used/referenced?
    However, my question is how to solve this issue without doing the teardown.sh script? Any way to delete old certificated manually?

  • NiklaskkkkNiklaskkkk Posts: 58

    STRANGE!
    If I do the same process again (not resetting the network, just trying to change anchor peer) by editing file, recreating transaction and restarting CLI container, the error message appear again!

    :/opt/gopath/src/github.com/hyperledger/fabric/peer# peer channel update -o orderer.example.com:7050 -c allarewelcome -f ./config/changeanchorpeerorg1.tx
    2019-07-16 10:00:54.654 UTC [main] InitCmd -> WARN 001 CORE_LOGGING_LEVEL is no longer supported, please use the FABRIC_LOGGING_SPEC environment variable
    2019-07-16 10:00:54.659 UTC [main] SetOrdererEnv -> WARN 002 CORE_LOGGING_LEVEL is no longer supported, please use the FABRIC_LOGGING_SPEC environment variable
    2019-07-16 10:00:54.660 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
    Error: got unexpected status: BAD_REQUEST -- error applying config update to existing channel 'allarewelcome': error authorizing update: error validating ReadSet: proposed update requires that key [Group] /Channel/Application/Org1MSP be at version 0, but it is currently at version 1

    Now I also tried changing the admin paths by exporting within CLI container, without help, still same error message. I do not understand why??!

    Does anyone know? @kmyatt

  • indirajithindirajith Posts: 42
    edited July 16

    I will try to provide a vague idea. The error is due to version mismatch. In fabric the configurable elements have versions. So every committed change increases the version of the particular configurable element by one. So, from the error, we can say there has been a change already and you try to change/modify/update the same element again by issuing the same command again so, there is a version mismatch. I am not sure but, I think you have a committed a change already to the application channel.

    I would like to get more details and reasoning from the experts!

  • indirajithindirajith Posts: 42

    To my understanding, the application channel is the channel of peers (I don't know why do they call it as such if this is true correct), and anchor peers are per organisation per channel. So, I think you have already updated the anchor peer for org1.

  • NiklaskkkkNiklaskkkk Posts: 58

    Thanks for reply @indirajith
    Yeah I was thinking about that, but I am inside the CLI, so I tried to edit the yml file and do it for peer0, or peer1. So the same error message appears, this is why I believe this has to do with old ceritificates maybe instead? I am not sure.

    But it should be possible to switch anchor peers multiple times, with the same procedure, right? Obviously restarting the CLI container after editing the yml file.

    ?

  • NiklaskkkkNiklaskkkk Posts: 58

    And what is the command to find out who is currently the anchor peer on the network?

  • mhgarciamhgarcia Posts: 1

    to know which the peer anchor you have to do a fetch config
    1) peer channel fetch config /etc/hyperledger/configtx/config-channel.block -c allarewelcome -o orderer.example.com:7050

    2) ../bin/configtxlator proto_decode --input config/config-channel.block --type common.Block >config/config-channel.block.json

    3) inside the json filter anchor that is going to be the anchor peer

Sign In or Register to comment.