get error in Schema Registry Quickstart demo step to update global compatibility

1,051 views
Skip to first unread message

CL

unread,
Sep 23, 2015, 4:33:27 PM9/23/15
to Confluent Platform
Followed the steps in Confluent Quickstart and then went on to Schema Registry Quickstart

But in the second last demo step
# Update compatibility requirements globally
$ curl -X PUT -i -H "Content-Type: application/vnd.schemaregistry.v1+json" \
    --data '{"compatibility": "NONE"}' \
    http://localhost:8081/config
got following error. Seems unlikely that I have a local Mac setup issue since I was able to go through all the other earlier Schema Registry Quickstart demo steps ok, so not sure what's the problem...?

HTTP/1.1 500 Internal Server Error
Content-Length: 69
Content-Type: application/vnd.schemaregistry.v1+json
Server: Jetty(8.1.16.v20140903)

{"error_code":50001,"message":"Failed to update compatibility level"}


In earlier demo step, was able to do following ok
# Get top level config
$ curl -X GET -i -H "Content-Type: application/vnd.schemaregistry.v1+json" \
    http://localhost:8081/config
HTTP/1.1 200 OK
Content-Length: 33
Content-Type: application/vnd.schemaregistry.v1+json
Server: Jetty(8.1.16.v20140903)

{"compatibilityLevel":"BACKWARD"}



Geoff Anderson

unread,
Sep 24, 2015, 2:02:11 PM9/24/15
to confluent...@googlegroups.com
Hi CL,

So far I haven't been able to reproduce your error by running through the quickstart.

Are you seeing this error still? If so, it would be helpful to see log output from the schema registry.

Thanks,
Geoff

--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platf...@googlegroups.com.
To post to this group, send email to confluent...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/790f82d8-f5d1-4219-a495-1a4cd4c342ee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Geoff Anderson

unread,
Sep 24, 2015, 2:13:24 PM9/24/15
to confluent...@googlegroups.com
Hi CL,

One more note - under the hood, schema registry persists compatibility changes (as well as schemas) to a Kafka topic, "_schemas"; the error you're seeing is thrown when there is a problem producing to this kafka topic.

A couple things to try:

- can you verify the Kafka process is still up and running? 
- can you open a tcp connection to the kafka broker?
     telnet localhost 9092
- can you consume from the "_schemas" topic with console consumer?
     bin/kafka-console-consumer --topic _schemas --from-beginning --zookeeper localhost:2181

Thanks,
Geoff

CL

unread,
Sep 24, 2015, 3:46:22 PM9/24/15
to Confluent Platform
Good debugging ideas. I'm able to consume the Kafka topic "_schemas".
There are three schema values in that topic; the first was produced when I was following the Confluent Quickstart step 5; the other two are from when I was following the Schema Registry Quickstart.
But maybe there's some corrupt value in there...

$ ./bin/kafka-console-consumer --topic _schemas --from-beginning --zookeeper localhost:2181
null
null
{"subject":"testtopic-value","version":1,"id":1,"schema":"{\"type\":\"record\",\"name\":\"myrecord\",\"fields\":[{\"name\":\"f1\",\"type\":\"string\"}]}"}
null
null
{"subject":"Kafka-key","version":1,"id":21,"schema":"\"string\""}
{"subject":"Kafka-value","version":1,"id":21,"schema":"\"string\""}


-CL
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platform+unsub...@googlegroups.com.

Geoff Anderson

unread,
Sep 24, 2015, 4:00:14 PM9/24/15
to confluent...@googlegroups.com
Hi CL,
You might also try enabling debug mode in the schema registry:

open schema-registry.properties, set debug=true
restart schema registry process

You should see a stacktrace in the http response 

Thanks,
Geoff

To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platf...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platf...@googlegroups.com.

To post to this group, send email to confluent...@googlegroups.com.

CL

unread,
Sep 24, 2015, 5:33:24 PM9/24/15
to Confluent Platform
So, I'm now able to do the PUT to change the compatibility config in the last two demo steps in Schema Registry Quickstart... but am afraid can't really debug what happened the first time around.

I removed the log files in kafka-logs and zookeeper folders in my local /tmp/ directory, and restarted the zookeeper, kafka and schema registry servers all over, because I seemed to have caused a problem when I was trying to shut down the schema registry server after changing the debug setting.
Anyway, this time I did the first two demo steps in Server Registry first (to register the two schemas), then did the producer step 5 in Confluent Quickstart.
The PUT to change the global compatibility config and the subject config/Kafka-value, following the last two demo steps in Schema Registry Quickstart now seem to work as expected.

By the way, the REST path in the last demo step in Schema Registry Quickstart to change the compatibility of the Kafka-value subject is missing the <subject> value, so should be
and not just

Thanks for you help.

CL
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platform+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platform+unsub...@googlegroups.com.

To post to this group, send email to confluent...@googlegroups.com.

CL

unread,
Sep 25, 2015, 9:32:30 AM9/25/15
to Confluent Platform
In case it throws some light for someone, I notice that the content that was previously in my local /tmp/kafka-logs/_schemas-0/00000000000000000000.log file for the "bad" setup in which I got the 50001 error when trying to do the PUT to change the configuration has 2 lines
*Ó ¡ú {"magic":0,"keytype":"NOOP"}ˇˇˇˇ *Ó ¡ú {"magic":0,"keytype":"NOOP"}ˇˇˇˇ ÓÕµ
∑F{"subject":"testtopic-value","version":1,"magic":0,"keytype":"SCHEMA"}ö{"subject":"testtopic-value","version":1,"id":1,"schema":"{\"type\":\"record\",\"name\":\"myrecord\",\"fields\":[{\"name\":\"f1\",\"type\":\"string\"}]}"} *Ó ¡ú {"magic":0,"keytype":"NOOP"}ˇˇˇˇ *Ó ¡ú {"magic":0,"keytype":"NOOP"}ˇˇˇˇ èø·c$@{"subject":"Kafka-key","version":1,"magic":0,"keytype":"SCHEMA"}A{"subject":"Kafka-key","version":1,"id":21,"schema":"\"string\""} ì –(˝B{"subject":"Kafka-value","version":1,"magic":0,"keytype":"SCHEMA"}C{"subject":"Kafka-value","version":1,"id":21,"schema":"\"string\""}

while the current setup which allows me to do the PUT to change the configuration as expected has only 1 line in the 00000000000000000000.log file
*Ó ¡ú {"magic":0,"keytype":"NOOP"}ˇˇˇˇ *Ó ¡ú {"magic":0,"keytype":"NOOP"}ˇˇˇˇ ém~¸ê@{"subject":"Kafka-key","version":1,"magic":0,"keytype":"SCHEMA"}@{"subject":"Kafka-key","version":1,"id":1,"schema":"\"string\""} íÓz6hB{"subject":"Kafka-value","version":1,"magic":0,"keytype":"SCHEMA"}B{"subject":"Kafka-value","version":1,"id":1,"schema":"\"string\""} X™UK -{"subject":null,"magic":0,"keytype":"CONFIG"} {"compatibilityLevel":"NONE"} \qX-J-{"subject":null,"magic":0,"keytype":"CONFIG"}!{"compatibilityLevel":"BACKWARD"} ‰R¬¥JA{"subject":"test-value","version":1,"magic":0,"keytype":"SCHEMA"}ï{"subject":"test-value","version":1,"id":2,"schema":"{\"type\":\"record\",\"name\":\"myrecord\",\"fields\":[{\"name\":\"f1\",\"type\":\"string\"}]}"} X™UK -{"subject":null,"magic":0,"keytype":"CONFIG"} {"compatibilityLevel":"NONE"} \qX-J-{"subject":null,"magic":0,"keytype":"CONFIG"}!{"compatibilityLevel":"BACKWARD"} a¥U #6{"subject":"Kafka-value","magic":0,"keytype":"CONFIG"} {"compatibilityLevel":"FULL"}

(Notice that in the "bad" setup, I did the Confluent Quickstart demo steps first before the Schema Registry Quickstart, whereas in the second setup, I did the Schema Registry Quickstart before going back to the Confluent Quickstart just to try to keep the two setups to be somewhat similar. I can't be sure what I could have done in the first "bad" setup that might have caused the first line to be entered though had also been trying out the Quick Start from apache.kafka.org earlier.)

(For completeness, I'm also attaching the two log files so that you can see any whitespace characters.)

Thanks.
-CL
bad00000000000000000000.log
good00000000000000000000.log
Reply all
Reply to author
Forward
0 new messages