There are two problems here. The one that's causing the HTTP 500 error is a bug in Splunk. There is a chunk of code that looks like this in lib/python2.7/site-packages/splunk/appserver/mrsparkle/controllers/appinstall.py:
try:
force = (force == '1')
appid = self.processAppUpload(appfile, force)
module.moduleMapper.resetInstalledModules()
memoizedViews.clearCachedViews()
return self.checkstatus(appid, state=state)
except SBFileUploadException, e:
error = e.message
except splunk.RESTException, e:
error = e.get_extended_message_text()
except cherrypy.HTTPRedirect, e:
raise e
except Exception,e:
error = e.msg
Whoever wrote this has assumed that any exception that reaches the last handler will have an attribute called 'msg'. This won't necessarily be the case. Since the Python code is just a text file you can fix this outermost problem in the error reporting by changing it to:
try:
force = (force == '1')
appid = self.processAppUpload(appfile, force)
module.moduleMapper.resetInstalledModules()
memoizedViews.clearCachedViews()
return self.checkstatus(appid, state=state)
except SBFileUploadException, e:
error = e.message
except splunk.RESTException, e:
error = e.get_extended_message_text()
except cherrypy.HTTPRedirect, e:
raise e
except Exception,e:
if hasattr(e, 'msg'):
error = e.msg
else:
error = str(e)
However, then there is the question of what caused the original SplunkdConnectionException that was thrown.
When I saw the same problem as you and made the edit above the underlying error message turned out to be:
Splunkd daemon is not responding: ('Error connecting to /services/apps/local: The read operation timed out',)
I think Splunkweb's timeout for server communication is 30 seconds. It would be better if this timeout was higher for installing apps compared to other REST API requests.
... View more