cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2081
Views
5
Helpful
4
Replies

Yang and Python cb_create error. while implementing Plan component (Reactive Fast Map)

ZAhmad04890
Level 1
Level 1

Hi,

I am having a following error in  NSO5.2  runtime window  , OS system is ubuntu 18.04

log log-entry 2021-07-01T16:15:15.82009+00:00
type service-modified
level error
message "Python cb_create error. 'ListElement' object has no attribute 'plan'"

 

upon looking at the log I got the following trace

 

<INFO> 01-Jul-2021::21:47:36.538 l2vpn ncs-dp-8904-l2vpn:l2vpn-1-th-947: - Service create(service=/l2vpn:l2vpn{l2vpn-10841})
<ERROR> 01-Jul-2021::21:47:36.538 l2vpn ncs-dp-8904-l2vpn:l2vpn-1-th-947: - 'ListElement' object has no attribute 'plan'
<ERROR> 01-Jul-2021::21:47:36.538 l2vpn ncs-dp-8904-l2vpn:l2vpn-1-th-947: - Traceback (most recent call last):
File "/home/ahmad/nso-5.2/src/ncs/pyapi/ncs/application.py", line 399, in wrapper
pl = fn(self, tctx, root, service, proplist)
File "/home/ahmad/ncs-run-l2vpn-enhanced/state/packages-in-use/1/l2vpn/python/l2vpn/l2vpn.py", line 46, in cb_create
self.self_plan = PlanComponent(service, 'self', 'ncs:self')
File "/home/ahmad/nso-5.2/src/ncs/pyapi/ncs/application.py", line 733, in __init__
self.component = planpath.plan.component.create(name)
File "/home/ahmad/nso-5.2/src/ncs/pyapi/ncs/maagic.py", line 472, in __getattr__
super(Node, self).__getattribute__(name)
AttributeError: 'ListElement' object has no attribute 'plan'

 

 

also while compiling the l2vpn.yang I am getting the following error

 

ahmad@ahmad-VPCEG28FG:~/ncs-run-l2vpn-enhanced/packages/l2vpn/src$ make clean all
rm -rf ../load-dir java/src//
mkdir -p ../load-dir
mkdir -p java/src//
/home/ahmad/nso-5.2/bin/ncsc `ls l2vpn-ann.yang > /dev/null 2>&1 && echo "-a l2vpn-ann.yang"` \
--yangpath ../../qos/src/yang -c -o ../load-dir/l2vpn.fxs yang/l2vpn.yang
yang/l2vpn.yang:34: error: identity 'plan-id' in module 'tailf-ncs' not found
Makefile:27: recipe for target '../load-dir/l2vpn.fxs' failed
make: *** [../load-dir/l2vpn.fxs] Error 1

 

I am attaching my python code l2vpn.py and  yang file l2vpn.yang , kindly help to identify if this error can be resolved. Thanks.

1 Accepted Solution

Accepted Solutions

gmuloche
Cisco Employee
Cisco Employee

Hello,

 

not sure if you are following an example or something else (I think it might be a some old training as I kind of recognise the formatting) but indeed as it says when you compile `plan-id` does not exist in the current tail-f yang model. So when your compilation fails then you end  up still using the previous compiled yang file (fxs) that does not have a plan.

 

I would recommend removing the three lines:

// identity l2vpn-plan {
// base ncs:plan-id;
//}

 and recompiling - it should go through provided there is no other error.

 

Then packages reload and you should be able to carry on with the training.

View solution in original post

4 Replies 4

gmuloche
Cisco Employee
Cisco Employee

Hello,

 

not sure if you are following an example or something else (I think it might be a some old training as I kind of recognise the formatting) but indeed as it says when you compile `plan-id` does not exist in the current tail-f yang model. So when your compilation fails then you end  up still using the previous compiled yang file (fxs) that does not have a plan.

 

I would recommend removing the three lines:

// identity l2vpn-plan {
// base ncs:plan-id;
//}

 and recompiling - it should go through provided there is no other error.

 

Then packages reload and you should be able to carry on with the training.

Hi gmuloche,

Thanks for your reply, the solution in your post was correct and yang file compiled correctly.( yes and this belongs to the dcloud training from NSO 4.5 named NSO Development Lab Guide.pdf)

ahmad@ahmad-VPCEG28FG:~/ncs-run-l2vpn-enhanced/packages/l2vpn/src$ make clean all
rm -rf ../load-dir java/src//
mkdir -p ../load-dir
mkdir -p java/src//
/home/ahmad/nso-5.2/bin/ncsc `ls l2vpn-ann.yang > /dev/null 2>&1 && echo "-a l2vpn-ann.yang"` \
--yangpath ../../qos/src/yang -c -o ../load-dir/l2vpn.fxs yang/l2vpn.yang


However when doing the reactive redeploy as below I received the following output


admin@ncs# l2vpn l2vpn-10841 reactive-re-deploy
admin@ncs# show l2vpn l2vpn-10841 plan
plan failed
plan error-info message "Transaction error"
plan error-info log-entry /l2vpn[service-id='l2vpn-10841']/log/log-entry[when='2021-07-30T16:48:53.552418+00:00']

admin@ncs#


where as in the training document the expected output was as below.


admin@ncs# l2vpn l2vpn-10841 reactive-re-deploy
admin@ncs#
System message at 2017-10-17 16:33:56...
Commit performed by admin via ssh using cli.
admin@ncs# show l2vpn l2vpn-10841 plan
NAME   TYPE   STATE                STATUS           WHEN                           ref
----------------------------------------------------------------
self        self      init                    reached           2017-10-17T20:33:56  -
                        ready                 reached          2017-10-17T20:33:56  -
l2vpn l2vpn      vc-id-request    reached           2017-10-17T20:33:56  -
                        vc-id-collect     reached           2017-10-17T20:33:56  -


any idea what could be causing this output ?

Hello,

 

no idea without a log - could be a lot of things. I just see "Transaction error" but I guess you should have some more descriptive error in either `show l2vpn l2vpn-10841`  or in the services logs?

ZAhmad04890
Level 1
Level 1

Hi gmuloche,

Thanks, it worked fine after i did devices sync from .  now output matches with the  training document.