All Apps and Add-ons

Error while installing an app on Splunk 6 on Windows.

steveta_uk
Explorer

I'm currently updating an app to be Splunk 6 compliant, and I'm seeing an error when I
try and install the app on Windows. This error doesn't occur on Linux systems.

The error page looks like this:

500 Internal Server Error

Return to Splunk home page
AttributeError: 'SplunkdConnectionException' object has no attribute 'msg'

This page was linked to from
http://win7:8000/en-GB/manager/appinstall/_upload?breadcrumbs=Settings%7C%2Fmanager%2Flauncher%2F%09....

Do you have any idea where I should be looking to see what the problem is?

0 Karma

dmr195
Communicator

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.

steveta_uk
Explorer

Thanks for the answer. I had tried going via Splunk support but got a stream of really idiotic questions from them so gave up on that route.

The error seems to have no bad effects so given your answer I'll advise anyone who sees it to simply ignore it.

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!

Persistent Queue at TcpOut — One of Splunk's Most Practical Features

Splunk introduced persistent queueing at the tcpout layer as one of the most practical resilience features in ...

Skip the Awkward Silence: Have a .conf-ersation at .conf26

Picture this. You arrive at .conf26 already having your socializing and networking plans mapped out. No ...

Rethinking Zero Trust: From Product Purchases to Logical Control Evidence

Implementing Zero Trust (ZT) across complex environments often falters at the very beginning due to a ...