Comments (8)
You are using an ancient sysrepo version and you should most definitely update it. And to silently ignore unknown data, call lyd_parse_data()
without LYD_PARSE_STRICT
(which should be the default).
from sysrepo.
Hi team,
- We have updated the sysrepo version and the libyang version, and call lyd_parse_data() without LYD_PARSE_STRICT which will resolve the issue that the error "Node "" not found as a child of "" node " in "lydxml_subtree_r" API if we delete the yang leaf node in the new version, and we have changed this node's value before.
- But other issues still here.
(1) We met the error "Node "" to be created already exists" in "sr_edit_apply_r" API if we modify the default value of the node in the new version, and we have created the same node value before.
(2) We met the error "Node "" to be deleted does not exist" in "sr_edit_apply_r" API if we delete the yang list node's default value in the new version, and we have modified this node's value before.
(3) We met the error "Node "" does not exist" in "sr_edit_apply_r" API if we delete the yang list node's key default value in the new version, and we have modified the node with this key before.
(4) We met the error "Unsatisfied range - value "" is out of the allowed range." in "lyplg type validate range" API if we change the value range in the new version, and we have modified the node with this key before.
You can check the attached file for example which generated from the old device version, and we want to merge this diff file to the new device version which we will change the yang node or default value of yang node.
- So here I still have several questions need you help to confirm
(1) Why we will meet the issue that the sysrepo merge configuration diff failed? The method we used to update configuration diff is right?
(2) Are there some release document introducing how to update configuration diff after the yang modules have been changed?
libyang: v2.1.111
sysrepo: v2.2.105
BR,
Cecilia Zhong
from sysrepo.
Hi team,
- We have updated the sysrepo version and the libyang version, and call lyd_parse_data() without LYD_PARSE_STRICT which will resolve the issue that the error "Node "" not found as a child of "" node " in "lydxml_subtree_r" API if we delete the yang leaf node in the new version, and we have changed this node's value before.
- But other issues still here.
(1) We met the error "Node "" to be created already exists" in "sr_edit_apply_r" API if we modify the default value of the node in the new version, and we have created the same node value before.
(2) We met the error "Node "" to be deleted does not exist" in "sr_edit_apply_r" API if we delete the yang list node's default value in the new version, and we have modified this node's value before.
(3) We met the error "Node "" does not exist" in "sr_edit_apply_r" API if we delete the yang list node's key default value in the new version, and we have modified the node with this key before.
(4) We met the error "Unsatisfied range - value "" is out of the allowed range." in "lyplg type validate range" API if we change the value range in the new version, and we have modified the node with this key before.
You can check the attached file for example which generated from the old device version, and we want to merge this diff file to the new device version which we will change the yang node or default value of yang node.
- So here I still have several questions need you help to confirm
(1) Why we will meet the issue that the sysrepo merge configuration diff failed? The method we used to update configuration diff is right?
(2) Are there some release document introducing how to update configuration diff after the yang modules have been changed?
libyang: v2.1.111
sysrepo: v2.2.105
BR,
Cecilia Zhong
from sysrepo.
Only point 1) is supported as part of "data update" and only accidentally. So, strictly speaking, data update is not a use-case directly supported by libyang and you will have to implement it yourself somehow if you want this feature.
from sysrepo.
Hi team,
For the point 1) you said is that call lyd_parse_data() without LYD_PARSE_STRICT?
And we have resolved the problem as below. Maybe we can share with your team, Are there any suggestion?
(1) We met the error "Node "" to be created already exists" in "sr_edit_apply_r" API if we modify the default value of the node in the new version, and we have created the same node value before.
The solution: we change the EDIT_CREATE to EDIT_MERGE when error.
(2) We met the error "Node "" to be deleted does not exist" in "sr_edit_apply_r" API if we delete the yang list node's default value in the new version, and we have modified this node's value before.
The solution: we "return NULL" directly but not "goto op_error" when error.
(3) We met the error "Node "" does not exist" in "sr_edit_apply_r" API if we delete the yang list node's key default value in the new version, and we have modified the node with this key before.
The solution: we "return NULL" directly but not "goto op_error" when error.
(4) We met the error "Node "" instance to insert next to not found" in "sr_edit_find_userord_predicate" API if we modify the default value of the ordered-by node in the new version, and we have modified this node before.
The solution: we do nothing but not "return err_info" when sr_edit_find_userord_predicate return error.
BR,
Cecilia Zhong
from sysrepo.
You are directly modifying sysrepo code? I do not think that is a good solution but it is up to you. And yes, if you parse the data without the strict flag, it should automatically ignore any unknown nodes, which are those that were removed in the new YANG version.
from sysrepo.
Hi,
But the fact is that we also meet those issues even if we parse the data without the strict flag, so we think there are some problem in sysrepo opensource code. So we share our solution with the team and want to submit the code to sysrepo's svn git. So I want to know how can we submit?
And if you do not think that is a good solution, can you share the solution with us? Thanks!
BR,
Cecilia Zhong
from sysrepo.
But the fact is that we also meet those issues even if we parse the data without the strict flag, so we think there are some problem in sysrepo opensource code.
Your use-case is not supported, like I said, so I do not think you call it a problem in the code, it is intentional. And your changes will certainly not be merged because they remove all the errors that should actually be generated for the normal cases when the YANG module has not been updated.
Implementing this properly is not trivial and I would think about a solution involving getting an exact difference of the 2 YANG modules and then using it for adjusting the data. I doubt you will implement something like that so I guess you are left with whatever solution you want just do not expect it to be merged into our repositories.
We may need to solve this use-case in the near future and ten implement some proper mechanism for it.
from sysrepo.
Related Issues (20)
- Unnecessary subscriptions triggered when writing in operational datastore HOT 6
- Changes applying order during commit request after edit-config to candidate broken when request contains changes for a few modules HOT 14
- Error when setting a value multiple times HOT 1
- Request for one last git tag on libyang1 branch HOT 2
- [ERR] Datastore plugin "JSON notif" not found HOT 8
- sr_shmmod_lock: Interrupted system call HOT 2
- sr_get_items crashes in libyang (lyd_lyb_data_length) HOT 3
- [ERR] JSON DS file: Retrieving GID "0" grp entry failed (No such file or directory) [ERR] Callback "init" of plugin "JSON DS file" for module "ietf netconf acm" failed HOT 5
- sr_get_items retrieve data elements that are not in the datastore. HOT 1
- Can we use APIs based on sr_val_t HOT 1
- ietf-factory-reset does not trigger module change callback HOT 1
- ThreadSanitizer: unlock of an unlocked mutex in `test_copy_config`'s `test_simple` HOT 4
- Callback "load" of plugin "JSON DS file" for module "name of the module" HOT 2
- edit-config parameter xml file invalid. HOT 3
- Merge functionality with sysrepocfg in devel HOT 1
- Recursive reader limit 255 reached HOT 2
- Detecting a close-session RPC HOT 2
- Malformed data in operational module, a huge sequence of `{"sysrepo:dup-inst-list-position":[null],"ietf-netconf:operation":"merge"}` HOT 5
- Action in augment: "Failed to send RPC" HOT 3
- Detecting subscription expiration HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sysrepo.