I am running a loop that checks for group of 20 stocks LTP and then executes trade using some calculations. this program is set to run continously. once in 30 minutes, i get a {"message":"No response from server with error code: ECONNABORTED","error_type":"NetworkException","data":null}
I make the following kitconnect calls using Nodejs API inside my for loop. I notice that this error happens just after getLTP call.
How to debug and resolve
for (index=0; index<zones.length; index++) { kiteconnect.getLTP(); kc.getQuote();
Can you run in debug mode and let us know for which API call you got this error? Make sure to paste the complete stack trace and remove the app and client-specific details from that.
this is the error message -- {"message":"No response from server with error code: ECONNABORTED","error_type":"NetworkException","data":null} This error is thrown before call to kiteconnect.getLTP
Should debug be enabled in the options hash paramter that initiates the kiteconnect object.
var options = { "api_key": "", "debug": false // true here ?? };
In my case this is happening on reads. today it happened 20 times in 3 minutes. i am running Nodejs code from a regular AWS Ec2 instance. today i had to stop the code from executing as it flooded my SMS alerts. no order execution. Just invoking getLTP in a loop across instruments. how do I handle such errors as it could lead to crucial trade miss ?
Make sure to paste the complete stack trace and remove the app and client-specific details from that.
This error is thrown before call to kiteconnect.getLTP
Should debug be enabled in the options hash paramter that initiates the kiteconnect object.
var options = {
"api_key": "",
"debug": false // true here ??
};
{
adapter: [Function: httpAdapter],
transformRequest: { '0': [Function: transformRequest] },
transformResponse: { '0': [Function: transformResponse] },
timeout: 7000,
xsrfCookieName: 'XSRF-TOKEN',
xsrfHeaderName: 'X-XSRF-TOKEN',
maxContentLength: -1,
validateStatus: [Function: validateStatus],
headers: {
common: { Accept: 'application/json, text/plain, */*' },
delete: {},
get: {},
head: {},
post: { 'Content-Type': 'application/x-www-form-urlencoded' },
put: { 'Content-Type': 'application/x-www-form-urlencoded' },
patch: { 'Content-Type': 'application/x-www-form-urlencoded' },
'X-Kite-Version': 3,
'User-Agent': 'kiteconnectjs/3.1.0',
Authorization: '**********************'
},
baseURL: 'https://api.kite.trade',
paramsSerializer: [Function: paramsSerializer],
method: 'get',
url: '/quote/ltp',
params: { i: 'NSE:ASIANPAINT' },
data: ''
}
/**this is application log entry that comes in the debug log**/
2020-07-27 17:04:43.403 INFO Iteration - 9 - symbol NSE:ASIANPAINT Zone -103
2020-07-27 17:04:50.408 ERROR Error -{"message":"No response from server with error code: ECONNABORTED","error_type":"NetworkException","data":null}
/**this is application log entry that comes in the debug log**/
today even when I ran it once from command line it errored out. at 18:45 IST - 31Jul
{
adapter: [Function: httpAdapter],
transformRequest: { '0': [Function: transformRequest] },
transformResponse: {
'0': [Function: transformResponse],
'1': [Function: formatResponse]
},
timeout: 7000,
xsrfCookieName: 'XSRF-TOKEN',
xsrfHeaderName: 'X-XSRF-TOKEN',
maxContentLength: -1,
validateStatus: [Function: validateStatus],
headers: {
common: { Accept: 'application/json, text/plain, */*' },
delete: {},
get: {},
head: {},
post: { 'Content-Type': 'application/x-www-form-urlencoded' },
put: { 'Content-Type': 'application/x-www-form-urlencoded' },
patch: { 'Content-Type': 'application/x-www-form-urlencoded' },
'X-Kite-Version': 3,
'User-Agent': 'kiteconnectjs/3.1.0',
Authorization: 'token bejtlvvs809o3qxb:V2GPPnPOVg09098wQxBpo17srRKwW9gb4M'
},
baseURL: 'https://api.kite.trade',
paramsSerializer: [Function: paramsSerializer],
method: 'get',
url: '/orders',
params: {},
data: ''
}
2020-07-31 19:18:24.331 ERROR uncaught error in main logic {"message":"No response from server with error code: ECONNABORTED","error_type":"NetworkException","data":null}
This is surely some issue with your OMS somewhere. i am considering migrating to another platform if I can't find a reasonable fix.