ydb-platform / ydb-java-sdk

YDB Java SDK
https://ydb.tech
Apache License 2.0
37 stars 21 forks source link

NPE in query.impl.TableClientImpl happens on query error #342

Closed zinal closed 3 weeks ago

zinal commented 3 weeks ago
java.util.concurrent.CompletionException: java.lang.NullPointerException: Cannot invoke "tech.ydb.proto.query.YdbQuery$TransactionMeta.getId()" because "meta" is null
    at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:332) ~[?:?]
    at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:347) ~[?:?]
    at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:636) ~[?:?]
    at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510) ~[?:?]
    at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2194) ~[?:?]
...
Caused by: java.lang.NullPointerException: Cannot invoke "tech.ydb.proto.query.YdbQuery$TransactionMeta.getId()" because "meta" is null
    at tech.ydb.query.impl.TableClientImpl$TableSession$1.handleTxMeta(TableClientImpl.java:163) ~[ydb-sdk-query-2.3.4.jar:?]
    at tech.ydb.query.impl.SessionImpl$StreamImpl.lambda$execute$0(SessionImpl.java:273) ~[ydb-sdk-query-2.3.4.jar:?]
    at tech.ydb.core.impl.call.ReadStreamCall.onMessage(ReadStreamCall.java:96) ~[ydb-sdk-core-2.3.4.jar:?]
    ... 7 more

This happens, for example, when SELECT completes with exception in the interactive transaction.