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!

Thanks for the Memories: .conf26 Took Learning to New Heights

Thank you, Splunk Community, for making .conf26 in Denver one for the books. From packed Splunk University ...

Best Practices: Splunk auto adjust pipeline queue

When you enable autoAdjustQueue in Splunk, maxSize should be understood as the queue size Splunk starts with ...

Splunk Auto Ingestion Parallel Pipeline Scaling

Why this feature matters Many Splunk environments experience ingestion pressure long before the host is fully ...