Description

Junos responds with a rpc-error for the NETCONF remove operation when the path does not exist.

Symptoms

For example, for the following NETCONF RPC requests to remove configuration filter1 on ge-0/0/0.0. The device responds with the following error:

application data-missing error [edit interfaces ge-0/0/0 unit 0 family inet filter] statement not found: input-chain filter1.

This behavior does not conform to the NETCONF standard.

According to RFC 6241 Section 7.2, the 'remove' operation should delete the specified configuration data if it exists. If the data is absent, the operation should be ignored without error. Therefore, the expected response in such cases is an '<ok/>', instead of an error message.

 

<rpc message-id="m-2" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
    <edit-config>
        <target>
            <candidate/>
        </target>
        <config>
            <configuration xmlns="http://yang.juniper.net/junos/conf/root">
                <interfaces xmlns="http://yang.juniper.net/junos/conf/interfaces">
                    <interface>
                        <name>ge-0/0/0</name>
                        <unit>
                            <name>0</name>
                            <family>
                                <inet>
                                    <filter>
                                        <input-chain xmlns:op="urn:ietf:params:xml:ns:netconf:base:1.0" op:operation="remove">filter1</input-chain>
                                    </filter>
                                </inet>
                            </family>
                        </unit>
                    </interface>
                </interfaces>
            </configuration>
        </config>
    </edit-config>
</rpc>
]]>]]>
<nc:rpc-error>

<nc:error-type>application</nc:error-type>
<nc:error-tag>data-missing</nc:error-tag>
<nc:error-severity>error</nc:error-severity>
<nc:error-path>[edit interfaces ge-0/0/0 unit 0 family inet filter]</nc:error-path>
<nc:error-message>statement not found: input-chain filter1</nc:error-message>
</nc:rpc-error>
]]>]]>

Solution

Netconf server is unconditionally throwing error during both delete and remove operation if it is performed on config elements that do not exist. While performing operation remove in a leaf-list config, we should expect <ok/>, not </rpc-error>, as per RFC 6241. This behavior is fixed in later Junos.

 

Modification History

2024-03-09 : Article Created