[NETCONF-482] Extra superfluous edit-config RPC sent just prior to correct edit-config RPC for top-level lists Created: 03/Nov/17  Updated: 25/Aug/20  Resolved: 25/Aug/20

Status: Resolved
Project: netconf
Component/s: netconf, restconf-nb
Affects Version/s: None
Fix Version/s: Nitrogen SR1, Carbon SR3, Aluminium, 1.13.0, Magnesium SR3

Type: Bug Priority: High
Reporter: Jeff Hartley Assignee: Jamo Luhrsen
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Boron SR-3
Carbon SR-1
(perhaps others)

Netconf-mounted network element with a list at the top level. Examples include Juniper JUNOS 17.4 interfaces, Juniper JDM 17.4 virtual-network-functions, and others.



 Description   

Symptom:
POST & PUT to certain top-level lists in a mounted device's model returns a 500 error via Restconf, although in some cases (device-dependent) the config appears to have committed. This problem first appeared in Boron-SR3, and continues in Carbon SR-1.

What's actually happening:
Two edit-config RPCs appear on the wire / in TRACE logs. The first edit-config's body includes a single empty parent node, such as <configuration> or <interfaces>, but then no actual contents within that. Different vendors' devices handle this in different ways, sometimes with a ~graceful rpc-error-reply on that incorrect edit-config but accepting the correct one that follows. Others enter a half-configured state and then fail the correct edit-config state (such as a POST where the resource was created without useful payload).

Solution: If the target is a mounted network element, don't create the empty subtree at all. Regardless of whether or not the standard allows it, most vendor netconf implementations reject this behavior. See MakePut in BrokerFacade for the root cause, and also see corresponding post method..

One example of the failure:
2017-10-05 16:26:40,416 | WARN | oupCloseable-3-2 | NetconfDeviceCommunicator | 299 - org.opendaylight.netconf.sal-netconf-connector - 1.5.1.Carbon | RemoteDevice

{dfwm2k02-ie1ri}

: Error reply from remote device, request: <rpc message-id="m-7538" 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"/>
</config>
</edit-config>
</rpc>
, response: <nc:rpc-reply xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos="http://xml.juniper.net/junos/17.4X48/junos" message-id="m-7538">
<nc:rpc-error>
<nc:error-type>protocol</nc:error-type>
<nc:error-tag>operation-failed</nc:error-tag>
<nc:error-severity>error</nc:error-severity>
<nc:error-message>syntax error, expecting <configuration></nc:error-message>
<nc:error-info>
<nc:bad-element>configuration</nc:bad-element>
</nc:error-info>
</nc:rpc-error>
</nc:rpc-reply>



 Comments   
Comment by Kit Lou [ 04/Nov/17 ]

This looks like an existing issue for Boron and Carbon. Does it apply to Nitrogen also?

Is this truly a blocker for the upcoming release of Nitrogen-SR1? Thanks!

Comment by Atul Gosain [ 07/Nov/17 ]

As per the Juniper engineers, the edit config used to have a different behavior pre Boron SR3.
It seems to be a regression.
There is no workaround to this situation since the initial empty parent config is not accepted by many different vendor's devices.

Comment by Atul Gosain [ 07/Nov/17 ]

Submitted a patch for Nitrogen https://git.opendaylight.org/gerrit/#/c/65281/

Comment by Balaji Varadaraju [ 07/Nov/17 ]

The extra massaging for the requests such as creating the parent structures and empty payload etc are not needed for mounted Netconf devices. They may be only needed for ODL's internal operations. So not doing those extra operations on mount points is good. Not all devices take kindly to those extra edit-configs.

Comment by Atul Gosain [ 08/Nov/17 ]

Submitted patch for Carbon - https://git.opendaylight.org/gerrit/#/c/65293/

Comment by Kit Lou [ 09/Feb/18 ]

agosain - please mark this issue as resolved as both patches have been merged.  Thanks!

Comment by Jamo Luhrsen [ 12/Jun/20 ]

this did not make it to master... along with some other patches so was lost in Fluorine and beyond

Comment by Jamo Luhrsen [ 14/Aug/20 ]

tcere or rovarga, can you take a look at this patch please?

This work was done, probably in a rush or during a release window, and was only merged to stable/oxygen and cherry picked
down to older stable branches. It never made it in to the existing master at the time, so it was lost.

The patch is essentially the same work, but it was not a straight cherry-pick for me. I tested locally
and it's fixing the extra empty edit-config problem. I actually tested it in every branch (Na, Mg, Al, Si).
Once it's merged in master, I'll CP to everything else.

Generated at Wed Feb 07 20:15:09 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.