All Apps and Add-ons

SplunkWeb will not start after upgrading to Splunk 8.0.0 due to "SyntaxError: invalid syntax"

LukeMurphey
Champion

SplunkWeb will not start after upgrading to 8.0.0. web_service.log includes the following message:

2019-11-12 18:34:59,331 ERROR   [5dcafb52437f3b120e8d90] root:770 - invalid syntax (LookupFileEditor.py, line 69)
Traceback (most recent call last):
  File "/opt/splunk/lib/python3.7/site-packages/splunk/appserver/mrsparkle/root.py", line 132, in <module>
    from splunk.appserver.mrsparkle.controllers.top import TopController
  File "/opt/splunk/lib/python3.7/site-packages/splunk/appserver/mrsparkle/controllers/top.py", line 27, in <module>
    from splunk.appserver.mrsparkle.controllers.admin import AdminController
  File "/opt/splunk/lib/python3.7/site-packages/splunk/appserver/mrsparkle/controllers/admin.py", line 25, in <module>
    from splunk.appserver.mrsparkle.controllers.appinstall import AppInstallController
  File "/opt/splunk/lib/python3.7/site-packages/splunk/appserver/mrsparkle/controllers/appinstall.py", line 22, in <module>
    from splunk.appserver.mrsparkle.lib import module
  File "/opt/splunk/lib/python3.7/site-packages/splunk/appserver/mrsparkle/lib/module.py", line 465, in <module>
    moduleMapper = ModuleMapper()
  File "/opt/splunk/lib/python3.7/site-packages/splunk/appserver/mrsparkle/lib/module.py", line 83, in __init__
    self.installedModules = self.getInstalledModules()
  File "/opt/splunk/lib/python3.7/site-packages/splunk/appserver/mrsparkle/lib/module.py", line 28, in helper
    return f(*a, **kw)
  File "/opt/splunk/lib/python3.7/site-packages/splunk/appserver/mrsparkle/lib/module.py", line 448, in getInstalledModules
    mods = self.getModuleList(root)
  File "/opt/splunk/lib/python3.7/site-packages/splunk/appserver/mrsparkle/lib/module.py", line 37, in helper
    return f(*a, **kw)
  File "/opt/splunk/lib/python3.7/site-packages/splunk/appserver/mrsparkle/lib/module.py", line 223, in getModuleList
    mod = __import__(modname)
  File "/opt/splunk/etc/apps/lookup_editor/appserver/modules/LookupFileEditor/LookupFileEditor.py", line 69
    except Exception, e :
                    ^
SyntaxError: invalid syntax
1 Solution

LukeMurphey
Champion

This issue is due to old modules being left on the file-system from a old version of the Lookup Editor app. Splunk allows remnants of old versions of apps to be left behind and these can cause issues upon upgrading. Specifically, SplunkWeb in 8.0.0 requires code to be Python 3 compatible and some of the old remnants are not Python 3 compatible.

To fix this, you just need to remove these old remnants. To do so, just remove the directory $SPLUNK_HOME/etc/apps/lookup_editor/appserver/modules/ and restart Splunk.

View solution in original post

dwraesner
Explorer

Hello,

Just a heads up that the same app, Lookup Editor 3.3.3, also caused SplunkWeb to not start for Splunk Enterprise 7.2.6 even though the Compatibility section shows SE 7.2 included as of 3-12-20.

For the Splunk folks, this caused many headaches as there was nothing in either the splunkd.log or the web_services.log indicating this was the issue. After adding, state=disabled, in the local app.conf file for the Lookup Editor app, and restarting then SplunkWeb started with no issue.

Compatibility
Products: Splunk Cloud, Splunk Enterprise
Splunk Versions: 8.0, 7.3, 7.2, 7.1, 7.0, 6.6
Platform: Platform Independent

https://splunkbase.splunk.com/app/1724/

0 Karma

LukeMurphey
Champion

This issue is due to old modules being left on the file-system from a old version of the Lookup Editor app. Splunk allows remnants of old versions of apps to be left behind and these can cause issues upon upgrading. Specifically, SplunkWeb in 8.0.0 requires code to be Python 3 compatible and some of the old remnants are not Python 3 compatible.

To fix this, you just need to remove these old remnants. To do so, just remove the directory $SPLUNK_HOME/etc/apps/lookup_editor/appserver/modules/ and restart Splunk.

DBattisto
Communicator

Great answer. I had a similar issue with the Splunk_App_for_nix.

0 Karma
Get Updates on the Splunk Community!

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...