others-how to solve 'Internal error occurred: account is not active' when using kubesphere

1. Purpose

In this post, I would demo how to solve the below error when using kubesphere. After installation, when we try to log on the kubesphere admin console, we get this error:

Internal error occurred: account is not active

And the logs of the kubesphere controller manager:

E0401 15:26:25.330852       1 user_controller.go:332] Internal error occurred: failed calling webhook "validating-user.kubesphere.io": Post "https://ks-controller-manager.kubesphere-system.svc:443/validate-email-iam-kubesphere-io-v1alpha2-user?timeout=30s": x509: certificate relies on legacy Common Name field, use SANs or temporarily enable Common Name matching with GODEBUG=x509ignoreCN=0

E0401 15:26:25.330944       1 user_controller.go:226] error syncing 'admin': Internal error occurred: failed calling webhook "validating-user.kubesphere.io": Post "https://ks-controller-manager.kubesphere-system.svc:443/validate-email-iam-kubesphere-io-v1alpha2-user?timeout=30s": x509: certificate relies on legacy Common Name field, use SANs or temporarily enable Common Name matching with GODEBUG=x509ignoreCN=0, requeuing

2. Environment

  • Docker Version: 20.10.2
  • Kubernetes 1.19
  • Kubesphere 3.0

3. What is kubesphere?

KubeSphere is a distributed operating system managing cloud-native applications with Kubernetes as its kernel. It provides a plug-and-play architecture for the seamless integration of third-party applications to boost its ecosystem.

image-20210401202951530

4. The way we install kubesphere

Just execute the following scripts:

$ kubectl apply -f https://github.com/kubesphere/ks-installer/releases/download/v3.0.0/kubesphere-installer.yaml
   
$ kubectl apply -f https://github.com/kubesphere/ks-installer/releases/download/v3.0.0/cluster-configuration.yaml

Then we can see the log on page:

image-20210401164749137

5. How to solve this problem?

After goolging a lot , I found that this problem is caused by the incompatibility between k8s v1.19 and kubesphere v3. We should execute the following scripts to make it work:

$ kubectl apply -f https://raw.githubusercontent.com/kubesphere/ks-installer/2c4b479ec65110f7910f913734b3d069409d72a8/roles/ks-core/prepare/files/ks-init/users.iam.kubesphere.io.yaml

$ kubectl apply -f https://raw.githubusercontent.com/kubesphere/ks-installer/2c4b479ec65110f7910f913734b3d069409d72a8/roles/ks-core/prepare/files/ks-init/webhook-secret.yaml

$ kubectl -n kubesphere-system rollout restart deploy ks-controller-manager

Now it works!

6. Summary

In this post, I demonstrated how to solve the ‘account is not active’ problem when using kubesphere. Thanks for your reading.

-->