NPE when reset-cursor at a non-existent topic
See original GitHub issueDescribe the bug An NPE will appear when reset-cursor at a non-existent topic. In the old version, we are throw topic is not found error to the client, I think we should keep that behavior.
To Reproduce Steps to reproduce the behavior:
docker pull apachepulsar/pulsar-all:2.9.1
docker run --name pulsar -it apachepulsar/pulsar-all:2.9.1 bash
- enter the docker to start up pulsar standalone
- reset cursor :
bin/pulsar-admin topics reset-cursor non-existing -s sub
Expected behavior Get topic not found exception.
Desktop (please complete the following information):
- OS: [e.g. iOS]
Additional context Pulsar Version: 2.9.1
Broker error:
2021-12-29T07:53:29,951+0000 [metadata-store-19-1] WARN org.apache.pulsar.broker.admin.impl.PersistentTopicsBase - [null][persistent://public/default/non-existing] Failed to reset cursor on subscription sub to time 1640764318176
java.lang.NullPointerException: null
at org.apache.pulsar.broker.web.RestException.getExceptionData(RestException.java:44) ~[org.apache.pulsar-pulsar-broker-2.9.1.jar:2.9.1]
at org.apache.pulsar.broker.web.RestException.getResponse(RestException.java:81) ~[org.apache.pulsar-pulsar-broker-2.9.1.jar:2.9.1]
at org.apache.pulsar.broker.web.RestException.<init>(RestException.java:57) ~[org.apache.pulsar-pulsar-broker-2.9.1.jar:2.9.1]
at org.apache.pulsar.broker.admin.impl.PersistentTopicsBase.getTopicReference(PersistentTopicsBase.java:3613) ~[org.apache.pulsar-pulsar-broker-2.9.1.jar:2.9.1]
at org.apache.pulsar.broker.admin.impl.PersistentTopicsBase.internalResetCursorForNonPartitionedTopic(PersistentTopicsBase.java:1966) ~[org.apache.pulsar-pulsar-broker-2.9.1.jar:2.9.1]
at org.apache.pulsar.broker.admin.impl.PersistentTopicsBase.lambda$internalResetCursor$89(PersistentTopicsBase.java:1946) ~[org.apache.pulsar-pulsar-broker-2.9.1.jar:2.9.1]
at java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:714) ~[?:?]
at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506) ~[?:?]
at java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2073) ~[?:?]
at org.apache.pulsar.metadata.impl.ZKMetadataStore.lambda$null$7(ZKMetadataStore.java:158) ~[org.apache.pulsar-pulsar-metadata-2.9.1.jar:2.9.1]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [io.netty-netty-common-4.1.72.Final.jar:4.1.72.Final]
at java.lang.Thread.run(Thread.java:829) [?:?]
Client error:
root@a4b1093e63a4:/pulsar# bin/pulsar-admin topics reset-cursor non-existing -s sub --time 1m
HTTP 500 Internal Server Error
Reason: HTTP 500 Internal Server Error
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (10 by maintainers)
Top Results From Across the Web
Apache Pulsar 2.9.2
#14215; Fix NPE when reset-cursor at a non-existent topic (RestException without cause) #13573; Add transaction admin #13447; Print topic ...
Read more >JDK-7150089 [macosx] Default for a custom cursor ... - Bug ID
JDK-7150089 : [macosx] Default for a custom cursor created from non-existent image is not transparent. Type: Bug; Component: client-libs; Sub-Component: ...
Read more >java.lang.NullPointerException in java compute node
Hello, I have written a program to add two numbers using Java Compute Node but while executing it is throwing the Null pointer...
Read more >NPE while reading entries · Issue #8991 · apache/pulsar
The pipeline was that cursors are set to entry by the SeekByTime function, after that first message is consumed just to print it...
Read more >Jira's Workflow Integrity checker tool returns a 500 response
Resolution. There are two possible approaches to address this issue: Option 1. Run "Check Issue Relations" Integrity Check specifically (recommended).
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@zymap
Yes, i can do that.
i can work on it~