Splunk Dev

Splunk webservice won't start due to Python error?

markdflip
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\root.py", line 90, in <module>
    splunk.setupSplunkLogger(logger, LOGGING_DEFAULT_CONFIG_FILE, LOGGING_LOCAL_CONFIG_FILE, LOGGING_STANZA_NAME)
  File "C:\Program Files\Splunk\Python-2.7\Lib\site-packages\splunk\__init__.py", line 149, in setupSplunkLogger
    levels = getSplunkLoggingConfig(baseLogger, defaultConfigFile, localConfigFile, loggingStanzaName, verbose)
  File "C:\Program Files\Splunk\Python-2.7\Lib\site-packages\splunk\__init__.py", line 168, in getSplunkLoggingConfig
    baseLogger.info('Using default logging config file: %s' % defaultConfigFile)
  File "C:\Program Files\Splunk\Python-2.7\Lib\logging\__init__.py", line 1160, in info
    self._log(INFO, msg, args, **kwargs)
  File "C:\Program Files\Splunk\Python-2.7\Lib\logging\__init__.py", line 1278, in _log
    record = self.makeRecord(self.name, level, fn, lno, msg, args, exc_info, func, extra)
  File "C:\Program Files\Splunk\Python-2.7\Lib\site-packages\splunk\appserver\mrsparkle\root.py", 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\__init__.py", line 13, in <module>
    from lib.decorators import *
  File "C:\Program Files\Splunk\Python-2.7\Lib\site-packages\splunk\appserver\mrsparkle\lib\decorators.py", line 2, in <module>
    import cherrypy
  File "C:\Program Files\Splunk\Python-2.7\Lib\site-packages\cherrypy\__init__.py", line 161, in <module>
    from cherrypy import _cptools
  File "C:\Program Files\Splunk\Python-2.7\Lib\site-packages\cherrypy\_cptools.py", 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\static.py", line 2, in <module>
    mimetypes.init()
  File "C:\Program Files\Splunk\Python-2.7\Lib\mimetypes.py", line 351, in init
    db.read_windows_registry()
  File "C:\Program Files\Splunk\Python-2.7\Lib\mimetypes.py", 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
1 Solution

markdflip
Path Finder

The issue ended up being in the mimestype.py.

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

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

File was checked with
python -m tabnanny mimestype.py

View solution in original post

0 Karma

markdflip
Path Finder

The issue ended up being in the mimestype.py.

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

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

File was checked with
python -m tabnanny mimestype.py

0 Karma
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!

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas     Cisco Live 2026 is almost here, and this ...

What Is the Name of the USB Key Inserted by Bob Smith? (BOTS Hint, Not the Answer)

Hello Splunkers,   So you searched, “what is the name of the usb key inserted by bob smith?”  Not gonna lie… ...

Automating Threat Operations and Threat Hunting with Recorded Future

    Automating Threat Operations and Threat Hunting with Recorded Future June 29, 2026 | Register   Is your ...