22

I wanted to bring up zookeeper using helm install ., but it says Error: release <servicename> failed: services "zookeeper" already exists. I don't see anything if I execute helm listtoo. Before installing the service, I checked using helm list if it already exists, and it doesn't.

How to check the reason for failure?

Community
  • 1
  • 1
Bitswazsky
  • 4,242
  • 3
  • 29
  • 58

4 Answers4

29

I think that the simplest solution is to add the --debug flag for the installation command:

helm install chart my-chart --debug

Or if you prefer:

helm  upgrade --install chart my-chart --debug

It displays all the resources which are created one by one and also related errors which occured during installation.

Rot-man
  • 18,045
  • 12
  • 118
  • 124
  • 1
    Well... I'm installing charts using terraform so everything could be done with just one command – holms Sep 07 '22 at 06:07
7

Do helm list --all - Helm List

Then if you have a conflicting release then probably need to delete the release again with the --purge flag

But it could possibly be that you have a Service object named zookeeper that isn't part of a helm release or that hasn't been cleaned up. You can check with kubectl get services (or add the --all-namespaces flag if it might be in a different namespace from your context). If so then you'll want to delete resources directly with kubectl delete

Abdullah Khawer
  • 4,461
  • 4
  • 29
  • 66
Ryan Dawson
  • 11,832
  • 5
  • 38
  • 61
  • While listing all releases, I could see all (except the current one) releases were marked `DELETED`. I purged that one, but didn't help. I checked the services too, didn't find any conflict. – Bitswazsky Oct 18 '18 at 12:02
  • Perhaps try purging even the deleted ones? – Ryan Dawson Oct 18 '18 at 12:28
5

Option 01

Access the ETCD for minikube , find and clean up the key.

Detailed procedure is here

commands:

https://gist.github.com/iahmad-khan/5d32b4070b6faf3836b932a7177095ff

Option 02 ( will lose the existing stuff )

Stop minikube

Remove the kube direcotry in user home ~/.minikube

Start a fresh minikube

Ijaz Ahmad
  • 11,198
  • 9
  • 53
  • 73
  • I deleted the zookeeper service using kubectl. removed the release from helm. Stopped minikube. Deleted the .kube folder. Brought up minikube. But unfortunately still seeing the same issue. I guess I'll try out on a different machine, and see. – Bitswazsky Oct 18 '18 at 12:55
  • answer updated , go to etcd and see where the key exist – Ijaz Ahmad Oct 18 '18 at 13:05
  • The second option is gaurreented to work , you may not have cleaned up the correct direcotry , it should be in the home of user , ~/.minikube . you need to delete that and start minikube again – Ijaz Ahmad Oct 18 '18 at 13:07
  • Unfortunately, deleting the ~/.minikube dir messed up my minikube setup. Now it won't start anymore. – Bitswazsky Oct 19 '18 at 09:31
  • i have been doing it everyday , and everytime , minikune setups things from scatch – Ijaz Ahmad Oct 19 '18 at 10:27
  • I use this command to install minikube `curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.30.0/minikube-linux-amd64 && chmod +x minikube && cp minikube /usr/local/bin/` Is there anything that I'm missing here? – Bitswazsky Oct 19 '18 at 14:45
  • it is not related to minkube installation , if you can run the minikube binary then it should be ok to delete the .minikube directory and start over , it will re-create it – Ijaz Ahmad Oct 19 '18 at 14:58
1

So, I finally got it working. Looks like there were some errors in my yaml file. But in this process I learnt how to properly cleanup a minikube instance. I executed the following commands to bring up a fresh minikube instance, in case anybody faces similar issue. This was done on CentOS 7. Thanks to @Ijaz for pointing me to the right direction.

minikube stop && minikube delete && rm -rf ~/.minikube && rm -rf ~/.kube
rm -rf /etc/kubernetes/
rm -rf /var/lib/minikube/certs/
minikube start --vm-driver=none
Bitswazsky
  • 4,242
  • 3
  • 29
  • 58