AKO pod in crashbackloop state due to user account being locked out - VMware Avi Load Balancer
search cancel

AKO pod in crashbackloop state due to user account being locked out - VMware Avi Load Balancer

book

Article ID: 438750

calendar_today

Updated On:

Products

VCF Automation VMware Avi Load Balancer VMware vSphere ESXi

Issue/Introduction

  • When creating an Application Service on VCF-A, Layer 7 (L7) Virtual Service creation fails on the Avi Load Balancer.
  • The Avi Kubernetes Operator (AKO) enters a crash-loop state due to an account lockout caused by invalid or expired credentials.
  • Upgrading from VCF 9.0.x or 9.1.0 to 9.1.1 may cause NSX-ALB Account Lockout issue.

Environment

  • VCF 9.x
  • VMware Avi Load Balancer

 

Cause

  • The nsxt-alb account becomes locked on the Avi Load Balancer after upgrading VCF from 9.0.x or 9.1.0 to 9.1.1.
  • The NSX Manager logs (specifically /var/log/proton/nsxapi.log) show repeated HTTP 401 {"error":"Invalid credentials"} failures when attempting to authenticate to the Avi Load Balancer controller.
  • Shortly after the 401 errors, both the NSX Manager logs and the Avi access logs show HTTP 423 {"error":"Account locked! Try again in 14 minute(s) and 30 second(s)."} as the Avi brute-force lockout policy is triggered.
  • The NSX Manager logs might display warnings stating "No certificate found in database for alias". This certificate warning is a secondary symptom (noise) and not the root cause of the authentication failure.
  • This issue is caused by a timing gap in the token refresh cron jobs between the older VCF versions and 9.1.1.
  • VCF 9.0.x and 9.1.0 issue an authentication token with a 6-hour lifetime, refreshed every 5 hours via cron.
  • VCF 9.1.1 shifts to a 30-day token lifetime, refreshed only once a day via cron.
  • If the NSX Manager restart during the in-place upgrade lands in the gap between the old cron's cadence ending and the new cron's first scheduled run, the last 9.0.2-issued 6-hour token expires with nothing queued to replace it — creating a window where NSX has no valid credential.
  • During this gap, every NSX subsystem still holding the expired token (gRPC/Intelligence streaming service, Policy-layer scheduler, etc.) independently and repeatedly retries authentication to Avi, immediately tripping the Avi brute-force account-lockout policy for nsxt-alb.
  • Once locked, NSX's continuous retries (every 10–30s) are each counted by Avi as a fresh failed attempt, which keeps resetting the lockout countdown — so the lockout does not self-clear even after NSX's daily cron eventually reissues a valid 30-day token.
  • Hence, the creation of Virtual Service and ingress on Avi Load Balancer fails as AKO repeatedly attempts to authenticate against Avi using invalid or expired credentials, triggering an account lockout on the Avi controller.

Resolution

There is currently no resolution available for VCF 9.x. VMware is aware of the behavior and plans to address it in a future software update.

Workaround:

  1. Enable HTTP Basic Authentication on Avi Load Balancer Controller

    Controller UI > Administration > System Settings > Edit > Check Mark - Allow Basic Authentication



    Note: If Allow Basic Authentication is not enabled, you may see the Error:  {"error":"Authentication credentials were not provided."} when executing the API below

    Please Refer - Enable "Allow Basic Authentication" using CLI / API 

  2. Generate a new token: Send a POST request to https://<AVI-IP>/api/authtoken. In the request body, include the username associated with your Enforcement Point and set the hours to 720.
    Sample request snippet: 

    curl -k -X POST "https://<AVI_CONTROLLER_IP>/api/authtoken" \
        -H "Content-Type: application/json" \
        -u "admin:<ADMIN_PASSWORD>" \
        -d '{"username": "admin", "hours": "720"}'
  3. Capture the credentials: From the Avi API response, copy the generated token string (this will act as your new password). Note the expires_at value, as you will need it to update the connection metadata.

    Sample response for the above POST request

    {
        "token": "{NEW_TOKEN_STRING}",
        "expires_at": "YYYY-MM-DDTHH:MM:SS.000000Z",
        "uuid": "####",
        "single_use": false
    }

    Save the token value for the PATCH request described in Step 2. Optionally, save the expires_at value to populate the connection_info.expires_at field in the PATCH body.

  4. Retrieve the current configuration: Send a GET request to /policy/api/v1/infra/sites/default/enforcement-points/alb-endpoint. Record the _revision number and the existing connection_info block from the response payload.

    curl -k -u 'admin' \
    --location --request GET \
    'https://<nsx_mgr_ip>/policy/api/v1/infra/sites/default/enforcement-points/alb-endpoint'
  5. Update the Enforcement Point: Send a PATCH request to the same NSX Policy URL used in step 3. In the payload, include the recorded _revision number, set connection_info.password to the new token string, and update the expires_at field.

    curl -k -X PATCH "https://<nsx_mgr_ip>/policy/api/v1/infra/sites/default/enforcement-points/alb-endpoint" \
        -H "Content-Type: application/json" \
        -u "admin" \
        -d '{
          "_revision": <Incremented-number-from-previous-response>,
          "connection_info": {
            "resource_type": "AviConnectionInfo",
            "enforcement_point_address": "<AVI_IP_OR_VIP>",
            "username": "admin",
            "password": "${NEW_TOKEN_STRING}",
            "expires_at": "${EXPIRES_AT}",
            "tenant": "admin"
          }
        }'

    Note: Update the _revision field by incrementing the value retrieved from the Step 4 GET response by +1. Additionally, replace enforcement_point_address and all other mandatory fields with the exact values from that same response.

  6. Confirm the fix: Send a final GET request to the Enforcement Point. Verify that the _revision number has incremented, the user lockout is cleared from Avi Load Balancer Events, and the ALB integration workflow is functioning properly without crashing.

  7. Restart Pod: After the authentication token is refreshed, we should restart the NCP and AKO pods.

    kubectl delete pod `kubectl get pod -n vmware-system-nsx | grep ncp | awk '{print $1}'` -n vmware-system-nsx
    kubectl delete pod `kubectl get pod -n avi-system | grep ako | awk '{print $1}'` -n avi-system

    Once the account is successfully unlocked via this profile change and endpoint updated, the new daily cron job will issue a valid 30-day token, and normal operations will resume and Avi Load Balancer Event stop getting event for Invalid Credential - NSXT-ALB user account lockout

Additional Information

  1. Caveat: If a password policy is applied via VCF Operations (Ops), the No-Lockout-User-Account-Profile cannot be assigned on Avi while that policy is active. The Ops-applied password policy must be reverted first for the lockout-profile change to take effect on Avi.
  2. TechDoc - Avi Account Lockout and AKO Failures
  3. TechDoc- NSX User Account Lockout Policy