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.

Get Updates on the Splunk Community!

Splunk Classroom Chronicles: Training Tales and Testimonials (Episode 2)

Welcome to the "Splunk Classroom Chronicles" series, created to help curious, career-minded learners get ...

Index This | I am a number but I am countless. What am I?

January 2025 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  Happy New Year! We’re ...

What’s New in Splunk Enterprise 9.4: Tools for Digital Resilience

PLATFORM TECH TALKS What’s New in Splunk Enterprise 9.4: Tools for Digital Resilience Thursday, February 27, ...