I'm getting intermittent http.client.RemoteDisconnected errors when performing queries to Splunk.
After successfully creating a Splunk Service instance, i create a normal search job:
This function is sometimes successful, but for other runs I'm receiving the following error:
File "test.py", line 19, in splunk_search
while not job_normalsearch.is_ready():
File "C:\Users\user\.conda\envs\testenv\lib\site-packages\splunklib\client.py", line 2862, in is_ready
response = self.get()
File "C:\Users\user\.conda\envs\testenv\lib\site-packages\splunklib\client.py", line 1117, in get
return super(Entity, self).get(path_segment, owner=owner, app=app, sharing=sharing, **query)
File "C:\Users\user\.conda\envs\testenv\lib\site-packages\splunklib\client.py", line 862, in get
return self.service.get(path,
File "C:\Users\user\.conda\envs\testenv\lib\site-packages\splunklib\binding.py", line 289, in wrapper
return request_fun(self, *args, **kwargs)
File "C:\Users\user\.conda\envs\testenv\lib\site-packages\splunklib\binding.py", line 73, in new_f
val = f(*args, **kwargs)
File "C:\Users\user\.conda\envs\testenv\lib\site-packages\splunklib\binding.py", line 699, in get
response = self.http.get(path, all_headers, **query)
File "C:\Users\user\.conda\envs\testenv\lib\site-packages\splunklib\binding.py", line 1232, in get
return self.request(url, { 'method': "GET", 'headers': headers })
File "C:\Users\user\.conda\envs\testenv\lib\site-packages\splunklib\binding.py", line 1294, in request
response = self.handler(url, message, **kwargs)
File "C:\Users\user\.conda\envs\testenv\lib\site-packages\splunklib\binding.py", line 1453, in request
response = connection.getresponse()
File "C:\Users\user\.conda\envs\testenv\lib\http\client.py", line 1374, in getresponse
response.begin()
File "C:\Users\user\.conda\envs\testenv\lib\http\client.py", line 318, in begin
version, status, reason = self._read_status()
File "C:\Users\user\.conda\envs\testenv\lib\http\client.py", line 287, in _read_status
raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response
I have also tried using one_shot searches and also getting the same error intermittently in the following line:
Looks like I have solved the problem. Changing the token from parameter from "splunkToken" to "token" when creating the service has solved the problem.
I'm getting intermittent http.client.RemoteDisconnected errors when performing queries to Splunk. After successfully creating a Splunk Service instance, i create a normal search job:
This function is sometimes successful, but for other runs I'm receiving the following error:
I have also tried using one_shot searches and also getting the same error intermittently in the following line:
service.jobs.oneshot(search_query, **kwargs_search)
Do you know what could be causing this problem?