I am using the following code to place a market cover order a bank nifty option and subsequent exit the same. There is a error thrown that "cannot cancel order as it is been processed Try again later" but the actual status of the order is been shown as trigger pending
You can go through this thread.