Skip to content
New issue

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

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

Already on GitHub? # to your account

TypeError: object of type 'NoneType' has no len() #1277

Closed
rbrunhuber opened this issue Oct 24, 2017 · 1 comment
Closed

TypeError: object of type 'NoneType' has no len() #1277

rbrunhuber opened this issue Oct 24, 2017 · 1 comment

Comments

@rbrunhuber
Copy link

rbrunhuber commented Oct 24, 2017

After "fixing" bug #1276 for me I hit another error:

Environment:
•Kafka 0.10.0.2.6
•Kerberos 5 version 1.12.2 (MS AD server)
•Python 3.6.1 |Anaconda 4.4.0 (64-bit)
•kafka-python (1.3.6.dev0)
•gssapi (1.2.2)

Traceback (most recent call last):
  File "/home/myname/workspace/python/kafkatest/kafkatest.py", line 20, in <module>
    ,auto_offset_reset='earliest'
  File "/opt/continuum/anaconda3/lib/python3.6/site-packages/kafka/consumer/group.py", line 327, in __init__
    self._client = KafkaClient(metrics=self._metrics, **self.config)
  File "/opt/continuum/anaconda3/lib/python3.6/site-packages/kafka/client_async.py", line 225, in __init__
    self._bootstrap(collect_hosts(self.config['bootstrap_servers']))
  File "/opt/continuum/anaconda3/lib/python3.6/site-packages/kafka/client_async.py", line 259, in _bootstrap
    bootstrap.connect()
  File "/opt/continuum/anaconda3/lib/python3.6/site-packages/kafka/conn.py", line 384, in connect
    if self._try_authenticate():
  File "/opt/continuum/anaconda3/lib/python3.6/site-packages/kafka/conn.py", line 468, in _try_authenticate
    raise ex  # pylint: disable-msg=raising-bad-type
  File "/opt/continuum/anaconda3/lib/python3.6/site-packages/kafka/conn.py", line 567, in _try_authenticate_gssapi
    size = Int32.encode(len(msg))
TypeError: object of type 'NoneType' has no len()

For me this was fixed according to the following diff (changing function _try_authenticate_gssapi in conn.py):

563a564,566
>                 if client_ctx.complete:
>                     break
>

I don't know why but it looks like our implementation of Kerberos/gssapi needs another call to client_ctx.step(received_token) before the context is complete although it returns "None".

@dpkp
Copy link
Owner

dpkp commented Oct 24, 2017

Thanks for bug report. Fix in PR #1280

@dpkp dpkp closed this as completed Oct 24, 2017
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants