mrmannione
mrmannione

Reputation: 819

Confluent Schema registry failed failed POST request

My local dev Kafka schema registry was working and I was able to POST the schema from my producer and get an ID back. I use auto-register=false, same as my production server. But I made an update to the schema, I added a string.

+                    {
+                        "name":"testkey",
+                        "type":{
+                            "type":"string",
+                            "avro.java.string":"String"
+                        },
+                        "doc":"test test test",
+                        "default":""
                     }

and the POST failed with a 404

org.apache.kafka.common.errors.SerializationException: Error retrieving Avro schema: Caused by: io.confluent.kafka.schemaregistry.client.rest.exceptions.RestClientException: Schema not found; error code: 40403

I have no idea why, the schema in my local code is the same as the one I posted to the server.

This is how I posted the schema:

jq '. | {schema: tojson}' ./mySchema.avsc | curl -X POST http://localhost:8081/subjects/mySchema/versions -H "Content-Type:application/json" -d @-

Failure log: [2021-03-05 10:39:14,690] INFO 172.19.0.1 - - [05/Mar/2021:10:39:14 +0000] "POST /subjects/mySchema?deleted=false HTTP/1.1" 404 49 62 (io.confluent.rest-utils.requests)

I am using confluent v5.1.2

Hope you can help advise me.

Upvotes: 0

Views: 1588

Answers (1)

Archana
Archana

Reputation: 1

this is the command use to register a schema: jq '. | {schema: tojson}' ./mySchema.avsc | curl -X POST localhost:8081/subjects/mySchema/versions -H "Content-Type:application/json" -d @- – --> This command shared by mrmannione worked for me

Upvotes: 0

Related Questions