confluentinc / ksql

The database purpose-built for stream processing applications.
https://ksqldb.io
Other
87 stars 1.04k forks source link

"Received 500 response from server: No value present. Error code: 50000" when getting list of connectors #8379

Open Yevhen-Voroniuk opened 2 years ago

Yevhen-Voroniuk commented 2 years ago

Describe the bug In some rare cases when we call client.listConnectors() we get error: No value present. Error code: 50000.

To Reproduce The version of KSQL: docker image "confluentinc/ksqldb-server:0.21.0"

We create several connectors and after each quickly call: client.listConnectors() And sometimes this method returns error.

Expected behavior Should return list of connectors without an error

Actual behaviour Client error: KsqlClientException: Received 500 response from server: No value present. Error code: 50000 KSQL logs:

java.util.NoSuchElementException: No value present
    at java.base/java.util.Optional.get(Optional.java:148)
    at io.confluent.ksql.rest.server.execution.ListConnectorsExecutor.fromConnectorInfoResponse(ListConnectorsExecutor.java:111)
    at io.confluent.ksql.rest.server.execution.ListConnectorsExecutor.execute(ListConnectorsExecutor.java:72)
    at io.confluent.ksql.rest.server.execution.CustomExecutors.execute(CustomExecutors.java:124)
    at io.confluent.ksql.rest.server.execution.RequestHandler.executeStatement(RequestHandler.java:125)
    at io.confluent.ksql.rest.server.execution.RequestHandler.execute(RequestHandler.java:99)
    at io.confluent.ksql.rest.server.resources.KsqlResource.handleKsqlStatements(KsqlResource.java:304)
    at io.confluent.ksql.rest.server.KsqlServerEndpoints.lambda$executeKsqlRequest$2(KsqlServerEndpoints.java:204)
    at io.confluent.ksql.rest.server.KsqlServerEndpoints.lambda$executeOldApiEndpointOnWorker$23(KsqlServerEndpoints.java:358)
    at io.confluent.ksql.rest.server.KsqlServerEndpoints.lambda$executeOnWorker$22(KsqlServerEndpoints.java:344)
    at io.vertx.core.impl.ContextImpl.lambda$executeBlocking$2(ContextImpl.java:313)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.base/java.lang.Thread.run(Thread.java:829)

Workaround It's possible to retry operation from client. Usually second attempt is successful.

rochr01 commented 1 year ago

Got the same issue, but for me the error happens every single time. Also, tried to call Connect api directly and it seems it is a matter of case sensitive urls:

curl localhost:8083/connectors/JDBC_SOURCE/

works fine, but lowercase version:

curl localhost:8083/connectors/jdbc_source/

does not. In my KSQL command I used lowercase name.

Is there any known solution to this? Is this simply the case of incompatible libraries?

josephinekn commented 6 months ago

+1