question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NPE when reset-cursor at a non-existent topic

See original GitHub issue

Describe 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:

  1. docker pull apachepulsar/pulsar-all:2.9.1
  2. docker run --name pulsar -it apachepulsar/pulsar-all:2.9.1 bash
  3. enter the docker to start up pulsar standalone
  4. 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:closed
  • Created 2 years ago
  • Comments:11 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
mattisonchaocommented, Dec 31, 2021

@zymap

Yes, i can do that.

1reaction
mattisonchaocommented, Dec 29, 2021

i can work on it~

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found