Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Cannot create new stream & topic with Avro key (Schema for message keys on topic … does not exist in the Schema Registry) #7204

Open
rmoff opened this issue Mar 11, 2021 · 1 comment
Labels
awaiting-info bug round-robin streaming-engine Tickets owned by the ksqlDB Streaming Team

Comments

@rmoff
Copy link
Contributor

rmoff commented Mar 11, 2021

ksqlDB 0.15

Creating a new steam with new topic and Avro value works:

ksql> CREATE STREAM FOO (KEY_COL VARCHAR, COL1 INT, COL2 VARCHAR)
>  WITH (KAFKA_TOPIC='FOO', PARTITIONS=1, REPLICAS=1, VALUE_FORMAT='AVRO');

 Message
----------------
 Stream created
----------------

But if I try to use Avro for the key it fails

ksql> CREATE STREAM FOO2 (KEY_COL VARCHAR, COL1 INT, COL2 VARCHAR)
>  WITH (KAFKA_TOPIC='FOO2', PARTITIONS=1, REPLICAS=1, KEY_FORMAT='AVRO', VALUE_FORMAT='AVRO');
Schema for message keys on topic FOO2 does not exist in the Schema Registry.Subject: FOO2-key
Possible causes include:
- The topic itself does not exist       -> Use SHOW TOPICS; to check
- Messages on the topic are not serialized using a format Schema Registry supports      -> Use PRINT 'FOO2' FROM BEGINNING; to verify
- Messages on the topic have not been serialized using a Confluent Schema Registry supported serializer -> See https://docs.confluent.io/current/schema-registry/docs/serializer-formatter.html
- The schema is registered on a different instance of the Schema Registry       -> Use the REST API to list available subjects  https://docs.confluent.io/current/schema-registry/docs/api.html#get--subjects
- You do not have permissions to access the Schema Registry.Subject: FOO2-key   -> See https://docs.confluent.io/current/schema-registry/docs/security.html

ksql> CREATE STREAM FOO2 (KEY_COL VARCHAR, COL1 INT, COL2 VARCHAR)
>  WITH (KAFKA_TOPIC='FOO2', PARTITIONS=1, REPLICAS=1, FORMAT='AVRO');
Schema for message keys on topic FOO2 does not exist in the Schema Registry.Subject: FOO2-key
Possible causes include:
- The topic itself does not exist       -> Use SHOW TOPICS; to check
- Messages on the topic are not serialized using a format Schema Registry supports      -> Use PRINT 'FOO2' FROM BEGINNING; to verify
- Messages on the topic have not been serialized using a Confluent Schema Registry supported serializer -> See https://docs.confluent.io/current/schema-registry/docs/serializer-formatter.html
- The schema is registered on a different instance of the Schema Registry       -> Use the REST API to list available subjects  https://docs.confluent.io/current/schema-registry/docs/api.html#get--subjects
- You do not have permissions to access the Schema Registry.Subject: FOO2-key    -> See https://docs.confluent.io/current/schema-registry/docs/security.html
@agavra
Copy link
Contributor

agavra commented Mar 11, 2021

@rmoff the first one assumes a NONE key format because there are no key columns; AVRO doesn't support a key with no fields at the moment. I believe if you issued:

CREATE STREAM FOO2 (KEY_COL VARCHAR KEY, COL1 INT, COL2 VARCHAR)

It would work and create the schema for you.

@agavra agavra added round-robin streaming-engine Tickets owned by the ksqlDB Streaming Team labels Mar 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-info bug round-robin streaming-engine Tickets owned by the ksqlDB Streaming Team
Projects
None yet
Development

No branches or pull requests

3 participants