pulsar-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [pulsar] pouledodue opened a new issue #5094: Improve response of REST API on AvroSchemaBasedCompatibilityCheck
Date Mon, 02 Sep 2019 18:07:43 GMT
pouledodue opened a new issue #5094: Improve response of REST API on AvroSchemaBasedCompatibilityCheck
URL: https://github.com/apache/pulsar/issues/5094
 
 
   
   posting non-compatible schema outputs a unuseful html page with 500 code.
   It should output maybe a 409 with the compatibility error shown in json output or something
beautifully helpful for a developer
   
   POST to 
   ```
   'http://localhost:8080/admin/v2/schemas/abc/def/x2/schema'
   ```
   Get response
   ```
   b'<html>\n<head>\n<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>\n<title>Error
500 Internal Server Error</title>\n</head>\n<body><h2>HTTP ERROR 500</h2>\n<p>Problem
accessing /admin/v2/schemas/abc/def/x2/schema. Reason:\n<pre>    Internal Server Error</pre></p><hr><a
href="http://eclipse.org/jetty">Powered by Jetty:// 9.4.12.v20180830</a><hr/>\n\n</body>\n</html>\n'
   ```
   Developer needs to read the logs to understand the error
   ```
   17:59:36.291 [ForkJoinPool.commonPool-worker-0] ERROR org.apache.pulsar.broker.service.schema.AvroSchemaBasedCompatibilityCheck
- Error during schema compatibility check: Unable to read schema:
   {
     "type" : "record",
     "name" : "XSchemaV0",
     "fields" : [ {
       "name" : "fur4",
       "type" : "string"
     } ]
   }
   using schema:
   {
     "type" : "record",
     "name" : "XSchemaV0",
     "fields" : [ {
       "name" : "fur2",
       "type" : "string"
     } ]
   }
   org.apache.avro.SchemaValidationException: Unable to read schema:
   {
     "type" : "record",
     "name" : "XSchemaV0",
     "fields" : [ {
       "name" : "fur4",
       "type" : "string"
     } ]
   }
   using schema:
   {
     "type" : "record",
     "name" : "XSchemaV0",
     "fields" : [ {
       "name" : "fur2",
       "type" : "string"
     } ]
   }
   	at org.apache.avro.ValidateMutualRead.canRead(ValidateMutualRead.java:70) ~[org.apache.avro-avro-1.8.2.jar:1.8.2]
   	at org.apache.avro.ValidateMutualRead.validate(ValidateMutualRead.java:43) ~[org.apache.avro-avro-1.8.2.jar:1.8.2]
   	at org.apache.avro.ValidateLatest.validate(ValidateLatest.java:51) ~[org.apache.avro-avro-1.8.2.jar:1.8.2]
   	at org.apache.pulsar.broker.service.schema.AvroSchemaBasedCompatibilityCheck.isCompatible(AvroSchemaBasedCompatibilityCheck.java:56)
~[org.apache.pulsar-pulsar-broker-2.4.0.jar:2.4.0]
   	at org.apache.pulsar.broker.service.schema.AvroSchemaCompatibilityCheck.isCompatible(AvroSchemaCompatibilityCheck.java:26)
~[org.apache.pulsar-pulsar-broker-2.4.0.jar:2.4.0]
   	at org.apache.pulsar.broker.service.schema.AvroSchemaBasedCompatibilityCheck.isCompatible(AvroSchemaBasedCompatibilityCheck.java:42)
~[org.apache.pulsar-pulsar-broker-2.4.0.jar:2.4.0]
   	at org.apache.pulsar.broker.service.schema.AvroSchemaCompatibilityCheck.isCompatible(AvroSchemaCompatibilityCheck.java:26)
~[org.apache.pulsar-pulsar-broker-2.4.0.jar:2.4.0]
   	at org.apache.pulsar.broker.service.schema.SchemaRegistryServiceImpl.isCompatible(SchemaRegistryServiceImpl.java:180)
~[org.apache.pulsar-pulsar-broker-2.4.0.jar:2.4.0]
   	at org.apache.pulsar.broker.service.schema.SchemaRegistryServiceImpl.lambda$checkCompatibilityWithLatest$8(SchemaRegistryServiceImpl.java:189)
~[org.apache.pulsar-pulsar-broker-2.4.0.jar:2.4.0]
   	at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:602) ~[?:1.8.0_212]
   	at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:577)
~[?:1.8.0_212]
   	at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:474) ~[?:1.8.0_212]
   	at java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:1962) ~[?:1.8.0_212]
   	at org.apache.pulsar.broker.service.schema.BookkeeperSchemaStorage.lambda$null$5(BookkeeperSchemaStorage.java:187)
~[org.apache.pulsar-pulsar-broker-2.4.0.jar:2.4.0]
   	at java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:822) [?:1.8.0_212]
   	at java.util.concurrent.CompletableFuture$UniHandle.tryFire(CompletableFuture.java:797)
[?:1.8.0_212]
   	at java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:443)
[?:1.8.0_212]
   	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) [?:1.8.0_212]
   	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) [?:1.8.0_212]
   	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) [?:1.8.0_212]
   	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157) [?:1.8.0_212]
   
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message