Hello, While using .net client App, i have started getting "'The operation has timed out." error recently. Any idea what could be cause for this? There is no network issue here.
The above error message is not thrown by the library exceptions. It must be from the .Net framework or by the system.
Please post exception stack trace or a code snippet that can reproduce the issue at our end. It is difficult to pinpoint the issue just from an error message.
Please see below. Do you think this could be due to certain windows security updates? My system did install few updates recently ====================== System.Net.WebException HResult=0x80131509 Message=The operation has timed out. Source=KiteConnect StackTrace: at KiteConnect.Kite.Request(String Route, String Method, Object Params, Dictionary`2 QueryParams, Boolean json) in C:\Chetan\Trade\KiteConnect\Backup\dotnetkiteconnect-master - 8 - Good\KiteConnect\Kite.cs:line 1281 at KiteConnect.Kite.Get(String Route, Dictionary`2 Params, Dictionary`2 QueryParams) in C:\Chetan\Trade\KiteConnect\Backup\dotnetkiteconnect-master - 8 - Good\KiteConnect\Kite.cs:line 1122 at KiteConnect.Kite.GetLTP(String[] InstrumentId) in C:\Chetan\Trade\KiteConnect\Backup\dotnetkiteconnect-master - 8 - Good\KiteConnect\Kite.cs:line 690 at KiteConnectSample.Program.Main(String[] args) in C:\Chetan\Trade\KiteConnect\Backup\dotnetkiteconnect-master - 8 - Good\KiteConnectSample\Program.cs:line 389
This seem like a network timeout. Program is unable to initiate a connection to Kite even after a long time.
I'm unsure if security updates can cause this. But if there was any changes to your network/firewall/internet/DNS settings then this can happen. Couple of things to try:
1. Try opening https://api.kite.trade/ in browser. If this loads then it is not internet issue. 2. Try `ping api.kite.trade` in command prompt. If this works then your DNS is fine. 3. Try a new sample project and see if that is able to access Kite data. If this works then your firewall has blocked your main program.
1 & 2 are fine. I have put all firewall settings off.
Also, i am getting below error intermittently. Any thoughts? I am clueless as to why i started getting these errors from last couple of days.
================ System.OperationCanceledException HResult=0x8013153B Message=The operation was canceled. Source=System.Net.Requests StackTrace: at System.Net.HttpWebRequest.GetResponse() at KiteConnect.Kite.Request(String Route, String Method, Object Params, Dictionary`2 QueryParams, Boolean json) in C:\Chetan\Trade\KiteConnect\dotnetkiteconnect-master\KiteConnect\Kite.cs:line 1274 at KiteConnect.Kite.Get(String Route, Dictionary`2 Params, Dictionary`2 QueryParams) in C:\Chetan\Trade\KiteConnect\dotnetkiteconnect-master\KiteConnect\Kite.cs:line 1122 at KiteConnect.Kite.GetLTP(String[] InstrumentId) in C:\Chetan\Trade\KiteConnect\dotnetkiteconnect-master\KiteConnect\Kite.cs:line 690 at KiteConnectSample.Program.Main(String[] args) in C:\Chetan\Trade\KiteConnect\dotnetkiteconnect-master\KiteConnectSample\Program.cs:line 494
And remember, these are happening randomly. The same GetLTP API works fine sometimes and throws "Operation was cancelled" / "Operation time out" errors other times.
Hey tonystark, My user ID is PJR394. Now I am continuously getting time out error.. here is call stack. Any help you could provide is much appreciated. I downloaded fresh kiteconnect sample from github.. changed network etc. to eliminate that possibility. No luck. ======================== System.Net.WebException HResult=0x80131509 Message=The operation has timed out. Source=System.Net.Requests StackTrace: at System.Net.HttpWebRequest.GetResponse() at KiteConnect.Kite.Request(String Route, String Method, Object Params, Dictionary`2 QueryParams, Boolean json) in C:\Chetan\Trade\KiteConnect\Original\dotnetkiteconnect-master\KiteConnect\Kite.cs:line 1274
This exception was originally thrown at this call stack: [External Code] KiteConnect.Kite.Request(string, string, dynamic, System.Collections.Generic.Dictionary, bool) in Kite.cs
For benefits of community, this was due to mcafee software. Mcafee is such a shitty product. Their product can't be uninstalled by Windows standard uninstall procedure and therefore they created utility called MCPR. Such a BS.
Please post exception stack trace or a code snippet that can reproduce the issue at our end. It is difficult to pinpoint the issue just from an error message.
======================
System.Net.WebException
HResult=0x80131509
Message=The operation has timed out.
Source=KiteConnect
StackTrace:
at KiteConnect.Kite.Request(String Route, String Method, Object Params, Dictionary`2 QueryParams, Boolean json) in C:\Chetan\Trade\KiteConnect\Backup\dotnetkiteconnect-master - 8 - Good\KiteConnect\Kite.cs:line 1281
at KiteConnect.Kite.Get(String Route, Dictionary`2 Params, Dictionary`2 QueryParams) in C:\Chetan\Trade\KiteConnect\Backup\dotnetkiteconnect-master - 8 - Good\KiteConnect\Kite.cs:line 1122
at KiteConnect.Kite.GetLTP(String[] InstrumentId) in C:\Chetan\Trade\KiteConnect\Backup\dotnetkiteconnect-master - 8 - Good\KiteConnect\Kite.cs:line 690
at KiteConnectSample.Program.Main(String[] args) in C:\Chetan\Trade\KiteConnect\Backup\dotnetkiteconnect-master - 8 - Good\KiteConnectSample\Program.cs:line 389
I'm unsure if security updates can cause this. But if there was any changes to your network/firewall/internet/DNS settings then this can happen. Couple of things to try:
1. Try opening https://api.kite.trade/ in browser. If this loads then it is not internet issue.
2. Try `ping api.kite.trade` in command prompt. If this works then your DNS is fine.
3. Try a new sample project and see if that is able to access Kite data. If this works then your firewall has blocked your main program.
Also, i am getting below error intermittently. Any thoughts? I am clueless as to why i started getting these errors from last couple of days.
================
System.OperationCanceledException
HResult=0x8013153B
Message=The operation was canceled.
Source=System.Net.Requests
StackTrace:
at System.Net.HttpWebRequest.GetResponse()
at KiteConnect.Kite.Request(String Route, String Method, Object Params, Dictionary`2 QueryParams, Boolean json) in C:\Chetan\Trade\KiteConnect\dotnetkiteconnect-master\KiteConnect\Kite.cs:line 1274
at KiteConnect.Kite.Get(String Route, Dictionary`2 Params, Dictionary`2 QueryParams) in C:\Chetan\Trade\KiteConnect\dotnetkiteconnect-master\KiteConnect\Kite.cs:line 1122
at KiteConnect.Kite.GetLTP(String[] InstrumentId) in C:\Chetan\Trade\KiteConnect\dotnetkiteconnect-master\KiteConnect\Kite.cs:line 690
at KiteConnectSample.Program.Main(String[] args) in C:\Chetan\Trade\KiteConnect\dotnetkiteconnect-master\KiteConnectSample\Program.cs:line 494
My user ID is PJR394. Now I am continuously getting time out error.. here is call stack. Any help you could provide is much appreciated.
I downloaded fresh kiteconnect sample from github.. changed network etc. to eliminate that possibility. No luck.
========================
System.Net.WebException
HResult=0x80131509
Message=The operation has timed out.
Source=System.Net.Requests
StackTrace:
at System.Net.HttpWebRequest.GetResponse()
at KiteConnect.Kite.Request(String Route, String Method, Object Params, Dictionary`2 QueryParams, Boolean json) in C:\Chetan\Trade\KiteConnect\Original\dotnetkiteconnect-master\KiteConnect\Kite.cs:line 1274
This exception was originally thrown at this call stack:
[External Code]
KiteConnect.Kite.Request(string, string, dynamic, System.Collections.Generic.Dictionary, bool) in Kite.cs
try
{
webResponse = request.GetResponse();
}
catch (WebException e)
{
if (e.Response is null)
throw e;
webResponse = e.Response;
}
May be you should try in a different machine while being in the same network. See if that works.