Developing for Splunk Enterprise

Splunk webservice won't start due to Python error?

Path Finder

I recently installed Splunk on my Windows machine and the process completed. However, when I try to go to the splunk web interface, I am unable to connect. Searching the webservice log provides the following issues. It seems to by Python related, but I am not sure what these errors mean.

2016-03-26 12:09:33,671 ERROR   [-] root:810 - Unable to start splunkweb
2016-03-26 12:09:33,673 ERROR   [-] root:811 - must be string without null bytes or None, not str
Traceback (most recent call last):
  File "C:\Program Files\Splunk\Python-2.7\Lib\site-packages\splunk\appserver\mrsparkle\", line 90, in <module>
  File "C:\Program Files\Splunk\Python-2.7\Lib\site-packages\splunk\", line 149, in setupSplunkLogger
    levels = getSplunkLoggingConfig(baseLogger, defaultConfigFile, localConfigFile, loggingStanzaName, verbose)
  File "C:\Program Files\Splunk\Python-2.7\Lib\site-packages\splunk\", line 168, in getSplunkLoggingConfig'Using default logging config file: %s' % defaultConfigFile)
  File "C:\Program Files\Splunk\Python-2.7\Lib\logging\", line 1160, in info
    self._log(INFO, msg, args, **kwargs)
  File "C:\Program Files\Splunk\Python-2.7\Lib\logging\", line 1278, in _log
    record = self.makeRecord(, level, fn, lno, msg, args, exc_info, func, extra)
  File "C:\Program Files\Splunk\Python-2.7\Lib\site-packages\splunk\appserver\mrsparkle\", line 61, in makeRecord
    from splunk.appserver.mrsparkle.lib.util import get_request_id
  File "C:\Program Files\Splunk\Python-2.7\Lib\site-packages\splunk\appserver\mrsparkle\", line 13, in <module>
    from lib.decorators import *
  File "C:\Program Files\Splunk\Python-2.7\Lib\site-packages\splunk\appserver\mrsparkle\lib\", line 2, in <module>
    import cherrypy
  File "C:\Program Files\Splunk\Python-2.7\Lib\site-packages\cherrypy\", line 161, in <module>
    from cherrypy import _cptools
  File "C:\Program Files\Splunk\Python-2.7\Lib\site-packages\cherrypy\", line 226, in <module>
    from cherrypy.lib import cptools, encoding, auth, static, tidy
  File "C:\Program Files\Splunk\Python-2.7\Lib\site-packages\cherrypy\lib\", line 2, in <module>
  File "C:\Program Files\Splunk\Python-2.7\Lib\", line 351, in init
  File "C:\Program Files\Splunk\Python-2.7\Lib\", line 254, in read_windows_registry
    with _winreg.OpenKey(hkcr, subkeyname) as subkey:
TypeError: must be string without null bytes or None, not str
0 Karma

Re: Splunk webservice won't start due to Python error?

Path Finder

The issue ended up being in the

I added the following code in line 254 of the file.

                    if '\0' in subkeyname: # new
                        print "Skipping bad key: %s" % subkeyname # new
                        continue # new

File was checked with
python -m tabnanny

View solution in original post

0 Karma