cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
143
Views
1
Helpful
6
Replies
Highlighted
Cisco Employee

Error When Loading Packages

How do I import a package – what is the proper make command?

gmp@lattice:~/ncs-staros/packages/mobileCloud/src$ make -B

/home/gmp/ncs-3.3/bin/ncsc  `ls devInv-ann.yang  > /dev/null 2>&1 && echo "-a devInv-ann.yang"` \

             --yangpath yang  -c -o ../load-dir/devInv.fxs yang/devInv.yang

/home/gmp/ncs-3.3/bin/ncsc --java-disable-prefix --exclude-enums --fail-on-warnings --java-package com.example.mobileCloud.namespaces --emit-java java/src/com/example/mobileCloud/namespaces/devInv.java ../load-dir/devInv.fxs

cd java && ant -q all

BUILD SUCCESSFUL

Total time: 1 second

gmp@lattice:~/ncs-staros$ ncs --with-pacakge-reload

*** --with-pacakge-reload: Unknown option

Try ncs --help to get usage text

gmp@lattice:~/ncs-staros$ ncs --with-package-reload

Failed to load file ./state/packages-in-use/1/mobileCloud/load-dir/devInv.fxs: ./state/packages-in-use/1/mobileCloud/load-dir/devInv.fxs: Must be recompiled!

Daemon died status=21

gmp@lattice:~/ncs-staros$

But when I go into the load-dir – the compile date is current:

gmp@lattice:~/ncs-staros/state/packages-in-use/1/mobileCloud/load-dir$ ls -al

total 12

drwxrwxr-x 2 gmp gmp 4096 May  4 06:49 .

drwxrwxr-x 6 gmp gmp 4096 May  4 06:49 ..

-rw-rw-r-- 1 gmp gmp 1753 May  4 06:49 devInv.fxs

gmp@lattice:~/ncs-staros/state/packages-in-use/1/mobileCloud/load-dir$

gmp@lattice:~/ncs-staros/packages/mobileCloud/load-dir$ ls

devInv.fxs

gmp@lattice:~/ncs-staros/packages/mobileCloud/load-dir$ ls -al

total 12

drwxr-xr-x 2 gmp gmp 4096 May  4 06:48 .

drwxr-xr-x 7 gmp gmp 4096 Dec 16 16:11 ..

-rw-rw-r-- 1 gmp gmp 1756 May  4 06:48 devInv.fxs

gmp@lattice:~/ncs-staros/packages/mobileCloud/load-dir$

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Cisco Employee

From the example below, I am building both the devInv.yang and the mobileCloud.yang files. 

JASYEN-M-K0HC:src jasyen$ make clean all

rm -rf  ../load-dir/*

rm -f ../*jar/*.jar

cd java && ant -q clean || true

BUILD SUCCESSFUL

Total time: 0 seconds

rm -f java/src/com/example/mobileCloud/namespaces/*.java

/Users/jasyen/Development/tailf/ncs/ncs-3.3.2/bin/ncsc  `ls devInv-ann.yang  > /dev/null 2>&1 && echo "-a devInv-ann.yang"` \

             --yangpath yang  -c -o ../load-dir/devInv.fxs yang/devInv.yang

/Users/jasyen/Development/tailf/ncs/ncs-3.3.2/bin/ncsc --java-disable-prefix --exclude-enums --fail-on-warnings --java-package com.example.mobileCloud.namespaces --emit-java java/src/com/example/mobileCloud/namespaces/devInv.java ../load-dir/devInv.fxs

/Users/jasyen/Development/tailf/ncs/ncs-3.3.2/bin/ncsc  `ls mobileCloud-ann.yang  > /dev/null 2>&1 && echo "-a mobileCloud-ann.yang"` \

             --yangpath yang  -c -o ../load-dir/mobileCloud.fxs yang/mobileCloud.yang

/Users/jasyen/Development/tailf/ncs/ncs-3.3.2/bin/ncsc --java-disable-prefix --exclude-enums --fail-on-warnings --java-package com.example.mobileCloud.namespaces --emit-java java/src/com/example/mobileCloud/namespaces/mobileCloud.java ../load-dir/mobileCloud.fxs

cd java && ant -q all

BUILD SUCCESSFUL

Total time: 1 second

ncs --with-package-reload

works.

View solution in original post

6 REPLIES 6
Highlighted
Cisco Employee

It would appear from the error message you need to compile the package with the same version of NCS you are running.

Highlighted
Cisco Employee

Ok I’m confused. I’m in my working directory, I unzip the package, and compile.

How else do I compile for my current version of NCS?

I have this package on another box under 3.3 and this box is running 3.3?

Highlighted
Cisco Employee

Also make sure you do a ‘make clean’ first and then ‘make all’. 

Highlighted
Cisco Employee

Same issue:

gmp@lattice:~/ncs-staros/packages/mobileCloud/src$ make clean

rm -rf  ../load-dir/*

rm -f ../*jar/*.jar

cd java && ant -q clean || true

BUILD SUCCESSFUL

Total time: 0 seconds

rm -f java/src/com/example/mobileCloud/namespaces/*.java

gmp@lattice:~/ncs-staros/packages/mobileCloud/src$ make -B

/home/gmp/ncs-3.3/bin/ncsc  `ls devInv-ann.yang  > /dev/null 2>&1 && echo "-a devInv-ann.yang"` \

             --yangpath yang  -c -o ../load-dir/devInv.fxs yang/devInv.yang

/home/gmp/ncs-3.3/bin/ncsc --java-disable-prefix --exclude-enums --fail-on-warnings --java-package com.example.mobileCloud.namespaces --emit-java java/src/com/example/mobileCloud/namespaces/devInv.java ../load-dir/devInv.fxs

cd java && ant -q all

BUILD SUCCESSFUL

Total time: 2 seconds

gmp@lattice:~/ncs-staros/packages/mobileCloud/src$ cd ..

gmp@lattice:~/ncs-staros/packages/mobileCloud$ cd ..

gmp@lattice:~/ncs-staros/packages$ cd ..

gmp@lattice:~/ncs-staros$ ncs --with-package-reload

Failed to load file ./state/packages-in-use/1/mobileCloud/load-dir/devInv.fxs: ./state/packages-in-use/1/mobileCloud/load-dir/devInv.fxs: Must be recompiled!

Daemon died status=21

gmp@lattice:~/ncs-staros$

Highlighted
Cisco Employee

From the example below, I am building both the devInv.yang and the mobileCloud.yang files. 

JASYEN-M-K0HC:src jasyen$ make clean all

rm -rf  ../load-dir/*

rm -f ../*jar/*.jar

cd java && ant -q clean || true

BUILD SUCCESSFUL

Total time: 0 seconds

rm -f java/src/com/example/mobileCloud/namespaces/*.java

/Users/jasyen/Development/tailf/ncs/ncs-3.3.2/bin/ncsc  `ls devInv-ann.yang  > /dev/null 2>&1 && echo "-a devInv-ann.yang"` \

             --yangpath yang  -c -o ../load-dir/devInv.fxs yang/devInv.yang

/Users/jasyen/Development/tailf/ncs/ncs-3.3.2/bin/ncsc --java-disable-prefix --exclude-enums --fail-on-warnings --java-package com.example.mobileCloud.namespaces --emit-java java/src/com/example/mobileCloud/namespaces/devInv.java ../load-dir/devInv.fxs

/Users/jasyen/Development/tailf/ncs/ncs-3.3.2/bin/ncsc  `ls mobileCloud-ann.yang  > /dev/null 2>&1 && echo "-a mobileCloud-ann.yang"` \

             --yangpath yang  -c -o ../load-dir/mobileCloud.fxs yang/mobileCloud.yang

/Users/jasyen/Development/tailf/ncs/ncs-3.3.2/bin/ncsc --java-disable-prefix --exclude-enums --fail-on-warnings --java-package com.example.mobileCloud.namespaces --emit-java java/src/com/example/mobileCloud/namespaces/mobileCloud.java ../load-dir/mobileCloud.fxs

cd java && ant -q all

BUILD SUCCESSFUL

Total time: 1 second

ncs --with-package-reload

works.

View solution in original post

Highlighted
Cisco Employee

For the record,

Issue is the tar file was also in the packages dir. 

Please remember the precedence of how NCS load packages.

Content for Community-Ad
Cisco Community October 2020 Spotlight Award Winners
This widget could not be displayed.