SchemaRegistryStoreException: Error while registering the schema in the backend Kafka store

3,268 views
Skip to first unread message

Hanna Lee

unread,
Aug 18, 2016, 4:37:15 AM8/18/16
to Confluent Platform
I'm new to confluent schema registry. 
I run the schema-registry and started kafka-console-avro-producer.
When I sent some avro message, SchemaRegistryStoreException occurred. (please check the attached log)
During running "curl -X PUT -i -H "Content-Type: application/vnd.schemaregistry.v1+json" --data '{"compatibility": "NONE"}'   http://localhost:8085/config" this command, exception also occurred.
For your information, I changed the schema registry port to 8085.
please check it.

<log message>
[2016-08-18 17:27:25,860] DEBUG Kafka producer started (org.apache.kafka.clients.producer.KafkaProducer:315)
{"id":1,"name":"name"}
[2016-08-18 17:27:38,251] DEBUG Sending POST with input {"schema":"{\"type\":\"record\",\"name\":\"record\",\"fields\":[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"name\",\"type\":\"string\"}]}"} to http://localhost:8085/subjects/conTest3-value/versions (io.confluent.kafka.schemaregistry.client.rest.RestService:116)
org.apache.kafka.common.errors.SerializationException: Error registering Avro schema: {"type":"record","name":"record","fields":[{"name":"id","type":"int"},{"name":"name","type":"string"}]}
Caused by: io.confluent.kafka.schemaregistry.client.rest.exceptions.RestClientException: Register schema operation failed while writing to the Kafka store io.confluent.kafka.schemaregistry.rest.exceptions.RestSchemaRegistryStoreException: Register schema operation failed while writing to the Kafka store
io.confluent.kafka.schemaregistry.rest.exceptions.RestSchemaRegistryStoreException: Register schema operation failed while writing to the Kafka store
        at io.confluent.kafka.schemaregistry.rest.exceptions.Errors.storeException(Errors.java:80)
        at io.confluent.kafka.schemaregistry.rest.resources.SubjectVersionsResource.register(SubjectVersionsResource.java:160)
        at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144)
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161)
        at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$VoidOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:143)
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99)
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347)
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)
        at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:308)
        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
        at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
        at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
        at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
        at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
        at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:291)
        at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1140)
        at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:403)
        at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:386)
        at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:334)
        at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:221)
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:808)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:587)
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:221)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
        at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
        at org.eclipse.jetty.server.handler.StatisticsHandler.handle(StatisticsHandler.java:159)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
        at org.eclipse.jetty.server.Server.handle(Server.java:499)
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
        at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
        at java.lang.Thread.run(Thread.java:745)
Caused by: io.confluent.kafka.schemaregistry.exceptions.SchemaRegistryStoreException: Error while registering the schema in the backend Kafka store
        at io.confluent.kafka.schemaregistry.storage.KafkaSchemaRegistry.register(KafkaSchemaRegistry.java:335)
        at io.confluent.kafka.schemaregistry.storage.KafkaSchemaRegistry.registerOrForward(KafkaSchemaRegistry.java:351)
        at io.confluent.kafka.schemaregistry.rest.resources.SubjectVersionsResource.register(SubjectVersionsResource.java:154)
        ... 43 more
Caused by: io.confluent.kafka.schemaregistry.storage.exceptions.StoreException: Failed to write Noop record to kafka store.
        at io.confluent.kafka.schemaregistry.storage.KafkaStore.getLatestOffset(KafkaStore.java:367)
        at io.confluent.kafka.schemaregistry.storage.KafkaStore.waitUntilKafkaReaderReachesLastOffset(KafkaStore.java:224)
        at io.confluent.kafka.schemaregistry.storage.KafkaSchemaRegistry.register(KafkaSchemaRegistry.java:283)
        ... 45 more
Caused by: java.util.concurrent.ExecutionException: org.apache.kafka.common.errors.TimeoutException: Failed to update metadata after 20 ms.
        at org.apache.kafka.clients.producer.KafkaProducer$FutureFailure.<init>(KafkaProducer.java:686)
        at org.apache.kafka.clients.producer.KafkaProducer.send(KafkaProducer.java:449)
        at org.apache.kafka.clients.producer.KafkaProducer.send(KafkaProducer.java:339)
        at io.confluent.kafka.schemaregistry.storage.KafkaStore.getLatestOffset(KafkaStore.java:362)
        ... 47 more
Caused by: org.apache.kafka.common.errors.TimeoutException: Failed to update metadata after 20 ms.
; error code: 50001; error code: 50001
        at io.confluent.kafka.schemaregistry.client.rest.RestService.sendHttpRequest(RestService.java:157)
        at io.confluent.kafka.schemaregistry.client.rest.RestService.httpRequest(RestService.java:174)
        at io.confluent.kafka.schemaregistry.client.rest.RestService.registerSchema(RestService.java:225)
        at io.confluent.kafka.schemaregistry.client.rest.RestService.registerSchema(RestService.java:217)
        at io.confluent.kafka.schemaregistry.client.rest.RestService.registerSchema(RestService.java:212)
        at io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient.registerAndGetId(CachedSchemaRegistryClient.java:57)
        at io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient.register(CachedSchemaRegistryClient.java:89)
        at io.confluent.kafka.serializers.AbstractKafkaAvroSerializer.serializeImpl(AbstractKafkaAvroSerializer.java:50)
        at io.confluent.kafka.formatter.AvroMessageReader.readMessage(AvroMessageReader.java:157)
        at kafka.tools.ConsoleProducer$.main(ConsoleProducer.scala:56)
        at kafka.tools.ConsoleProducer.main(ConsoleProducer.scala)



Hanna Lee

unread,
Aug 18, 2016, 4:56:57 AM8/18/16
to Confluent Platform
When I consumer the "_schemas" topic, there's null value.
"_schemas" is the schema registry topic on my local server.

I don't know why the value is inserted with "null".
when I run avro-console-producer to "test" topic, there's no error and run nomally.


[root@server002 bin]# ./kafka-console-consumer.sh --zookeeper localhost:2181 --topic _schemas --from-beginning
null
null
null
null
null
null
null
{"subject":"test-value","version":1,"id":1,"schema":"{\"type\":\"record\",\"name\":\"record\",\"fields\":[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"name\",\"type\":\"string\"}]}"}
{"subject":"connect-test-value","version":1,"id":2,"schema":"\"string\""}
{"subject":"connectTest-value","version":1,"id":2,"schema":"\"string\""}
null
{"compatibilityLevel":"NONE"}
{"subject":"test-value","version":2,"id":3,"schema":"{\"type\":\"record\",\"name\":\"myrecord1\",\"fields\":[{\"name\":\"f1\",\"type\":\"string\"}]}"}
{"compatibilityLevel":"NONE"}
{"subject":"test-value","version":3,"id":4,"schema":"{\"type\":\"record\",\"name\":\"myrecord\",\"fields\":[{\"name\":\"f1\",\"type\":\"string\"}]}"}
{"compatibilityLevel":"NONE"}
{"compatibilityLevel":"NONE"}
null
null
null
{"subject":"TOPIC1-value","version":1,"id":5,"schema":"{\"type\":\"record\",\"name\":\"User\",\"namespace\":\"com.datamountaineer.streamreactor.connect.hbase\",\"fields\":[{\"name\":\"firstName\",\"type\":\"string\"},{\"name\":\"lastName\",\"type\":\"string\"},{\"name\":\"age\",\"type\":\"int\"},{\"name\":\"salary\",\"type\":\"double\"}]}"}
null
null
null
null
null
null
null
Reply all
Reply to author
Forward
0 new messages