Aiven-Open / karapace

Karapace - Your Apache Kafka® essentials in one tool
https://karapace.io
Apache License 2.0
452 stars 68 forks source link

Error and connection reset by peer when trying to run against RedPanda #785

Open genzgd opened 8 months ago

genzgd commented 8 months ago

Running both redpanda and karapace (registry) in docker, I get this in the logs and the schema registry always returns "reset by peer":

023-12-27 11:06:34 karapace.schema_reader      schema-reader   ERROR           Unexpected exception when reading begin offsets.
2023-12-27 11:06:34 Traceback (most recent call last):
2023-12-27 11:06:34   File "/venv/lib/python3.10/site-packages/karapace/kafka/consumer.py", line 61, in get_watermark_offsets
2023-12-27 11:06:34     result = super().get_watermark_offsets(partition, cached=cached)
2023-12-27 11:06:34 cimpl.KafkaException: KafkaError{code=OFFSET_NOT_AVAILABLE,val=78,str="Failed to get watermark offsets: Broker: Leader high watermark is not caught up"}
2023-12-27 11:06:34 
2023-12-27 11:06:34 The above exception was the direct cause of the following exception:
2023-12-27 11:06:34 
2023-12-27 11:06:34 Traceback (most recent call last):
2023-12-27 11:06:34   File "/venv/lib/python3.10/site-packages/karapace/schema_reader.py", line 234, in _get_beginning_offset
2023-12-27 11:06:34     beginning_offset, _ = self.consumer.get_watermark_offsets(TopicPartition(self.config["topic_name"], 0))
2023-12-27 11:06:34   File "/venv/lib/python3.10/site-packages/karapace/kafka/consumer.py", line 68, in get_watermark_offsets
2023-12-27 11:06:34     raise_from_kafkaexception(exc)
2023-12-27 11:06:34   File "/venv/lib/python3.10/site-packages/karapace/kafka/common.py", line 62, in raise_from_kafkaexception
2023-12-27 11:06:34     raise translate_from_kafkaerror(exc.args[0]) from exc
2023-12-27 11:06:34 kafka.errors.UnknownError: [Error -1] UnknownError

Using the latest docker version, with the following environment variables:

        {"KARAPACE_ADVERTISED_HOSTNAME", "karapace-registry"},
        {"KARAPACE_ADVERTISED_PORT", "18881"},
        {"KARAPACE_BOOTSTRAP_URI", "redpanda-0:9092"},
        {"KARAPACE_PORT", "18881"},
        {"KARAPACE_REGISTRY_PORT", "18881"},
        {"KARAPACE_REST", "false"},
        {"KARAPACE_TOPIC_NAME", "_karapace_schemas"},

Trying to avoid running Kafka, Zookeeper, or Confluent Schema registry for tests, and RedPanda schema registry doesn't support JSON.

aiven-anton commented 8 months ago

Support for Red Panda is not something we have on the roadmap for Karapace, but given the compatibility claims it seems strange it would behave the way you're experiencing. Perhaps Red Panda only implements newer versions of some Kafka Protocol APIs?

I suggest we leave this issue open as a placeholder/feature request for community efforts to implement support for Red Panda.