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.

Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...