API error undefined

Hi guys,
I have few apis written in pyteal buying of nfts transfer of tokens transfer of algos and tranfer of loyatly tokens. While opting in to assest through the api code this is the error we get but its not consistant error if I restart the application server it works. What can be the error and how can i resolve it.
Please help.