Skip to content

"json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)" when running example avro producer #490

Closed
@cowellrj

Description

@cowellrj

Description

Running MacOS, Python3.6.5
Installed packages with
pip install confluent-kafka
pip install confluent-kafka[avro]

run the example avro producer script from https://github.com/confluentinc/confluent-kafka-python/blob/master/README.md having edited for my broker, schema registry and topic name.

error stack is :
Traceback (most recent call last):
File "/Users/07HO38/Documents/Python/OEHCS/kafka_produce_avro.py", line 43, in
avroProducer.produce(topic='idcs-5bea815f69d54c6daa5701a57b5914fa-JDBCUSERS', value=value, key=key)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/confluent_kafka/avro/init.py", line 80, in produce
value = self._serializer.encode_record_with_schema(topic, value_schema, value)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/confluent_kafka/avro/serializer/message_serializer.py", line 98, in encode_record_with_schema
schema_id = self.registry_client.register(subject, schema)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/confluent_kafka/avro/cached_schema_registry_client.py", line 141, in register
result, code = self._send_request(url, method='POST', body=body)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/confluent_kafka/avro/cached_schema_registry_client.py", line 97, in _send_request
return response.json(), response.status_code
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/requests/models.py", line 892, in json
return complexjson.loads(self.text, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/init.py", line 354, in loads
return _default_decoder.decode(s)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

How to reproduce

As above

Checklist

Please provide the following information:

  • confluent-kafka-python and librdkafka version (confluent_kafka.version() and confluent_kafka.libversion()): 0.11.6', 722432 and ('0.11.6', 722687)
  • Apache Kafka broker version: 1.1.0.0.10
  • Client configuration: {...}
  • Operating system: Broker is on Oracle Enterprise Linux 6, Python on MacOS 10.13.6
  • Provide client logs (with 'debug': '..' as necessary)
  • Provide broker log excerpts
  • Critical issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions