vmware / vmware/nsx-alb-datascript-samples-library

"avi.l4.send(payload2)" can not work. attempt to call field 'send' (a nil value)

Open
#19 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Lua
Stars
46
Forks
23
PR merge metrics
No merged PRs in 30d

Description

Describe the bug

The command "avi.l4.send(payload2)" does not work. The following error is output when the command is executed. And Reset is returned from ALB.

"attempt to call field 'send' (a nil value)"

Reproduction steps
1. Version v21.1.4
2. L4 Application VS. and L4 Response Event
3. Run the data script below.

-- L4 Response Event Script
function string.tohex(str)
    return (str:gsub('.', function (c)
        return string.format('%02X', string.byte(c))
    end))
end

buffered = avi.l4.collect(10)
payload = avi.l4.read()
if string.beginswith(payload , "354") then
   tag = "ClientIP: " ..  avi.vs.client_ip()
   hextag = string.tohex(tag)
   avi.l4.send(hextag)                   <<<----!!
   avi.l4.ds_done()
end
-----

...
Expected behavior

Payload data is correctly sent from ALB to server.

Additional context

Reference: https://avinetworks.com/docs/22.1/datascript-l4-ssl/

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the inline L4 Response Event script, especially the avi.l4.send(payload2) call, and compare it with the referenced L4 SSL DataScript documentation. Reproduce the nil-field error on v21.1.4 and verify the documented behavior against the expected result: the payload reaches the server without ALB returning Reset.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.