Search code examples
apache-kafkaavroapache-kafka-connectconfluent-schema-registry

Kafka connect S3 source failing with read-only registry


I am trying to read avro records stored in S3 in order to put them back in a kafka topic using the S3 source provided by confluent. I already have the topics and the registry setup with the right schemas but when the connect S3 source tries to serialize the my records to the topics I get this error

Caused by: org.apache.kafka.common.errors.SerializationException: Error registering Avro schema: ... at io.confluent.kafka.serializers.AbstractKafkaAvroSerializer.serializeImpl(AbstractKafkaAvroSerializer.java:121) at io.confluent.connect.avro.AvroConverter$Serializer.serialize(AvroConverter.java:143) at io.confluent.connect.avro.AvroConverter.fromConnectData(AvroConverter.java:84) ... 15 more Caused by: io.confluent.kafka.schemaregistry.client.rest.exceptions.RestClientException: Subject com-row-count-value is in read-only mode; error code: 42205 at io.confluent.kafka.schemaregistry.client.rest.RestService.sendHttpRequest(RestService.java:292) at io.confluent.kafka.schemaregistry.client.rest.RestService.httpRequest(RestService.java:352) at io.confluent.kafka.schemaregistry.client.rest.RestService.registerSchema(RestService.java:495) at io.confluent.kafka.schemaregistry.client.rest.RestService.registerSchema(RestService.java:486) at io.confluent.kafka.schemaregistry.client.rest.RestService.registerSchema(RestService.java:459) at io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient.registerAndGetId(CachedSchemaRegistryClient.java:214) at io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient.register(CachedSchemaRegistryClient.java:276) at io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient.register(CachedSchemaRegistryClient.java:252) at io.confluent.kafka.serializers.AbstractKafkaAvroSerializer.serializeImpl(AbstractKafkaAvroSerializer.java:75)

it seems that the connect producer does not try to get the schema_id if it exists but tries to write it but my registry is readonly. Anyone knows if this is an issue or there are some configuration I am missing ?


Solution

  • If you're sure the correct schema for that subject is already registered by some other means, you can try to set auto.register.schemas to false in the serializer configuration.

    See here for more details: https://docs.confluent.io/platform/current/schema-registry/serdes-develop/index.html#handling-differences-between-preregistered-and-client-derived-schemas