Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting java.nio.file.AccessDeniedException on kafka on Windows

I tried to setup kafka and zookeeper on windows. Initially I created topics, producers and consumers. It was working fine. Then I deleted one topic by using the below command:

kafka-run-class.bat kafka.admin.TopicCommand --delete --topic junk --zookeeper localhost:2181

Now every time I re-run the kafka, it gets terminated with the below error: java.nio.file.AccessDeniedException: C:\kafka_2.12-2.8.0\kafka_2.12-2.8.0kafka-logs\junk-0 -> C:\kafka_2.12-2.8.0\kafka_2.12-2.8.0kafka-logs\junk-0.305f67a1260f4cccb87d9367c6619fd2-delete

I tried to remove the zookeper and kafka directory and use a fresh directory for both. But somehow its retaining the previous saved topics and logs (I don't know what location they're stored at).

Could anyone tell me how to fix this?

like image 925
Ishan Pathak Avatar asked Jan 25 '23 09:01

Ishan Pathak


1 Answers

I also faced the same issue with new version kafka_2.12-3.0.0. Sorted out by using lower version kafka_2.12-2.8.1

like image 159
user17588888 Avatar answered Jan 29 '23 10:01

user17588888