cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1326
Views
15
Helpful
2
Replies

YANG Reference Issue

casbarre
Cisco Employee
Cisco Employee

Hi everyone. 

After migrating NSO from version 4.7 to version 5.7, when I recompile some of the custom service packages, the following warning is shown:

 

yang/rsvp-te-tunnel.yang:224: error: the node is config, but refers to a non-config node 'name' defined at /opt/ncs/current/src/ncs/yang/tailf-ncs-devices.yang:3470
yang/rsvp-te-tunnel.yang:224: error: the node is config, but refers to a non-config node 'name' defined at /opt/ncs/current/src/ncs/yang/tailf-ncs-devices.yang:3470
yang/rsvp-te-tunnel.yang:224: error: the node is config, but refers to a non-config node 'name' defined at /opt/ncs/current/src/ncs/yang/tailf-ncs-devices.yang:3470
yang/rsvp-te-tunnel.yang:224: error: the node is config, but refers to a non-config node 'name' defined at /opt/ncs/current/src/ncs/yang/tailf-ncs-devices.yang:3470
yang/rsvp-te-tunnel.yang:243: error: the node is config, but refers to a non-config node 'name' defined at /opt/ncs/current/src/ncs/yang/tailf-ncs-devices.yang:3470
yang/rsvp-te-tunnel.yang:243: error: the node is config, but refers to a non-config node 'name' defined at /opt/ncs/current/src/ncs/yang/tailf-ncs-devices.yang:3470
yang/rsvp-te-tunnel.yang:243: error: the node is config, but refers to a non-config node 'name' defined at /opt/ncs/current/src/ncs/yang/tailf-ncs-devices.yang:3470
yang/rsvp-te-tunnel.yang:243: error: the node is config, but refers to a non-config node 'name' defined at /opt/ncs/current/src/ncs/yang/tailf-ncs-devices.yang:3470

I noticed that the mentioned YANG file lines that seem to display this warning, reference the device NED:

when "count(/ncs:devices/ncs:device[ncs:name=current()/../headend-router]/ncs:module[ncs:name='tailf-ned-cisco-ios']/ncs:name) != 0
              or count(/ncs:devices/ncs:device[ncs:name=current()/../headend-router]/ncs:module[ncs:name='tailf-ned-cisco-ios-xr']/ncs:name) != 0"

Does the service's Yang file's reference need to be updated to something else? 

 

Thank you in advance! 

1 Accepted Solution

Accepted Solutions

Nabsch
Spotlight
Spotlight

Hello,

 

I fixed the error that you get during the compilation phase by adding this flags 

--allow-interop-issues
 

 

 

       --allow-interop-issues
           Report YANG_ERR_XPATH_REF_BAD_CONFIG as a warning instead of an error. Be advised that this violates    RFC7950 section 6.4.1; a constraint on a config true node contains an XPath expression may not refer to a  config false node.

 

 

You will need to change your makefile 

 

../load-dir/%.fxs: yang/%.yang
        $(NCSC)  --allow-interop-issues  `ls $*-ann.yang  > /dev/null 2>&1 && echo "-a $*-ann.yang"` \
             $(NCSCPATH) -c -o $@ $<

 

Here what i got before the modification

 

 

 

nabil@DESKTOP-8ECTID4:~/ncs-run-5.8/packages/test-yang/src$ make clean all
rm -rf ../load-dir java/src//
mkdir -p ../load-dir
mkdir -p java/src//
/home/nabil/ncs-5.8/bin/ncsc  `ls test-yang-ann.yang  > /dev/null 2>&1 && echo "-a test-yang-ann.yang"` \
              -c -o ../load-dir/test-yang.fxs yang/test-yang.yang
yang/test-yang.yang:47: error: the node is config, but refers to a non-config node 'name' defined at /home/nabil/ncs-5.8/src/ncs/yang/tailf-ncs-devices.yang:3513
yang/test-yang.yang:47: error: the node is config, but refers to a non-config node 'name' defined at /home/nabil/ncs-5.8/src/ncs/yang/tailf-ncs-devices.yang:3513
yang/test-yang.yang:47: error: the node is config, but refers to a non-config node 'name' defined at /home/nabil/ncs-5.8/src/ncs/yang/tailf-ncs-devices.yang:3513
yang/test-yang.yang:47: error: the node is config, but refers to a non-config node 'name' defined at /home/nabil/ncs-5.8/src/ncs/yang/tailf-ncs-devices.yang:3513
make: *** [Makefile:25: ../load-dir/test-yang.fxs] Error 1

 

 

 

 Here after the modification

 

 

 

 

 

nabil@DESKTOP-8ECTID4:~/ncs-run-5.8/packages/test-yang/src$ make clean all
rm -rf ../load-dir java/src//
mkdir -p ../load-dir
mkdir -p java/src//
/home/nabil/ncs-5.8/bin/ncsc  --allow-interop-issues  `ls test-yang-ann.yang  > /dev/null 2>&1 && echo "-a test-yang-ann.yang"` \
              -c -o ../load-dir/test-yang.fxs yang/test-yang.yang
yang/test-yang.yang:47: warning: the node is config, but refers to a non-config node 'name' defined at /home/nabil/ncs-5.8/src/ncs/yang/tailf-ncs-devices.yang:3513
yang/test-yang.yang:47: warning: the node is config, but refers to a non-config node 'name' defined at /home/nabil/ncs-5.8/src/ncs/yang/tailf-ncs-devices.yang:3513
yang/test-yang.yang:47: warning: the node is config, but refers to a non-config node 'name' defined at /home/nabil/ncs-5.8/src/ncs/yang/tailf-ncs-devices.yang:3513
yang/test-yang.yang:47: warning: the node is config, but refers to a non-config node 'name' defined at /home/nabil/ncs-5.8/src/ncs/yang/tailf-ncs-devices.yang:3513

 

 

 

View solution in original post

2 Replies 2

Nabsch
Spotlight
Spotlight

Hello,

 

I fixed the error that you get during the compilation phase by adding this flags 

--allow-interop-issues
 

 

 

       --allow-interop-issues
           Report YANG_ERR_XPATH_REF_BAD_CONFIG as a warning instead of an error. Be advised that this violates    RFC7950 section 6.4.1; a constraint on a config true node contains an XPath expression may not refer to a  config false node.

 

 

You will need to change your makefile 

 

../load-dir/%.fxs: yang/%.yang
        $(NCSC)  --allow-interop-issues  `ls $*-ann.yang  > /dev/null 2>&1 && echo "-a $*-ann.yang"` \
             $(NCSCPATH) -c -o $@ $<

 

Here what i got before the modification

 

 

 

nabil@DESKTOP-8ECTID4:~/ncs-run-5.8/packages/test-yang/src$ make clean all
rm -rf ../load-dir java/src//
mkdir -p ../load-dir
mkdir -p java/src//
/home/nabil/ncs-5.8/bin/ncsc  `ls test-yang-ann.yang  > /dev/null 2>&1 && echo "-a test-yang-ann.yang"` \
              -c -o ../load-dir/test-yang.fxs yang/test-yang.yang
yang/test-yang.yang:47: error: the node is config, but refers to a non-config node 'name' defined at /home/nabil/ncs-5.8/src/ncs/yang/tailf-ncs-devices.yang:3513
yang/test-yang.yang:47: error: the node is config, but refers to a non-config node 'name' defined at /home/nabil/ncs-5.8/src/ncs/yang/tailf-ncs-devices.yang:3513
yang/test-yang.yang:47: error: the node is config, but refers to a non-config node 'name' defined at /home/nabil/ncs-5.8/src/ncs/yang/tailf-ncs-devices.yang:3513
yang/test-yang.yang:47: error: the node is config, but refers to a non-config node 'name' defined at /home/nabil/ncs-5.8/src/ncs/yang/tailf-ncs-devices.yang:3513
make: *** [Makefile:25: ../load-dir/test-yang.fxs] Error 1

 

 

 

 Here after the modification

 

 

 

 

 

nabil@DESKTOP-8ECTID4:~/ncs-run-5.8/packages/test-yang/src$ make clean all
rm -rf ../load-dir java/src//
mkdir -p ../load-dir
mkdir -p java/src//
/home/nabil/ncs-5.8/bin/ncsc  --allow-interop-issues  `ls test-yang-ann.yang  > /dev/null 2>&1 && echo "-a test-yang-ann.yang"` \
              -c -o ../load-dir/test-yang.fxs yang/test-yang.yang
yang/test-yang.yang:47: warning: the node is config, but refers to a non-config node 'name' defined at /home/nabil/ncs-5.8/src/ncs/yang/tailf-ncs-devices.yang:3513
yang/test-yang.yang:47: warning: the node is config, but refers to a non-config node 'name' defined at /home/nabil/ncs-5.8/src/ncs/yang/tailf-ncs-devices.yang:3513
yang/test-yang.yang:47: warning: the node is config, but refers to a non-config node 'name' defined at /home/nabil/ncs-5.8/src/ncs/yang/tailf-ncs-devices.yang:3513
yang/test-yang.yang:47: warning: the node is config, but refers to a non-config node 'name' defined at /home/nabil/ncs-5.8/src/ncs/yang/tailf-ncs-devices.yang:3513

 

 

 

This fixed the issue. Thank you!

Polls
AI-powered tools for network troubleshooting are likely to be part of everyone’s workflow sooner or later. What is the single biggest challenge or concern you see with adopting these tools in your organization?