Reputation: 16555
[2023-05-30 14:11:39,104] INFO 10.237.87.231 - - [30/May/2023:14:11:39 +0000] "GET /subjects/MY_TOPIC-key/versions/latest HTTP/1.1" 404 68 "-" "Java/11.0.17" 2 (io.confluent.rest-utils.requests)
[2023-05-30 14:11:39,109] INFO Registering new schema: subject MY_TOPIC-key, version null, id null, type null, schema size 177 (io.confluent.kafka.schemaregistry.rest.resources.SubjectVersionsResource)
[2023-05-30 14:11:39,118] INFO 10.237.87.231 - - [30/May/2023:14:11:39 +0000] "POST /subjects/MY_TOPIC-key/versions?normalize=false HTTP/1.1" 200 11 "-" "Java/11.0.17" 10 (io.confluent.rest-utils.requests)
[2023-05-30 14:11:39,120] ERROR Request Failed with exception (io.confluent.rest.exceptions.DebuggableExceptionMapper)
io.confluent.rest.exceptions.RestNotFoundException: Subject 'MY_TOPIC-key' not found.
at io.confluent.kafka.schemaregistry.rest.exceptions.Errors.subjectNotFoundException(Errors.java:77)
at io.confluent.kafka.schemaregistry.rest.resources.SubjectVersionsResource.getSchemaByVersion(SubjectVersionsResource.java:141)
at jdk.internal.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
I want to register new schema using akhq GUI but I got error subject not found. I don't understand this error. Why subject should exist when I want to create new schema ?
UPDATE
I tried to create it with curl:
curl -X POST -H "Content-Type: application/vnd.schemaregistry.v1+json" -k --data @key http://my-custom-schemaregistry.org/subjects/MY_TOPIC-value/versions?normalize=false
it return id of schema 123 but when I tried to GET :
http://my-custom-schemaregistry.org/schemas/ids/123
I got:
{"error_code":40403,"message":"Schema 123 not found"}
UPDATE2
in logs I can see new schema:
[2023-05-30 21:37:26,752] INFO Registering new schema: subject TEST_TEMP, version null, id null, type null, schema size 756 (io.confluent.kafka.schemaregistry.rest.resources.SubjectVersionsResource)
[2023-05-30 21:37:26,765] INFO 10.237.87.231 - - [30/May/2023:21:37:26 +0000] "POST /subjects/TEST_TEMP/versions?normalize=false HTTP/1.1" 200 11 "-" "Java/11.0.17" 14 (io.confluent.rest-utils.requests)
[2023-05-30 21:37:26,766] ERROR Request Failed with exception (io.confluent.rest.exceptions.DebuggableExceptionMapper)
io.confluent.rest.exceptions.RestNotFoundException: Subject 'TEST_TEMP' not found.
Upvotes: 0
Views: 1732
Reputation: 191973
Why subject should exist when I want to create new schema
Because you are posting a new version to a subject, even if that is the first version.
You can see from "GET /subjects/MY_TOPIC-key/versions/latest HTTP/1.1" 404
that it has to first lookup the latest version before it can register, in order for the registry to perform backwards-compatibility checks
You should ignore these logs for the first registered version. You cannot disable them on the server.
Upvotes: 0