Splunk Dev

Python error in web statistics app

sujith_usha_kum
Explorer

Hi all,

we are using web statistics app for web monitoring.
Frequently, we are facing below python error in urlping.py source code.

We could temporarly fix the issue by restarting the alert/saved search.
But it will be nice, if someone suggest a permanent solution for it.

Query:

|inputlookup web_inventory | where  url_type="static" | eval content_id="static" | eval category_id="static" |eval title="static url" | eval _time=now()|table _time,category_id, content_id, title, url, id, name, description | aiamurlping  dedup | eval result_code=spath(payload, "resultCode")  | eval result_error_message=spath(payload, "errorDescription") | fields - payload

ERROR Log:

12-24-2016 19:15:14.279 ERROR ScriptRunner - stderr from '/opt/splunk/bin/python /opt/splunk/etc/apps/aiam-urlping-data-addon/bin/urlping.py dedup':  Exception in thread Thread-2:
12-24-2016 19:15:14.279 ERROR ScriptRunner - stderr from '/opt/splunk/bin/python /opt/splunk/etc/apps/aiam-urlping-data-addon/bin/urlping.py dedup':  Traceback (most recent call last):
12-24-2016 19:15:14.279 ERROR ScriptRunner - stderr from '/opt/splunk/bin/python /opt/splunk/etc/apps/aiam-urlping-data-addon/bin/urlping.py dedup':    File "/opt/splunk/lib/python2.7/threading.py", line 801, in __bootstrap_inner
12-24-2016 19:15:14.279 ERROR ScriptRunner - stderr from '/opt/splunk/bin/python /opt/splunk/etc/apps/aiam-urlping-data-addon/bin/urlping.py dedup':      self.run()
12-24-2016 19:15:14.279 ERROR ScriptRunner - stderr from '/opt/splunk/bin/python /opt/splunk/etc/apps/aiam-urlping-data-addon/bin/urlping.py dedup':    File "/opt/splunk/etc/apps/aiam-urlping-data-addon/bin/urlping.py", line 146, in run
12-24-2016 19:15:14.279 ERROR ScriptRunner - stderr from '/opt/splunk/bin/python /opt/splunk/etc/apps/aiam-urlping-data-addon/bin/urlping.py dedup':      code,message,payload,resptime=self.urlinfo(row["url"],self.ourtimeout)
12-24-2016 19:15:14.279 ERROR ScriptRunner - stderr from '/opt/splunk/bin/python /opt/splunk/etc/apps/aiam-urlping-data-addon/bin/urlping.py dedup':    File "/opt/splunk/etc/apps/aiam-urlping-data-addon/bin/urlping.py", line 100, in urlinfo
12-24-2016 19:15:14.279 ERROR ScriptRunner - stderr from '/opt/splunk/bin/python /opt/splunk/etc/apps/aiam-urlping-data-addon/bin/urlping.py dedup':      w=u.urlopen(url, timeout=ourtimeout)
12-24-2016 19:15:14.279 ERROR ScriptRunner - stderr from '/opt/splunk/bin/python /opt/splunk/etc/apps/aiam-urlping-data-addon/bin/urlping.py dedup':    File "/opt/splunk/lib/python2.7/urllib2.py", line 154, in urlopen
12-24-2016 19:15:14.279 ERROR ScriptRunner - stderr from '/opt/splunk/bin/python /opt/splunk/etc/apps/aiam-urlping-data-addon/bin/urlping.py dedup':      return opener.open(url, data, timeout)
12-24-2016 19:15:14.279 ERROR ScriptRunner - stderr from '/opt/splunk/bin/python /opt/splunk/etc/apps/aiam-urlping-data-addon/bin/urlping.py dedup':    File "/opt/splunk/lib/python2.7/urllib2.py", line 431, in open
12-24-2016 19:15:14.279 ERROR ScriptRunner - stderr from '/opt/splunk/bin/python /opt/splunk/etc/apps/aiam-urlping-data-addon/bin/urlping.py dedup':      response = self._open(req, data)
12-24-2016 19:15:14.279 ERROR ScriptRunner - stderr from '/opt/splunk/bin/python /opt/splunk/etc/apps/aiam-urlping-data-addon/bin/urlping.py dedup':    File "/opt/splunk/lib/python2.7/urllib2.py", line 449, in _open
12-24-2016 19:15:14.279 ERROR ScriptRunner - stderr from '/opt/splunk/bin/python /opt/splunk/etc/apps/aiam-urlping-data-addon/bin/urlping.py dedup':      '_open', req)
12-24-2016 19:15:14.279 ERROR ScriptRunner - stderr from '/opt/splunk/bin/python /opt/splunk/etc/apps/aiam-urlping-data-addon/bin/urlping.py dedup':    File "/opt/splunk/lib/python2.7/urllib2.py", line 409, in _call_chain
12-24-2016 19:15:14.279 ERROR ScriptRunner - stderr from '/opt/splunk/bin/python /opt/splunk/etc/apps/aiam-urlping-data-addon/bin/urlping.py dedup':      result = func(*args)
12-24-2016 19:15:14.279 ERROR ScriptRunner - stderr from '/opt/splunk/bin/python /opt/splunk/etc/apps/aiam-urlping-data-addon/bin/urlping.py dedup':    File "/opt/splunk/lib/python2.7/urllib2.py", line 1240, in https_open
12-24-2016 19:15:14.279 ERROR ScriptRunner - stderr from '/opt/splunk/bin/python /opt/splunk/etc/apps/aiam-urlping-data-addon/bin/urlping.py dedup':      context=self._context)
12-24-2016 19:15:14.279 ERROR ScriptRunner - stderr from '/opt/splunk/bin/python /opt/splunk/etc/apps/aiam-urlping-data-addon/bin/urlping.py dedup':    File "/opt/splunk/lib/python2.7/urllib2.py", line 1200, in do_open
12-24-2016 19:15:14.279 ERROR ScriptRunner - stderr from '/opt/splunk/bin/python /opt/splunk/etc/apps/aiam-urlping-data-addon/bin/urlping.py dedup':      r = h.getresponse(buffering=True)
12-24-2016 19:15:14.279 ERROR ScriptRunner - stderr from '/opt/splunk/bin/python /opt/splunk/etc/apps/aiam-urlping-data-addon/bin/urlping.py dedup':    File "/opt/splunk/lib/python2.7/httplib.py", line 1136, in getresponse
12-24-2016 19:15:14.279 ERROR ScriptRunner - stderr from '/opt/splunk/bin/python /opt/splunk/etc/apps/aiam-urlping-data-addon/bin/urlping.py dedup':      response.begin()
12-24-2016 19:15:14.279 ERROR ScriptRunner - stderr from '/opt/splunk/bin/python /opt/splunk/etc/apps/aiam-urlping-data-addon/bin/urlping.py dedup':    File "/opt/splunk/lib/python2.7/httplib.py", line 453, in begin
12-24-2016 19:15:14.279 ERROR ScriptRunner - stderr from '/opt/splunk/bin/python /opt/splunk/etc/apps/aiam-urlping-data-addon/bin/urlping.py dedup':      version, status, reason = self._read_status()
12-24-2016 19:15:14.279 ERROR ScriptRunner - stderr from '/opt/splunk/bin/python /opt/splunk/etc/apps/aiam-urlping-data-addon/bin/urlping.py dedup':    File "/opt/splunk/lib/python2.7/httplib.py", line 409, in _read_status
12-24-2016 19:15:14.279 ERROR ScriptRunner - stderr from '/opt/splunk/bin/python /opt/splunk/etc/apps/aiam-urlping-data-addon/bin/urlping.py dedup':      line = self.fp.readline(_MAXLINE + 1)
12-24-2016 19:15:14.279 ERROR ScriptRunner - stderr from '/opt/splunk/bin/python /opt/splunk/etc/apps/aiam-urlping-data-addon/bin/urlping.py dedup':    File "/opt/splunk/lib/python2.7/socket.py", line 480, in readline
12-24-2016 19:15:14.279 ERROR ScriptRunner - stderr from '/opt/splunk/bin/python /opt/splunk/etc/apps/aiam-urlping-data-addon/bin/urlping.py dedup':      data = self._sock.recv(self._rbufsize)
12-24-2016 19:15:14.279 ERROR ScriptRunner - stderr from '/opt/splunk/bin/python /opt/splunk/etc/apps/aiam-urlping-data-addon/bin/urlping.py dedup':    File "/opt/splunk/lib/python2.7/ssl.py", line 734, in recv
12-24-2016 19:15:14.279 ERROR ScriptRunner - stderr from '/opt/splunk/bin/python /opt/splunk/etc/apps/aiam-urlping-data-addon/bin/urlping.py dedup':      return self.read(buflen)
12-24-2016 19:15:14.279 ERROR ScriptRunner - stderr from '/opt/splunk/bin/python /opt/splunk/etc/apps/aiam-urlping-data-addon/bin/urlping.py dedup':    File "/opt/splunk/lib/python2.7/ssl.py", line 621, in read
12-24-2016 19:15:14.279 ERROR ScriptRunner - stderr from '/opt/splunk/bin/python /opt/splunk/etc/apps/aiam-urlping-data-addon/bin/urlping.py dedup':      v = self._sslobj.read(len or 1024)
12-24-2016 19:15:14.279 ERROR ScriptRunner - stderr from '/opt/splunk/bin/python /opt/splunk/etc/apps/aiam-urlping-data-addon/bin/urlping.py dedup':  SSLError: ('The read operation timed out',)

Thanks in advance!

0 Karma

adambloom
Path Finder

I'm not familiar with that particular app, but I can tell you that the error you're getting in python means that the connection to an SSL server is timing out. In order to solve permanently, you would need to edit the actual urlping.py file to handle that exception properly and return something (or nothing) to Splunk if the connection times out. That timeout probably is indicating an error condition you were trying to detect.

0 Karma

sujith_usha_kum
Explorer

Thanks adambloom.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Supercharging Windows Security Detection Performance: Introducing Hybrid Field ...

Windows event logs—from Security auditing and Sysmon to PowerShell script blocks—form the operational backbone ...

Ditch the Manual Grind: Building AI Agents with Splunk

Ditch the Manual Grind: Building AI Agents with Splunk Let’s be real: your team’s time is being eaten alive. ...

Cisco Data Fabric from Architecture to Investigation, Better SOC Visibility, and More ...

Splunk Lantern is Splunk’s customer success center that provides practical guidance from Splunk experts on key ...