Skip to content

txn_box plugin error in example #12335

Closed

Description

@anonymous-bugs

Does this txn_box example work?

txn_box:

  • when: upstream-rsp
    do:
    • with: [ upstream-rsp-status , proxy-req-path ]
      select:
      • as-tuple:
        • eq: 404
        • match: "example"
          do:
        • debug: "Resetting upstream response"
        • upstream-rsp-status: [ 200 , "OK" ]
        • upstream-rsp-field: "max-age=3600"

Error:
While parsing as-tuple comparison at Line 5.
While loading "with" directive at Line 3 in "select" at Line 5.
While parsing directive at Line 3.
While loading directives at Line 3.

When i also use

  • with: upstream-rsp-status
    select:
    • eq: 200

It gives error.

Activity

  1. anonymous-bugs commented on Jul 8, 2025

    @anonymous-bugs
    Author

    @cmcfarlen @brbzull0 can you look into this?. Im using trafficserver 10.2.0

  2. mlibbey commented on Jul 8, 2025

    @mlibbey
    Contributor

    I'm not really familiar with txn_box syntax, but think in header_rewrite that would be like

    cond %{READ_RESPONSE_HDR_HOOK} [AND]
        cond %{STATUS} =404
        set-header @newstatus "Resetting upstream response"
        set-status 200
    
  3. anonymous-bugs commented on Jul 9, 2025

    @anonymous-bugs
    Author

    @mlibbey Thanks for your response. I'm looking to build more complex examples, so was testing provided examples since my logic kept running into error. I dont know if etags can be compared during header_rewrite

  4. self-assigned this
    on Jul 14, 2025
  5. bneradt commented on Aug 21, 2026

    @bneradt
    Contributor

    I added a test that exercises the example txn_box code. It seems to work in the test. See #13581 . I'm going to close this issue. Please feel free to re-open if I'm missing something and there is something else to investigate.

  6. added a commit that references this issue on Sep 4, 2026
    38045e9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions