Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: unicode indices must be integers #12

Closed
arbazkiraak opened this issue Feb 12, 2019 · 4 comments
Closed

TypeError: unicode indices must be integers #12

arbazkiraak opened this issue Feb 12, 2019 · 4 comments

Comments

@arbazkiraak
Copy link

Hello @thomaspatzke ,

Thanks for writing this wonderful extension. I'm getting exceptions while connecting it to elastic server.

  • I have elastic server running on localhost:9200 with cluster name mycluster1

Tested on BApp version of elasticburp.

Connecting to 'localhost:9200', index 'wase-burp'

elast

Errors

Traceback (most recent call last):
  File "C:\Users\arbaz\AppData\Roaming\BurpSuite\bapps\67f5c31f93d04ad3a3b0a1808b3648fa\ElasticBurp.py", line 64, in registerExtenderCallbacks
    self.applyConfig()
  File "C:\Users\arbaz\AppData\Roaming\BurpSuite\bapps\67f5c31f93d04ad3a3b0a1808b3648fa\ElasticBurp.py", line 81, in applyConfig
    JOptionPane.showMessageDialog(self.panel, "<html><p style='width: 300px'>Error while initializing ElasticSearch: %s</p></html>" % (str(e)), "Error", JOptionPane.ERROR_MESSAGE)
  File "C:\jython2.7.0\Lib\site-packages\elasticsearch\exceptions.py", line 55, in __str__
    cause = ', %r' % self.info['error']['root_cause'][0]['reason']
  File "C:\jython2.7.0\Lib\site-packages\elasticsearch\exceptions.py", line 55, in __str__
    cause = ', %r' % self.info['error']['root_cause'][0]['reason']
TypeError: unicode indices must be integers

	at org.python.core.Py.TypeError(Py.java:259)
	at org.python.core.SequenceIndexDelegate.checkIdxAndFindItem(SequenceIndexDelegate.java:74)
	at org.python.core.SequenceIndexDelegate.checkIdxAndGetItem(SequenceIndexDelegate.java:61)
	at org.python.core.PySequence.seq___getitem__(PySequence.java:377)
	at org.python.core.PySequence.__getitem__(PySequence.java:373)
	at elasticsearch.exceptions$py.__str__$8(C:\jython2.7.0\Lib\site-packages\elasticsearch\exceptions.py:58)
	at elasticsearch.exceptions$py.call_function(C:\jython2.7.0\Lib\site-packages\elasticsearch\exceptions.py)
	at org.python.core.PyTableCode.call(PyTableCode.java:167)
	at org.python.core.PyBaseCode.call(PyBaseCode.java:138)
	at org.python.core.PyFunction.__call__(PyFunction.java:413)
	at org.python.core.PyMethod.__call__(PyMethod.java:126)
	at org.python.core.PyMethod.__call__(PyMethod.java:117)
	at org.python.core.PyBaseExceptionDerived.__str__(PyBaseExceptionDerived.java:65)
	at org.python.core.PyString.str_new(PyString.java:164)
	at org.python.core.PyString$exposed___new__.new_impl(Unknown Source)
	at org.python.core.PyType.invokeNew(PyType.java:494)
	at org.python.core.PyType.type___call__(PyType.java:1706)
	at org.python.core.PyType.__call__(PyType.java:1696)
	at org.python.core.PyObject.__call__(PyObject.java:461)
	at org.python.core.PyObject.__call__(PyObject.java:465)
	at org.python.pycode._pyx6.applyConfig$3(C:\Users\arbaz\AppData\Roaming\BurpSuite\bapps\67f5c31f93d04ad3a3b0a1808b3648fa\ElasticBurp.py:81)
	at org.python.pycode._pyx6.call_function(C:\Users\arbaz\AppData\Roaming\BurpSuite\bapps\67f5c31f93d04ad3a3b0a1808b3648fa\ElasticBurp.py)
	at org.python.core.PyTableCode.call(PyTableCode.java:167)
	at org.python.core.PyBaseCode.call(PyBaseCode.java:138)
	at org.python.core.PyFunction.__call__(PyFunction.java:413)
	at org.python.core.PyMethod.__call__(PyMethod.java:126)
	at org.python.pycode._pyx6.registerExtenderCallbacks$2(C:\Users\arbaz\AppData\Roaming\BurpSuite\bapps\67f5c31f93d04ad3a3b0a1808b3648fa\ElasticBurp.py:64)
	at org.python.pycode._pyx6.call_function(C:\Users\arbaz\AppData\Roaming\BurpSuite\bapps\67f5c31f93d04ad3a3b0a1808b3648fa\ElasticBurp.py)
	at org.python.core.PyTableCode.call(PyTableCode.java:167)
	at org.python.core.PyBaseCode.call(PyBaseCode.java:307)
	at org.python.core.PyBaseCode.call(PyBaseCode.java:198)
	at org.python.core.PyFunction.__call__(PyFunction.java:482)
	at org.python.core.PyMethod.instancemethod___call__(PyMethod.java:237)
	at org.python.core.PyMethod.__call__(PyMethod.java:228)
	at org.python.core.PyMethod.__call__(PyMethod.java:218)
	at org.python.core.PyMethod.__call__(PyMethod.java:213)
	at org.python.core.PyObject._jcallexc(PyObject.java:3626)
	at org.python.core.PyObject._jcall(PyObject.java:3658)
	at org.python.proxies.__main__$BurpExtender$6.registerExtenderCallbacks(Unknown Source)
	at burp.b0h.run(Unknown Source)
	at java.lang.Thread.run(Thread.java:745)
Traceback (most recent call last):
  File "C:\Users\arbaz\AppData\Roaming\BurpSuite\bapps\67f5c31f93d04ad3a3b0a1808b3648fa\ElasticBurp.py", line 93, in applyConfigUI
    self.applyConfig()
  File "C:\Users\arbaz\AppData\Roaming\BurpSuite\bapps\67f5c31f93d04ad3a3b0a1808b3648fa\ElasticBurp.py", line 81, in applyConfig
    JOptionPane.showMessageDialog(self.panel, "<html><p style='width: 300px'>Error while initializing ElasticSearch: %s</p></html>" % (str(e)), "Error", JOptionPane.ERROR_MESSAGE)
  File "C:\jython2.7.0\Lib\site-packages\elasticsearch\exceptions.py", line 55, in __str__
    cause = ', %r' % self.info['error']['root_cause'][0]['reason']
  File "C:\jython2.7.0\Lib\site-packages\elasticsearch\exceptions.py", line 55, in __str__
    cause = ', %r' % self.info['error']['root_cause'][0]['reason']
TypeError: unicode indices must be integers
@honoki
Copy link

honoki commented Feb 25, 2019

Hey @arbazkiraak - I faced a similar error but could resolve it by updating the including elasticsearch modules:

cd C:\temp
git clone https://github.com/elastic/elasticsearch-py.git
git clone https://github.com/elastic/elasticsearch-dsl-py.git

Then copy/paste the folders C:\Temp\elasticsearch-py\elasticsearch and C:\Temp\elasticsearch-dsl-py\elasticsearch_dsl to C:\Users\<username>\AppData\Roaming\BurpSuite\bapps\67f5c31f93d04ad3a3b0a1808b3648fa\BappModules and overwrite the existing files.

Hope that helps!

@MrTuxracer
Copy link
Contributor

I've got the same error, but the proposed fix by @honoki did not work for me.

@MrTuxracer
Copy link
Contributor

Apparently upgrading both elasticsearch and elasticsearch-dsl to 6.0.0 does fix this issue.

thomaspatzke added a commit that referenced this issue Sep 18, 2019
Fix TypeError: unicode indices must be integers #12
@thomaspatzke
Copy link
Owner

Sorry for waiting so long and thank you @MrTuxracer for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants