CSI Pods are in crashloopbackoff state error: "Cannot complete login due to an incorrect user name or password'
search cancel

CSI Pods are in crashloopbackoff state error: "Cannot complete login due to an incorrect user name or password'

book

Article ID: 438455

calendar_today

Updated On:

Products

VMware vSphere Kubernetes Service VMware vSphere ESXi

Issue/Introduction

  • Supervisor is stuck in error state from UI 
  • CSI-controller pods are in CrashLoopBackOff statue
  • From Supervisor, check the vsphere-csi-controller log:
    • Path: /var/log/pods/vmware-system-csi_vsphere-csi-controller-<ID>/vsphere-csi-controller/#.log            
      • failed to create govmomi client with err: ServerFaultCode: Cannot complete login due to an incorrect user name or password.
      • failed to connect to VirtualCenter host: \"vcsa-01.example.com\", Err: ServerFaultCode: Cannot complete login due to an incorrect user name or password.
  • From Supervisor, check vsphere-syncer log:
    • Path: /var/log/pods/vmware-system-csi_vsphere-csi-controller-<ID>/vsphere-syncer/#.log
      • failed to create govmomi client with err: ServerFaultCode: Cannot complete login due to an incorrect user name or password.
      • Cannot connect to vCenter with err: ServerFaultCode: Cannot complete login due to an incorrect user name or password.

Environment

VMware vSphere with Tanzu 8.x

Cause

The wcpsvc (Workload Control Plane) service on the vCenter is unable to rotate the cluster service account password because the Supervisor is not in a Ready state.

Resolution

This issue is fixed in vCenter Server 8.0U3h.

As  workaround, clear the existing password in the VCDB and restart the WCP service on VC; this triggers the automatic generation of a new password which synchronizes directly to the Kubernetes Secrets.

Workaround Steps: 

  1. Establish a SSH session to the vCenter VM


  2. Stop WCP service and confirm that it was stopped:
    service-control --stop wcp 
    service-control --status wcp

     

  3. Identify the Domain-ID details from the Kubernetes password python script:
    /usr/lib/vmware-wcp/decryptK8Pwd.py
    
    domain-c#:####-####


  4. Update the password section to an empty string '' using the below command:
    sudo -u wcp psql -U wcpuser -d VCDB -c "update cluster_db_configs SET storage_svcacct_pwd = '' where cluster='domain-c#:####-####';"

     

  5. Verify the password is now empty in the VCDB:

    sudo -u wcp psql -U wcpuser -d VCDB -c "select storage_svcacct_pwd from cluster_db_configs where cluster='domain-c#:#####-####';" 

     

  6. Start WCP service and check that it is running:
    service-control --start wcp 
    service-control --status wcp

     

  7. Re-ran the below command to check if the password section is updated with the newly generated password.
    sudo -u wcp psql -U wcpuser -d VCDB -c "select storage_svcacct_pwd from cluster_db_configs where cluster='domain-c#:#####-####';" 

     

  8. Connect to the Supervisor cluster context


  9. Check the password for the wcp-storage-user account using below command, this secret should contain the newly generated password after restarting WCP services on VC
    kubectl get secrets vsphere-config-secret -n vmware-system-csi -o jsonpath='{.data.vsphere-cloud-provider\.conf}' | base64 -d

     



  10. Password must be same on VCDB as well as on the Supervisor Secrets
    • Password from Step-8 should be same as Step-10


  11. Restart the CSI pods in the Supervisor to pick up the password update:
    kubectl rollout restart deployment -n vmware-system-csi

     

  12. Confirm that all CSI pods are up and running:
    kubectl get pods -n vmware-system-csi

Additional Information

CSI: Correct sync between CSI pod secret and workload_storage_management user password in vSphere with Tanzu