Repository navigation
Open
Labels
is:enhancementRequest for adding new feature or enahncing functionality.Request for adding new feature or enahncing functionality.status:completedFrom the developer perspective, the issue was solved (bug fixed, question answered,...)From the developer perspective, the issue was solved (bug fixed, question answered,...)
Description
Hi Michal,
We are trying to mark a few extensions for some parameters, we could mark this importing the extensions module in the yang file and marking the leaf nodes,
we wanted to understand if we could create module with deviation with which we could add extensions, so rather than modifying multiple yang files we could use a module with deviation to mark extensions, but we see that it fails with unknown prefix error,
here is the extensions yang file
extension ru-it {
description
"Indicates the parameter is modifiable at RU init time only and hence requires a RU restart(reset).";
}
extension rt {
description
"Indicates the parameter is modifiable at run time and does not require a restart.";
}
extension sa {
description
"Indicates the parameter is applicable only for standalone deployment.";
}
extension nsa {
description
"Indicates the parameter is applicable only for non standalone deployment.";
}
extension sa-nsa {
description
"Indicates the parameter is applicable only for both standalone and non standalone deployment.";
}
extension spec-ref {
description
"Specify the specification reference if the parameter is taken from any specification.";
argument "spec-ref";
}
}We are trying to use it via deviate,
module _ran-nr-nrm-gnbcucp-ext-test {
yang-version 1.1;
namespace "urn:3gpp:sa5:_ran-nr-nrm-gnbcucp-ext-test";
prefix "gnbcucp-ext-test";
import _3gpp-common-managed-element { prefix me3gpp; }
import _3gpp-nr-nrm-gnbcucpfunction { prefix gnbcucp3gpp; }
import _ran-nr-nrm-yang-extensions { prefix yextran; }
deviation "/me3gpp:ManagedElement/gnbcucp3gpp:GNBCUCPFunction/gnbcucp3gpp:attributes/gnbcucp3gpp:gNBId" {
deviate add {
yextran:rt;
}
}
}when we try to load the yang in sr_install_module , with verbose log i am seeing below
[VRB] Searching for "_3gpp-nr-nrm-gnbcucpfunction" in "/opt/sysrepo/yang".
[VRB] Loading schema from "/tmp/yangs/_3gpp-nr-nrm-gnbcucpfunction.yang" file.
[ERR] Invalid prefix "yextran" used for extension instance identifier.
[2026-03-17 09:17:14.082575] [INFO] Extension module install failed: libyang error
[2026-03-17 09:17:14.082595] [INFO] Session stopped.
[INF] Connection 1 destroyed.
we need to understand if we can add extensions via deviate,
Thanks,
Srikanth
Metadata
Metadata
Assignees
Labels
is:enhancementRequest for adding new feature or enahncing functionality.Request for adding new feature or enahncing functionality.status:completedFrom the developer perspective, the issue was solved (bug fixed, question answered,...)From the developer perspective, the issue was solved (bug fixed, question answered,...)
Activity
tests UPDATE deviate add ext instance
michalvasko commentedon Mar 18, 2026
Works just fine in a test I have just added, maybe you are using an old libyang version.
srikanthsubbaramu commentedon Mar 18, 2026
Hi Michal,
we are on libyang-devel branch which is 3 weeks old from current devel branch .
Thanks,
Srikanth
michalvasko commentedon Mar 18, 2026
Then provide all the required YANG modules including the import so that I can reproduce it.
srikanthsubbaramu commentedon Mar 18, 2026
yangs.zip
command used for loading is
rc = sr_install_modules(conn, schema_paths.data(), search_dir, NULL);
const char *search_dir = "/opt/sysrepo/yang:/tmp/yangs"; ( /opt/sysrepo is sysrepodir ) /tmp/yangs is hwere above yangs are extracted, and schema_paths is array of all filenames in yang
schema compile UPDATE log ext inst path
schema compile UPDATE deviate ext inst support
michalvasko commentedon Mar 19, 2026
Your YANG module is actually invalid but it took me too long to figure out so I have improved the logging and now it should be clearer. However, deviating extension instances was not supported so I have implemented that and it should work now as expected.
srikanthsubbaramu commentedon Mar 20, 2026
Hi Michal,
Thank you for the update, can you please let me know what is actually wrong in yang module? can you please help with this information, so i could correct yang,
Thanks,
Srikanth
michalvasko commentedon Mar 20, 2026
Exactly what the error says:
The module
_ran-nr-nrm-gnbcucp-ext-testis correct, the issue is in the_3gpp-nr-nrm-gnbcucpfunctionmodule.srikanthsubbaramu commentedon Mar 20, 2026
hi Michal,
thanks because _3gpp-nr-nrm-gnbcucpfunction.yang does not do a import of yang extensions file, it is unable to understand yextran,
so with fix above , will this method work or still the module in which an leaf gets deviated for extension import actual yang which contains definition/prefix
michalvasko commentedon Mar 20, 2026
Just remove the extension instance from
_3gpp-nr-nrm-gnbcucpfunctionand you should be able to add it via deviation in_ran-nr-nrm-gnbcucp-ext-test.