Hyperledger fabric system channel orderers update error 1.4

ghz 8months ago ⋅ 115 views

Im trying to update the system channel in order to add a new Orderer.

The protobuf is signed by the organization admin and I see that it gets to the Orderer that I send the transaction, but I can not see any other related logs on the other 2 channels of the organization.

I can provide more info if needed, thank you.

When the transaction is rejected, this is what I see on the orderer log.

2024-04-16 09:34:56.349 UTC [cauthdsl] func2 -> DEBU 10429ee3 0xc001d84cd0 principal evaluation succeeds for identity 0
2024-04-16 09:34:56.349 UTC [cauthdsl] func1 -> DEBU 10429ee4 0xc001d84cd0 gate 1713260096348359729 evaluation succeeds
2024-04-16 09:34:56.349 UTC [policies] Evaluate -> DEBU 10429ee5 Signature set satisfies policy /Channel/Orderer/OrgMSP/Writers
2024-04-16 09:34:56.349 UTC [policies] Evaluate -> DEBU 10429ee6 == Done Evaluating *cauthdsl.policy Policy /Channel/Orderer/OrgMSP/Writers
2024-04-16 09:34:56.349 UTC [policies] Evaluate -> DEBU 10429ee7 Signature set satisfies policy /Channel/Orderer/Writers
2024-04-16 09:34:56.349 UTC [policies] Evaluate -> DEBU 10429ee8 == Done Evaluating *policies.implicitMetaPolicy Policy /Channel/Orderer/Writers
2024-04-16 09:34:56.349 UTC [policies] Evaluate -> DEBU 10429ee9 Signature set satisfies policy /Channel/Writers
2024-04-16 09:34:56.349 UTC [policies] Evaluate -> DEBU 10429eea == Done Evaluating *policies.implicitMetaPolicy Policy /Channel/Writers
2024-04-16 09:34:56.350 UTC [common.configtx] addToMap -> DEBU 10429eeb Adding to config map: [Group]  /Channel
2024-04-16 09:34:56.350 UTC [common.configtx] addToMap -> DEBU 10429eec Adding to config map: [Group]  /Channel
2024-04-16 09:34:56.350 UTC [common.configtx] addToMap -> DEBU 10429eed Adding to config map: [Group]  /Channel/Consortiums
2024-04-16 09:34:56.350 UTC [common.configtx] addToMap -> DEBU 10429eee Adding to config map: [Group]  /Channel/Consortiums/OrgConsortium
2024-04-16 09:34:56.350 UTC [common.configtx] addToMap -> DEBU 10429eef Adding to config map: [Group]  /Channel/Consortiums/OrgConsortium/OrgMSP
2024-04-16 09:34:56.350 UTC [common.configtx] addToMap -> DEBU 10429ef0 Adding to config map: [Value]  /Channel/Consortiums/OrgConsortium/OrgMSP/MSP
2024-04-16 09:34:56.350 UTC [common.configtx] addToMap -> DEBU 10429ef1 Adding to config map: [Policy] /Channel/Consortiums/OrgConsortium/OrgMSP/Admins
2024-04-16 09:34:56.350 UTC [common.configtx] addToMap -> DEBU 10429ef2 Adding to config map: [Policy] /Channel/Consortiums/OrgConsortium/OrgMSP/Readers
2024-04-16 09:34:56.350 UTC [common.configtx] addToMap -> DEBU 10429ef3 Adding to config map: [Policy] /Channel/Consortiums/OrgConsortium/OrgMSP/Writers
2024-04-16 09:34:56.350 UTC [common.configtx] addToMap -> DEBU 10429ef4 Adding to config map: [Value]  /Channel/Consortiums/OrgConsortium/ChannelCreationPolicy
2024-04-16 09:34:56.351 UTC [common.configtx] addToMap -> DEBU 10429ef5 Adding to config map: [Policy] /Channel/Consortiums/Admins
2024-04-16 09:34:56.351 UTC [common.configtx] addToMap -> DEBU 10429ef6 Adding to config map: [Group]  /Channel/Orderer
2024-04-16 09:34:56.351 UTC [common.configtx] addToMap -> DEBU 10429ef7 Adding to config map: [Group]  /Channel/Orderer/OrgMSP
2024-04-16 09:34:56.351 UTC [common.configtx] addToMap -> DEBU 10429ef8 Adding to config map: [Value]  /Channel/Orderer/OrgMSP/MSP
2024-04-16 09:34:56.351 UTC [common.configtx] addToMap -> DEBU 10429ef9 Adding to config map: [Policy] /Channel/Orderer/OrgMSP/Admins
2024-04-16 09:34:56.351 UTC [common.configtx] addToMap -> DEBU 10429efa Adding to config map: [Policy] /Channel/Orderer/OrgMSP/Readers
2024-04-16 09:34:56.351 UTC [common.configtx] addToMap -> DEBU 10429efb Adding to config map: [Policy] /Channel/Orderer/OrgMSP/Writers
2024-04-16 09:34:56.351 UTC [common.configtx] addToMap -> DEBU 10429efc Adding to config map: [Value]  /Channel/Orderer/BatchSize
2024-04-16 09:34:56.351 UTC [common.configtx] addToMap -> DEBU 10429efd Adding to config map: [Value]  /Channel/Orderer/BatchTimeout
2024-04-16 09:34:56.352 UTC [common.configtx] addToMap -> DEBU 10429efe Adding to config map: [Value]  /Channel/Orderer/ChannelRestrictions
2024-04-16 09:34:56.353 UTC [common.configtx] addToMap -> DEBU 10429eff Adding to config map: [Value]  /Channel/Orderer/ConsensusType
2024-04-16 09:34:56.353 UTC [common.configtx] addToMap -> DEBU 10429f00 Adding to config map: [Policy] /Channel/Orderer/Readers
2024-04-16 09:34:56.353 UTC [common.configtx] addToMap -> DEBU 10429f01 Adding to config map: [Policy] /Channel/Orderer/Writers
2024-04-16 09:34:56.353 UTC [common.configtx] addToMap -> DEBU 10429f02 Adding to config map: [Policy] /Channel/Orderer/Admins
2024-04-16 09:34:56.353 UTC [common.configtx] addToMap -> DEBU 10429f03 Adding to config map: [Policy] /Channel/Orderer/BlockValidation
2024-04-16 09:34:56.353 UTC [common.configtx] addToMap -> DEBU 10429f04 Adding to config map: [Value]  /Channel/BlockDataHashingStructure
2024-04-16 09:34:56.353 UTC [common.configtx] addToMap -> DEBU 10429f05 Adding to config map: [Value]  /Channel/HashingAlgorithm
2024-04-16 09:34:56.353 UTC [common.configtx] addToMap -> DEBU 10429f06 Adding to config map: [Value]  /Channel/OrdererAddresses
2024-04-16 09:34:56.353 UTC [common.configtx] addToMap -> DEBU 10429f07 Adding to config map: [Policy] /Channel/Admins
2024-04-16 09:34:56.353 UTC [common.configtx] addToMap -> DEBU 10429f08 Adding to config map: [Policy] /Channel/Readers
2024-04-16 09:34:56.353 UTC [common.configtx] addToMap -> DEBU 10429f09 Adding to config map: [Policy] /Channel/Writers
2024-04-16 09:34:56.354 UTC [common.configtx] verifyDeltaSet -> DEBU 10429f0a Processing change to key: [Policy] /Channel/Orderer/OrgMSP/Admins
2024-04-16 09:34:56.354 UTC [orderer.common.broadcast] ProcessMessage -> WARN 10429f0b [channel: Orgsystem] Rejecting broadcast of config message from 172.33.13.79:58208 because of error: error applying config update to existing channel 'Orgsystem': error authorizing update: error validating DeltaSet: attempt to set key [Policy] /Channel/Orderer/OrgMSP/Admins to version 0, but key is at version 0
2024-04-16 09:34:56.354 UTC [orderer.common.server] func1 -> DEBU 10429f0c Closing Broadcast stream
2024-04-16 09:34:56.354 UTC [comm.grpc.server] 1 -> INFO 10429f0d streaming call completed grpc.service=orderer.AtomicBroadcast grpc.method=Broadcast grpc.peer_address=172.33.13.79:58208 grpc.code=OK grpc.call_duration=6.298844ms
2024-04-16 09:34:56.364 UTC [common.deliver] Handle -> WARN 10429f0e Error reading from 172.33.13.79:58194: rpc error: code = Canceled desc = context canceled
2024-04-16 09:34:56.364 UTC [grpc] infof -> DEBU 10429f0f transport: loopyWriter.run returning. connection error: desc = "transport is closing"
2024-04-16 09:34:56.364 UTC [orderer.common.server] func1 -> DEBU 10429f10 Closing Deliver stream
2024-04-16 09:34:56.364 UTC [grpc] infof -> DEBU 10429f12 transport: loopyWriter.run returning. connection error: desc = "transport is closing"
2024-04-16 09:34:56.364 UTC [comm.grpc.server] 1 -> INFO 10429f11 streaming call completed grpc.service=orderer.AtomicBroadcast grpc.method=Deliver grpc.peer_address=172.33.13.79:58194 error="rpc error: code = Canceled desc = context canceled" grpc.code=Canceled grpc.call_duration=23.411074ms

Edit: I see that in the channel config there are versions specified:

            "Writers": {
              "mod_policy": "Admins",
              "policy": {
                "type": 3,
                "value": {
                  "rule": "ANY",
                  "sub_policy": "Writers"
                }
              },
              "version": "0"
            }

Do I need to update all those versions?

On the source code of the hyperledger fabric on the update.go of the configtx the method verifyDeltaSet there is the following validation: https://github.com/hyperledger/fabric/blob/main/common/configtx/update.go#L67

        if value.version() != existing.version()+1 {
            return errors.Errorf("attempt to set key %s to version %d, but key is at version %d", key, value.version(), existing.version())
        }

So, Is this version updated on the process of creating the pb file automatically? or is something that needs to be specified?

Thank you.

Answers

It seems like the rejection of the broadcasted config message is due to an error in authorizing the update, specifically related to validating the DeltaSet. The error message indicates an attempt to set a key to a specific version, but the key is already at a different version.

The versioning mechanism in the Hyperledger Fabric configuration is used to ensure that updates are applied in a sequential and consistent manner. Each configuration key has a version associated with it, and when updating the configuration, the version must be incremented to ensure that the update is applied correctly.

In your case, it seems that the version of the key /Channel/Orderer/OrgMSP/Admins is expected to be incremented, but the provided update attempts to set it to version 0, which conflicts with the existing version.

Regarding your questions:

  1. Is the version updated on the process of creating the pb file automatically, or is it something that needs to be specified?

    The versioning of configuration keys is typically managed by the system itself. When generating the configuration protobuf (pb) file, the version information is included based on the current state of the configuration. You usually don't need to manually specify the version when creating the protobuf file.

  2. Do I need to update all those versions?

    Yes, when making configuration updates, you need to ensure that the version of each modified key is incremented appropriately. Failure to do so can result in errors during the configuration update process, as observed in your case.

To resolve the issue, ensure that the version of each modified key is incremented correctly according to the existing versions in the configuration. This can involve inspecting the current configuration state and determining the correct version numbers to use for each key update. Once the versions are updated correctly, regenerate the configuration protobuf file and attempt the configuration update again.