Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REST API exposes stack traces on error #5398

Closed
rspurgeon opened this issue May 18, 2020 · 0 comments · Fixed by #5478
Closed

REST API exposes stack traces on error #5398

rspurgeon opened this issue May 18, 2020 · 0 comments · Fixed by #5478
Assignees
Labels

Comments

@rspurgeon
Copy link

When POSTing invalid requests to the ksqlDB REST API server stack traces are presented to me in the response body.

Steps to reproduce the behavior, include:

  1. ksqlDB version hosted in Confluent Cloud as of 5/18/2020
  2. using curl, post an invalid request body, for example (notice a missing } bracket in the JSON body)
    "{"ksql": "CREATE STREAM pageviews WITH (kafka_topic='pageviews', value_format='AVRO');","streamsProperties": "ksql.streams.auto.offset.reset":"earliest","ksql.streams.cache.max.bytes.buffering":"0"}"

I'd expect to receive an error message, but not internal server stack traces.

Actual behaviour
I receive a stack trace similar to the following:

{"message": "Cannot construct instance of `java.util.LinkedHashMap` (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value ('ksql.streams.auto.offset.reset')\n at [Source: (org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream); line: 1, column: 110] (through reference chain: io.confluent.ksql.rest.entity.KsqlRequest[\"streamsProperties\"])",
  "stackTrace": [
    "com.fasterxml.jackson.databind.exc.MismatchedInputException.from(MismatchedInputException.java:63)",
    "com.fasterxml.jackson.databind.DeserializationContext.reportInputMismatch(DeserializationContext.java:1429)",
    "com.fasterxml.jackson.databind.DeserializationContext.handleMissingInstantiator(DeserializationContext.java:1059)",
    "com.fasterxml.jackson.databind.deser.ValueInstantiator._createFromStringFallbacks(ValueInstantiator.java:371)",
    "com.fasterxml.jackson.databind.deser.ValueInstantiator.createFromString(ValueInstantiator.java:258)",
    "com.fasterxml.jackson.databind.deser.std.MapDeserializer.deserialize(MapDeserializer.java:357)",
...
...
...
    "org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806)",
    "org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938)",
    "java.base/java.lang.Thread.run(Thread.java:834)"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants