You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/celery/app/trace.py", line 374, in trace_task
R = retval = fun(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/celery/app/trace.py", line 629, in protected_call
return self.run(*args, **kwargs)
File "/code/KafkaProducer/xyz.py", line 35, in xyz
record_metadata = future.get(timeout=10)
File "/usr/local/lib/python3.6/site-packages/kafka/producer/future.py", line 63, in get
raise self.exception # pylint: disable-msg=raising-bad-type
File "/usr/local/lib/python3.6/site-packages/kafka/producer/kafka.py", line 513, in send
key_bytes, value_bytes)
File "/usr/local/lib/python3.6/site-packages/kafka/producer/kafka.py", line 655, in _partition
available)
File "/usr/local/lib/python3.6/site-packages/kafka/partitioner/default.py", line 29, in call
idx = murmur2(key)
File "/usr/local/lib/python3.6/site-packages/kafka/partitioner/hashed.py", line 82, in murmur2
((data[i4 + 2] & 0xff) << 16) +
TypeError: unsupported operand type(s) for &: 'str' and 'int'
The text was updated successfully, but these errors were encountered:
The underlying issue here is that you are trying to send data that has not been encoded to bytes. We could definitely make the error handling better here. In the meantime, please verify that your code is sending bytes not strings (or that you are using key and/or value encoders).
dpkp
changed the title
python-3.6.2 + kafka-python==1.3.5
Confusing error when attempting to send non-bytes with python3
Dec 26, 2017
dpkp
changed the title
Confusing error when attempting to send non-bytes with python3
Confusing error in python3 when producer message key/value is not encoded as bytes
Dec 26, 2017
Python 3 will not automatically cast objects.
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/celery/app/trace.py", line 374, in trace_task
R = retval = fun(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/celery/app/trace.py", line 629, in protected_call
return self.run(*args, **kwargs)
File "/code/KafkaProducer/xyz.py", line 35, in xyz
record_metadata = future.get(timeout=10)
File "/usr/local/lib/python3.6/site-packages/kafka/producer/future.py", line 63, in get
raise self.exception # pylint: disable-msg=raising-bad-type
File "/usr/local/lib/python3.6/site-packages/kafka/producer/kafka.py", line 513, in send
key_bytes, value_bytes)
File "/usr/local/lib/python3.6/site-packages/kafka/producer/kafka.py", line 655, in _partition
available)
File "/usr/local/lib/python3.6/site-packages/kafka/partitioner/default.py", line 29, in call
idx = murmur2(key)
File "/usr/local/lib/python3.6/site-packages/kafka/partitioner/hashed.py", line 82, in murmur2
((data[i4 + 2] & 0xff) << 16) +
TypeError: unsupported operand type(s) for &: 'str' and 'int'
The text was updated successfully, but these errors were encountered: