RADIUS Persistence DataScript Failure on Avi Load Balancer
search cancel

RADIUS Persistence DataScript Failure on Avi Load Balancer

book

Article ID: 440123

calendar_today

Updated On:

Products

VMware Avi Load Balancer

Issue/Introduction

When using a Datascript for RADIUS persistence in Avi Load Balancer, the script may fail to execute. When this occurs, the request fails with the following virtual service log:

  • Request ended abnormally: Datascript failed to execute

The following stack trace can be observed under the "Datascript log" section of the virtual service log:

  • Datascript Log: vip_port=1812[string "xyz"]:14: bad argument #1 to 'len' (string expected, got nil)

Cause

This error occurs because the deployed RADIUS Datascript relies on specific attributes, namely calling_station_id and nas_ip, to perform persistence.

If these specific attributes (calling_station_id and/or nas_ip) are missing from the incoming RADIUS packets, the variables evaluate to nil.

When the script attempts to calculate the length (len) of these missing attributes, it triggers the bad argument #1 to 'len' (string expected, got nil) error and aborts execution.

Resolution

To resolve this issue, please use the updated DataScript which handles the scenarios where the required RADIUS attributes are missing from the payload.

Implementation Steps:

  1. Navigate to Templates > Scripts > DataScripts in your Avi Controller UI.
  2. Edit the failing RADIUS DataScript.
  3. Replace the existing code with the updated code provided in this KB.
  4. Save the configuration and verify that the errors no longer appear in the virtual service logs.