CESNET / netopeer2

NETCONF toolset
BSD 3-Clause "New" or "Revised" License
301 stars 189 forks source link

Error with sysrepoctl -l #1471

Open Karl-ZhangBD opened 1 year ago

Karl-ZhangBD commented 1 year ago

Can you help me figure out how to fix this error? Thanks! karl@ubuntu:~$ sysrepoctl -l -v3 [ERR] JSON DS file: Opening "/dev/shm/sr_ietf-netconf-acm.running" failed (File exists). [ERR] Callback "init" of plugin "JSON DS file" for module "ietf-netconf-acm" failed. sysrepoctl error: Failed to connect (System function call failed)

michalvasko commented 1 year ago

Did you do some manual changes to the files? Run make sr_clean to completely reset sysrepo state and it should fix this.

Karl-ZhangBD commented 1 year ago

Hi, michalvasko I installed a YANG model that I defined myself, and then uninstalled it and got an error, and I can't tell why through v3. root@ubuntu:/home/karl/work/YANG/Qbv# sysrepoctl -u Qbv-Protocol -v3 [INF] Connection 36 created. [INF] Module "Qbv-Protocol" removed. [ERR] Internal error (/home/karl/work/sysrepo/src/lyd_mods.c:860). sysrepoctl error: Failed to uninstall modules (Internal error)

michalvasko commented 1 year ago

Can you please share the YANG (and all other required for installing it) and the exact steps to reproduce this? Starting from make sr_clean.

Karl-ZhangBD commented 1 year ago

The problem has been solved, probably I changed the yang model in an incorrect way after installing it, which caused the error. I have another problem. I downloaded two YANG models from the IEEE official website, one is named: ieee802-dot1q-types.yang and one is named: ieee802-dot1q-sched.yang where ieee802-dot1q-sched.yang references the identity defined in ieee802-dot1q-types.yang as shown below import ieee802-dot1q-types { prefix dot1q-types; } identity set-gate-states { base dot1q-types:type-of-operation; description "Operation to set the gate states."; } So I started by installing ieee802-dot1q-types.yang,but when I installed ieee802-dot1q-sched.yang, I got the following error message : root@ubuntu:/home/karl/work/YANG# sysrepoctl -i ieee802-dot1q-sched.yang -v3 [INF] Connection 15 created. [ERR] Unable to find base (dot1q-types:type-of-operation) of identity "set-gate-states". (Path "/ieee802-dot1q-sched:{identity='set-gate-states'}".) sysrepoctl error: Failed to install modules (libyang error)

I checked ieee802-dot1q-types.yang and found that it did contain the following: identity type-of-operation { description "Represents the operation type (name)."; } How can I fix it?

jktjkt commented 1 year ago

In order to use identities defined in another module, that module which is "providing" them has to be installed, not only imported. Check the output of sysrepoctl --list and review the Flags column,and if it says just i (imported) and not I (installed) for ieee802-dot1q-types.yang, install it explicitly.

michalvasko commented 1 year ago

What sysrepo and libyang version are you using? I have tried installing these modules and encountered no issues.

Karl-ZhangBD commented 1 year ago

I solved the problem as jktjkt said above, and it was indeed a problem with install and import. By the way, what are the differences between install and import in the process of using them?

michalvasko commented 1 year ago

As per the RFC.