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
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 ...