[NETCONF-28] Netconf candidate capability non RFC compliant fallback Created: 08/Jun/15 Updated: 18/Jan/23 Resolved: 18/Jan/23 |
|
| Status: | Resolved |
| Project: | netconf |
| Component/s: | netconf |
| Affects Version/s: | None |
| Fix Version/s: | 4.0.6, 5.0.1 |
| Type: | Improvement | ||
| Reporter: | Erik Ruiter | Assignee: | Ivan Hrasko |
| Resolution: | Won't Do | Votes: | 0 |
| Labels: | pt | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: All |
||
| Attachments: |
|
| Description |
|
When connecting a to a Juniper EX-2200 device using the netconf connector, it reports a non RFC compliant candidate capability in the hello message: <hello> The Juniper reports: urn:ietf:params:xml:ns:netconf:capability:candidate:1.0 While it should be: urn:ietf:params:netconf:capability:candidate:1.0 When executing a change using a restconf call, ODL tries to change using the writable-runnning approach, because it does not detect the candidate capability. This is not supported by Juniper, and the request fails. Attached is a log file, which shows the request, starting from line 2657. It would be very helpful if ODL has a feature which allows more flexible checking for the candidate capability, or a fallback method for accepting the specific 'Juniper-style' candidate capability. The same issue might apply for the confirmed-commit capability, but I am unable to check this yet. |
| Comments |
| Comment by Erik Ruiter [ 08/Jun/15 ] |
|
Attachment karaf.log has been added with description: karaf log having netconf connect trace enabled |
| Comment by Maros Marsalek [ 09/Jun/15 ] |
|
Hi Erik, Continuing our discussion here: Yes, the Juniper capability is in different format than expected in ODL or stated in RFC. We could introduce a fallback into netconf connector to check for the juniper version of candidate capability string, or make it less strict when looking for candidate capability (maybe checking only for substring "netconf:capability:candidate:1.0"). The fix is pretty easy, we just need to modify class: If you feel like modifying the class yourself, feel free to take this bug and submit a patch. It would be great if you could do that, since you can also test the fix against the Juniper device. If not, let us know and we will take care of this. Maros |
| Comment by Erik Ruiter [ 10/Jun/15 ] |
|
https://git.opendaylight.org/gerrit/#/c/22265/ This works, the candidate config is now locked instead of the running config. |
| Comment by Maros Marsalek [ 10/Jun/15 ] |
|
Hi Erik, thanks for the commit. We can discuss the failure here and maybe open another bug later. |
| Comment by Erik Ruiter [ 12/Jun/15 ] |
|
Attachment karaf_after_applied_patch.log has been added with description: karaf log after applied patch |
| Comment by Erik Ruiter [ 12/Jun/15 ] |
|
I am trying to excute a restconf call to cahnge the host-name of the device. curl -X POST --data "<system xmlns='http://xml.juniper.net/xnm/1.1/xnm'><host-name>newswitch</host-name></system>" http://admin:admin@localhost:8181/restconf/config/opendaylight-inventory:nodes/node/sw-opennaas-1/yang-ext:mount/configuration:configuration -H "Accept: application/xml" -H "Content-Type: application/xml" -v When viewing the logs, I see that ODL successfully locks the candidate config and performs some <get-config> actions on the 'system' tree of the configuration. the REST call produces the following body: <errors xmlns="urn:ietf:params:xml:ns:yang:ietf-restconf"> Does this mean that I am using a wrong URL for accesing the system subtree? I also tried to delete the host-name from the configuration, so that I am sure there was not host-name element in the configuration, but this did not help. |
| Comment by Maros Marsalek [ 12/Jun/15 ] |
|
Hi Erik, So its just restconf telling you the data exists and cannot be created again. POST method was recently changed from performing merge operation to create operation, whch fails when data is already present. The error is expected now. You can try using PUT (replace) instead with the same data, but dont forget to update the URL by adding the system element to it. The URL for PUT should probably look like this: Maros |
| Comment by Erik Ruiter [ 12/Jun/15 ] |
|
Attachment karaf_put_log.txt has been added with description: karaf put log |
| Comment by Erik Ruiter [ 12/Jun/15 ] |
|
Hi Maros, I tried the PUT, using: curl -X PUT --data "<system xmlns='http://xml.juniper.net/xnm/1.1/xnm'><host-name>newswitch</host-name></system>" http://admin:admin@localhost:8181/restconf/config/opendaylight-inventory:nodes/node/sw-opennaas-1/yang-ext:mount/configuration:configuration/configuration:system -H "Accept: application/xml" -H "Content-Type: application/xml" -v As a response I get a error 500. In the logs I do see a edit-config request, but it does not list the host-name element, for some reason it is not added. <edit-config> Please find the output attached in the karaf_put_log file |
| Comment by Maros Marsalek [ 15/Jun/15 ] |
|
Hi Erik, The request with empty configuration is expected, it is RESTCONF trying to ensure parent structure performing a "merge edit-config rpc" with empty configuration container. After that a real edit should follow. But your device has a problem with the empty configuration container: <error-message>syntax error, expecting <configuration></error-message> I believe this is the same issue that you faced some time ago(<configuration/> vs <configuration></configuration>) and moving to Lithium should have helped with that (With Helium this was failing when get-config requests were invoked trying to find out if the parent structure exists). Now the get-configs + optional edits are replaced with a single edit (the one that fails for you now). But it looks like we were not successful in avoiding the issue and right now we have 3 options:
I ll try to discuss the best option here with other ODL devs and make it into Lithium asap. Maros |
| Comment by Marian Dubai [ 15/Jun/15 ] |
|
Property to change the output to html(no self-closing tags) is In RFC specifications are used self-closing tags when possible, Part of code where html property we set in netconf(netconf-subsystem) in NetconfMessageToXMLEncoder.java (line 56) to test it: So it's possible to compile netconf with this change without tests and check if this doesn't cause any other error. |
| Comment by Maros Marsalek [ 17/Jun/15 ] |
|
Hi Erik, Could you test the html output method with your device ? It removes the self closing tags but also removes the xml declaration and formatting from the output so we are not sure if that wont break something else. |
| Comment by Erik Ruiter [ 18/Jun/15 ] |
|
Hi, I tried the parsing option, and it gave some mixed results. For reading configurations, for the <source> tag the Juniper device only accepts the short form: For <edit-config>, apparently the Juniper then does not care about the formatting of the candidate/running tag. Anyway, before I provide any details, I just found out that Juniper announced a new Junos release, which introduces RFC-compliant NETCONF as a new feature. So I am trying to obtain this version, and will let you know if this solves the problems. |
| Comment by Robert Varga [ 13/Nov/15 ] |
|
Move to NETCONFI project. |
| Comment by Tomas Cere [ 24/Nov/15 ] |
|
We will need to port the fix for less strict candidate capability checking to Netconf repo. As for the other issue, please open a new bug if new Junos doesnt fix your issues. |
| Comment by Ivan Hrasko [ 23/Nov/22 ] |
|
I consider accepting: urn:ietf:params:xml:ns:netconf:capability:candidate:1.0 as a valid capability be a breakage of the protocol because: The shorthand form MUST NOT be used inside the protocol.
|
| Comment by Ivan Hrasko [ 23/Nov/22 ] |
|
In addition, Junos device now supports correct namespaces: https://www.juniper.net/documentation/us/en/software/junos/netconf/topics/concept/netconf-session-rfc-compliant.html. |
| Comment by Ivan Hrasko [ 18/Jan/23 ] |
|
We have successfully tested https://github.com/Juniper/yang/tree/master/22.3/22.3R1 models with netconf testool and device is connected. |
| Comment by Ivan Hrasko [ 18/Jan/23 ] |
|
Finally, the requirement to shorthand namespace is invalid according to RFC, Junos models are valid and is has been proven they can be used with ODL, and Junos device has recently added settings to operate in compatible manner. Thus, closing this issue. |