Splunk Dev

C# SDK exception : System.Net.WebException: The request was aborted: The request was canceled.

ykmohank
New Member

Hi,
I am trying to call a Saved search using C# SDK as below.

SavedSearchCollection coll = service.GetSavedSearches();

SavedSearch SplunkSearch = service.GetSavedSearches().Get("SavedSearchName");

Job searchJob = SplunkSearch .Dispatch();

while (!searchJob.IsDone)

{

try

{

Thread.Sleep(500);

}
catch (Exception ex)
{

 }

}

I am getting the following exception while trying to execute while (!searchJob.IsDone).

System.Net.WebException: The request was aborted: The request was canceled. at System.Net.ConnectStream.Read(Byte[] buffer, Int32 offset, Int32 size) at System.Xml.XmlTextReaderImpl.ReadData() at System.Xml.XmlTextReaderImpl.ParseText(Int32& startPos, Int32& endPos, Int32& outOrChars) at System.Xml.XmlTextReaderImpl.ParseText() at System.Xml.XmlTextReaderImpl.ParseElementContent() at System.Xml.XmlTextReaderImpl.Read() at System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace) at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc) at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace) at System.Xml.XmlDocument.Load(XmlReader reader) at System.Xml.XmlDocument.Load(Stream inStream) at Splunk.AtomEntry.Parse(Stream input) at Splunk.Job.Refresh() at Splunk.Job.get_IsDone() at SplunkDataPull.FetchData.Fetchdata()

Note:The issues is not occurring every time.Few runs are running without any issues few runs are throwing this exception.

Please help

Tags (3)
0 Karma

MaverickT
Communicator

I had same problem. Solution was to repair .net 4.0 installation on server where application was installed.

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...