5

I am using kafka, zookeeper and kafka-manager for managing clusters.

I have 3 nodes cluster. In all the cluster I set since very beginning delete.topic.enable=true

Now when I want to delete a topic it is showing following error.

topicxyz - marked for deletion

but it is not deleted.

I tried to delete from kafka-manager also and it says

Yikes! KeeperErrorCode = NodeExists for /admin/delete_topics/topicxyz

Error logs:

kafka-manager:

[ESC[31merrorESC[0m] k.m.ApiError$ - error : KeeperErrorCode = NodeExists for /admin/delete_topics/topicxyz
org.apache.zookeeper.KeeperException$NodeExistsException: KeeperErrorCode = NodeExists for /admin/delete_topics/topicxyz
        at org.apache.zookeeper.KeeperException.create(KeeperException.java:119) ~[org.apache.zookeeper.zookeeper-3.4.6.jar:3.4.6-1569965]
        at org.apache.zookeeper.KeeperException.create(KeeperException.java:51) ~[org.apache.zookeeper.zookeeper-3.4.6.jar:3.4.6-1569965]
        at org.apache.zookeeper.ZooKeeper.create(ZooKeeper.java:783) ~[org.apache.zookeeper.zookeeper-3.4.6.jar:3.4.6-1569965]
        at org.apache.curator.framework.imps.CreateBuilderImpl$11.call(CreateBuilderImpl.java:721) ~[org.apache.curator.curator-framework-2.10.0.jar:na]
        at org.apache.curator.framework.imps.CreateBuilderImpl$11.call(CreateBuilderImpl.java:704) ~[org.apache.curator.curator-framework-2.10.0.jar:na]
        at org.apache.curator.RetryLoop.callWithRetry(RetryLoop.java:108) ~[org.apache.curator.curator-client-2.10.0.jar:na]
        at org.apache.curator.framework.imps.CreateBuilderImpl.pathInForeground(CreateBuilderImpl.java:701) ~[org.apache.curator.curator-framework-2.10.0.jar:na]
        at org.apache.curator.framework.imps.CreateBuilderImpl.protectedPathInForeground(CreateBuilderImpl.java:477) ~[org.apache.curator.curator-framework-2.10.0.jar:na]
        at org.apache.curator.framework.imps.CreateBuilderImpl.forPath(CreateBuilderImpl.java:467) ~[org.apache.curator.curator-framework-2.10.0.jar:na]
        at org.apache.curator.framework.imps.CreateBuilderImpl.forPath(CreateBuilderImpl.java:447) ~[org.apache.curator.curator-framework-2.10.0.jar:na]
[ESC[37minfoESC[0m] k.m.a.KafkaManagerActor - Updating internal state...

kafka has no error log. zookeeper stdout errorlog says only warning and stderr log says Invalid config, exiting abnormally

kafka-version: kafka_2.12-0.10.2.0

Topic description:

 $ bin/kafka-topics.sh --describe --zookeeper localhost:2181 --topic topicxyz
Topic:topicxyz  PartitionCount:1    ReplicationFactor:1 Configs:
    Topic: topicxyz Partition: 0    Leader: -1  Replicas: 3 Isr: 

Please help.

Avinash
  • 2,093
  • 4
  • 28
  • 41

2 Answers2

0

I am not sure which kafka version are you using. But deleting a topic had a bug previously. Refer here & here.

Jaya Ananthram
  • 3,433
  • 1
  • 22
  • 37
  • I am using kafka_2.12-0.10.2.0 – Avinash May 30 '17 at 00:34
  • Then definitely it must be a bug, Raise it in [jira](https://issues.apache.org/jira/browse/KAFKA-4162?jql=fixVersion%20%3D%200.10.0.2%20AND%20project%20%3D%20KAFKA) with logs and steps to reproduce. – Jaya Ananthram May 30 '17 at 05:18
0

This is sometimes caused by a corrupt ZooKeeper node found within /admin/delete_topics. Log into the ZK client and delete the misbehaving /admin/delete_topics/your_topic_name entry. Depending on client version it will go something like this:

bin/zkCli.sh -server 127.0.0.1:2181 ls /admin/delete_topics ls /brokers/topics rmr /admin/delete_topics/your_topic_name

You should now be able to use Kafka Manager or Kafka-topics to delete your topics. You can also manually remove your topic by deleting the "/brokers/topics/your_topic_name" entry but I find that is unnecessary after removing the misbehaving "delete_topics" entry.

JMess
  • 623
  • 9
  • 11