fabric icon indicating copy to clipboard operation
fabric copied to clipboard

Parsing CORE_PEER_DELIVERYCLIENT_ADDRESSOVERRIDES

Open TaoGunner opened this issue 9 months ago • 3 comments

Description

Unable to correctly change the value of peer.deliveryclient.addressOverrides via global variables (CORE_PEER_DELIVERYCLIENT_ADDRESSOVERRIDES). A panic occurs when attempting to start the peer.

panic: could not unmarshal peer.deliveryclient.addressOverrides: 3 error(s) decoding:

* '[0]' expected a map, got 'string'
* '[1]' expected a map, got 'string'
* '[2]' expected a map, got 'string'

goroutine 1 [running]:
github.com/hyperledger/fabric/core/deliverservice.(*DeliverServiceConfig).loadDeliverServiceConfig(0xc0001c8ff0)
    /core/deliverservice/config.go:182 +0x41e
github.com/hyperledger/fabric/core/deliverservice.GlobalConfig(...)
    /core/deliverservice/config.go:60

Most likely due to the missing viperutil.YamlStringToStructHook hook in the parameters of the viper.UnmarshalKey function. https://github.com/hyperledger/fabric/blob/e595f9b519dd8fccb0b493a18a30effa5313f05b/core/deliverservice/config.go#L78

For example, yaml parser for chaincode.externalBuilders works correctly: https://github.com/hyperledger/fabric/blob/e595f9b519dd8fccb0b493a18a30effa5313f05b/core/peer/config.go#L296

Steps to reproduce

  1. Set global variableCORE_PEER_DELIVERYCLIENT_ADDRESSOVERRIDES='[{from: orderer0.example.com, to: orderer0.example.net, caCertsFile: /example1.pem}]'.
  2. Start peer.

TaoGunner avatar Feb 12 '26 14:02 TaoGunner

which version of fabric?

pfi79 avatar Feb 12 '26 15:02 pfi79

fabric v2.5.14

TaoGunner avatar Feb 12 '26 16:02 TaoGunner

fixed

pfi79 avatar Feb 21 '26 02:02 pfi79