Symptom
IP configuration fails with below error via openconfig-if-ip yang file fails with below error
"error-path": "Cisco-IOS-XR-ipv4-io-cfg//cisco.com/ns/yang/Cisco-IOS-XR-ifmgr-cfg:ns2:interface-configurations/ns2:interface-configuration[active = 'act' and interface-name = 'MgmtEth0/RP0/CPU0/0']/ns1:ipv4-network/ns1:addresses/ns1:secondaries/ns1:secondary[address = '172.20.165.80']/ns1:address",
"error-message": "'ipv4-ma' detected the 'warning' condition 'Secondary address cannot be the same as primary'
Conditions
If router is tried to configure with same primary IPv4 address again, with 'ip' node below 'config' node then IP configuration fails with below error.
"error-path": "Cisco-IOS-XR-ipv4-io-cfg//cisco.com/ns/yang/Cisco-IOS-XR-ifmgr-cfg:ns2:interface-configurations/ns2:interface-configuration[active = 'act' and interface-name = 'MgmtEth0/RP0/CPU0/0']/ns1:ipv4-network/ns1:addresses/ns1:secondaries/ns1:secondary[address = '172.20.165.80']/ns1:address",
"error-message": "'ipv4-ma' detected the 'warning' condition 'Secondary address cannot be the same as primary'
Workaround
1) Do 'replace' instead of 'merge' so that it would delete the existing configuration and then applies the config.
2) Move 'ip' above 'config' in the RPC request
Further Problem Description