Getting Data In

Troubleshooting TypeError: 'NoneType' object is unsubscriptable when accessing through apache?

Krishna_R
Path Finder

Hello,

For maintenance, we had to restart our linux server where Splunk is hosted, after which we get this page when accessing Splunk UI.

500 Internal Server Error
TypeError: 'NoneType' object is unsubscriptable

You are using 127.0.0.1:8000, which is connected to splunkd @85165 at https://127.0.0.1:8089 on Thu Mar 10 18:40:24 2011.

We use Splunk behind Apache, I am able to use splunk if go to Splunk URL directly (:8000), but get the above error when accessing through apache (where we have configured SSO)

I searched in this site and found nothing to help but "a very distinct behavior in the environment" could cause this problem. Also, as I see different browsers are reported, I guess its something to do the Request parameters (in my case, it could be apache).

Any help on how to identify what part of the 'environment' is causing this, is appreciated.

Thanks, Krishna

Labels (1)
Tags (2)

Krishna_R
Path Finder

I was able to resolve this issue; Thanks to the stack trace - I could see functions like 'preform_sso_check', 'check_login' followed by appDispatcher etc...

We started observing this issue after a switch over from Trial to Free license, and we have SSO configured with Apache (NIS auth actually). Since, SSO doesn't make sense on a free license, I suspected that setting 'REMOTE-USER' from apache could potentially fiddle with the default 'admin' user in which Splunk is running (on free mode) and the NoneType is an effect of some missing validation (in User Preferences or sth like that :)).

I commented out setting the REMOTE-USER request header in apache and Bingo! the issue is resolved.

I understand this is a negative test-case (where the configuration is not proper resulting in the NoneType error), but do you think I should report a bug for a more meaningful message, or for better handling of this scenario?

0 Karma

Krishna_R
Path Finder

Following the stack backtrace from web_service.log.

2011-03-10 18:40:24,338 DEBUG   [4d798b984d1e17b410] _cplogging:55 - [10/Mar/2011:18:40:24] HTTP Traceback (most recent call last):
  File "/opt/splunk/lib/python2.6/site-packages/cherrypy/_cprequest.py", line 606, in respond
    cherrypy.response.body = self.handler()
  File "/opt/splunk/lib/python2.6/site-packages/cherrypy/_cpdispatch.py", line 25, in __call__
    return self.callable(*self.args, **self.kwargs)
  File "/opt/splunk/lib/python2.6/site-packages/splunk/appserver/mrsparkle/lib/routes.py", line 307, in default
    return route.target(self, **kw)
  File "<string>", line 1, in <lambda>
  File "/opt/splunk/lib/python2.6/site-packages/splunk/appserver/mrsparkle/lib/decorators.py", line 38, in rundecs
    return fn(*a, **kw)
  File "<string>", line 1, in <lambda>
  File "/opt/splunk/lib/python2.6/site-packages/splunk/appserver/mrsparkle/lib/decorators.py", line 93, in check
    return fn(self, *a, **kw)
  File "<string>", line 1, in <lambda>
  File "/opt/splunk/lib/python2.6/site-packages/splunk/appserver/mrsparkle/lib/decorators.py", line 141, in validate_ip
    return fn(self, *a, **kw)
  File "<string>", line 1, in <lambda>
  File "/opt/splunk/lib/python2.6/site-packages/splunk/appserver/mrsparkle/lib/decorators.py", line 275, in preform_sso_check
    return fn(self, *a, **kw)
  File "<string>", line 1, in <lambda>
  File "/opt/splunk/lib/python2.6/site-packages/splunk/appserver/mrsparkle/lib/decorators.py", line 312, in check_login
    return fn(self, *a, **kw)
  File "<string>", line 1, in <lambda>
  File "/opt/splunk/lib/python2.6/site-packages/splunk/appserver/mrsparkle/lib/decorators.py", line 333, in handle_exceptions
    return fn(self, *a, **kw)
  File "/opt/splunk/lib/python2.6/site-packages/splunk/appserver/mrsparkle/controllers/view.py", line 779, in appDispatcher
    nav, defaultView = self.getAppNav(app, views)
  File "/opt/splunk/lib/python2.6/site-packages/splunk/appserver/mrsparkle/controllers/view.py", line 178, in getAppNav
    navDefinition = et.XML(navDefinition['eai:data'], parser)
TypeError: 'NoneType' object is unsubscriptable
0 Karma

leneborma
New Member

The error is self-explanatory. You are trying to index None. You can not, because 'NoneType' object is not subscriptable. This means that you tried to do:

None[something]

In general, the error means that you attempted to index an object that doesn't have that functionality. You might have noticed that the method sort() that only modify the list have no return value printed – they return the default None. This is a design principle for all mutable data structures in Python.

 

0 Karma

Johnvey
Contributor

Can you check your web_service.log file and find the stack trace that accompanies this error?

0 Karma
Get Updates on the Splunk Community!

Synthetic Monitoring: Not your Grandma’s Polyester! Tech Talk: DevOps Edition

Register today and join TekStream on Tuesday, February 28 at 11am PT/2pm ET for a demonstration of Splunk ...

Instrumenting Java Websocket Messaging

Instrumenting Java Websocket MessagingThis article is a code-based discussion of passing OpenTelemetry trace ...

Announcing General Availability of Splunk Incident Intelligence!

Digital transformation is real! Across industries, companies big and small are going through rapid digital ...