[NETCONF-335] NETCONF's default-operation of "none" prevents config creation Created: 10/Jan/17 Updated: 15/Mar/19 Resolved: 17/Jul/17 |
|
| Status: | Resolved |
| Project: | netconf |
| Component/s: | restconf-nb |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | ||
| Reporter: | Giles Heron | Assignee: | Unassigned |
| Resolution: | Won't Do | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: All |
||
| Attachments: |
|
| External issue ID: | 7506 |
| Priority: | High |
| Description |
|
I'm not sure how we haven't noticed this before. Or maybe we have and decided not to fix it? ODL NETCONF sets default-operation to "none" southbound when using RESTCONF PUT or POST to modify a mounted device. that's fine for e.g. adding a new item to a list as config already exists at that level. but when adding new config it fails - correctly as far as I can tell from reading the relevant section of RFC6241: none: The target datastore is unaffected by the configuration So in this case I'm getting rpc-error from the mounted device with an error-tag value of data missing... |
| Comments |
| Comment by Giles Heron [ 10/Jan/17 ] |
|
an example of the XML sent to to XR by ODL: <rpc message-id="m-4" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> then: <rpc message-id="m-5" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> XR responded with: <rpc-reply message-id="m-4" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> |
| Comment by Jakub Morvay [ 11/Jan/17 ] |
|
Hi Giles, Can you please give us also details about your RESTCONF call? Payload, URI and HTTP operation. |
| Comment by Giles Heron [ 11/Jan/17 ] |
|
for this one I POSTed to: The contents were: { "Cisco-IOS-XR-ipv4-acl-cfg:access": ] with no ACLs already on the router this fails. With one or more ACLs configured via CLI it succeeds. I see similar behaviour with PUT/POST to the openconfig BGP model (same URL as above but ending openconfig-bgp:bgp. there I can't PUT or POST to the top level of the BGP config until config has been created from the CLI. And again I can't add BGP neighbors until one or more neighbors are already in the config. This is all consistent as far as I can tell with ODL's use of default-operation==none and with the text in RFC6241. I suspect in these cases (where there is no corresponding level in the target datastore) we should be setting default-operation==replace). |
| Comment by Jakub Morvay [ 12/Jan/17 ] |
|
I had to have a look at RESTCONF and try this to see the exact behavior. ODL should create necessary parent nodes, in your case containers 'ipv4-acl-and-prefix-list' and 'accesses', so this should prevent these "data-missing" errors. Can you please give us also previous rpc messages ODL sent to your mounted device and rpc replies to those messages? |
| Comment by Giles Heron [ 12/Jan/17 ] |
|
hi - the previous RPCs were probably just me checking the router had mounted ok. At any rate this behaviour happens every time without fail - so previous messages don't seem that relevant. But can run another test if you want to see M=1. |
| Comment by Jakub Morvay [ 13/Jan/17 ] |
|
Actually, the previous RPCs are relevant. They should ensure that parent nodes exist. So seeing them can help us to solve this issue. |
| Comment by Giles Heron [ 13/Jan/17 ] |
|
ah - so ODL adds the top level containers before trying to add the specific config? will attach logs (they start once the ASR9K is mounted). |
| Comment by Giles Heron [ 13/Jan/17 ] |
|
Attachment acl.log has been added with description: logs (with initial mounting deleted) |
| Comment by Jakub Morvay [ 16/Jan/17 ] |
|
(In reply to Giles Heron from comment #7) Yup, I have checked your logs and it turns it out, that ODL is trying to create parents prior to writing actual list item. Can you try to create empty containers on your device and see if they are really created? |
| Comment by Giles Heron [ 17/Jan/17 ] |
|
Hi Jakub, i don't think there's any way to create empty containers on XR as both of those containers contain lists where it's the list that has meaning (and which is created from the CLI). Giles |
| Comment by Giles Heron [ 24/Jan/17 ] |
|
is there any update on this? |
| Comment by Jakub Morvay [ 24/Jan/17 ] |
|
Hi Giles, sorry, looks like I've forgot about this one. Yeah, so as I have mentioned above, ODL is trying to create necessary parent nodes. This is done by creating empty containers. Maybe your device cannot cope with such modifications. So it would be helpful to know if your device is capable of creating empty containers. |
| Comment by Giles Heron [ 24/Jan/17 ] |
|
Hi Jakub no - as far as I know there's no way to create empty containers as semantically we just have a list in the router (I guess the list was wrapped in a container so we could use the container to get the whole list in a single operation). e.g. if, in configure, mode you type "ipv4 access-list" and then hit "?" then "<cr>" isn't one of the options given (as it would be if you could create an empty container). in terms of the NETCONF/YANG implementation on the device containers only get created: I believe this behaviour is consistent with section 7.5.1 of RFC6020: For example, the set of scrambling options for Synchronous Optical I'll move this bug to RESTCONF since the issue is there rather than in NETCONF. Giles |
| Comment by Wenbo Hu [ 21/Mar/17 ] |
|
Hi Giles, Jakub, , ] ] } |
| Comment by Giles Heron [ 10/Jul/17 ] |
|
is there any plan to fix this? |
| Comment by Sanjivini Naikar [ 12/Jul/17 ] |
|
Hi, I am using Cisco IOS XR-5.3.0 Even after configuring ACLs via CLI, it's not working and I'm getting the error as : <errors xmlns="urn:ietf:params:xml:ns:yang:ietf-restconf"><error><error-type>protocol</error-type><error-tag>unknown-element</error-tag><error-message>"yang-ext" module does not exist in mount point.</error-message></error></errors> |
| Comment by Giles Heron [ 12/Jul/17 ] |
|
Hi Sanjivini - that's a different bug. The error '"yang-ext" module does not exist in mount point' occurs because the model you're trying to use hasn't been mounted by ODL. Do ping me offline (giheron@cisco.com) |
| Comment by Tomas Cere [ 14/Jul/17 ] |
|
Giles, I don't think it's correct that the device is ignoring the message that creates the parent structure. This would make sense if it was the running datastore, but in candidate the device cannot know what the user is intending to do with the data until commit, so it shouldn't do any pruning etc. |
| Comment by Giles Heron [ 14/Jul/17 ] |
|
Hi Thomas the problem is that that may be your interpretation - but it isn't stated explicitly in RFC6020 or RFC6241, and is at variance what the XR guys have implemented. at the end of that day they're the "800lb gorilla" here, not ODL. So it's really down to us to figure out how to interoperate with them. Giles |
| Comment by Tomas Cere [ 14/Jul/17 ] |
|
RFC 6241 Considering that the rfc states that it serves as a "workplace for creating and manipulating configuration data" seems to me like its pretty explicit. But we can always write to the ietf mailing list to clarify this for us. |
| Comment by Giles Heron [ 14/Jul/17 ] |
|
my bad - looks like there may be a fix in the latest XR. Am just trying to clarify. still don't buy that it's explicit though |
| Comment by Giles Heron [ 14/Jul/17 ] |
|
Yes - fixed in XR 6.2.1. Figuring that out required me to raise one bug against Yangtools and comment against another Yangtools bug. but there you go... |