cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1054
Views
0
Helpful
3
Replies

Transaction error with maapi

nso20
Level 1
Level 1

Hello,

I faced a strange error with maapi, ncs-python-vm-service1.log:

 

File line 18, in apply
File line 16, in mymethod
with maap.start_read_trans(usid=uinfo.usid) as trans:
File line 560, in start_read_trans product, version, client_id)
File line 548, in start_trans vendor, product, version, client_id) _ncs.error.Error: internal error (18):

 

devel.log is:

ncs[1452]: ncs commit progress db=running usid=4309 thandle=23747: ncs: device device1: get-trans-id: device get-trans-id error

 

There is maapi transaction1 before the error:

maap = ncs.maapi.Maapi()
with maap.start_read_trans(usid=uinfo.usid) as trans:

then maapi transaction2 before the error:

maap = ncs.maapi.Maapi()
with maap.start_read_trans(usid=uinfo.usid) as trans:

then maapi transaction3 at the error:

maap = ncs.maapi.Maapi()
with maap.start_read_trans(usid=uinfo.usid) as trans:

 

NSO version 4.7.5

1 Accepted Solution

Accepted Solutions

nso20
Level 1
Level 1

I figured out the reason of the error, it was due to very long action (more than two minutes), which lead to application timeout error, so I used the below command in main.py under class Action to increase action timeout to five minutes:

_ncs.dp.action_set_timeout(myuser, 300)

View solution in original post

3 Replies 3

hniska
Cisco Employee
Cisco Employee

Hi!

 

Im sorry but without more information it's impossible to say anything regarding this. Please give us a bit of context. Looks like your service called service1 fails, but a bit more code than just "with maap.start_read_trans(usid=uinfo.usid) as trans:" would be nice

its very large code, so which part exactly do you need ?

nso20
Level 1
Level 1

I figured out the reason of the error, it was due to very long action (more than two minutes), which lead to application timeout error, so I used the below command in main.py under class Action to increase action timeout to five minutes:

_ncs.dp.action_set_timeout(myuser, 300)