# TCL Error possibly causing TCP Resets?

**URL:** <https://community.f5.com/t/tcl-error-possibly-causing-tcp-resets/76308>\
**Category:** Technical Forums\
**Tags:** event, application-delivery\
**Created:** [July 8, 2025, 9:02pm UTC](https://community.f5.com/t/tcl-error-possibly-causing-tcp-resets/76308 "2025-07-08T21:02:33Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![pcourtois](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/pcourtois/32/34551_2.png) [@pcourtois](https://community.f5.com/u/pcourtois)\
**Post date:** [July 8, 2025, 9:02pm UTC](https://community.f5.com/t/tcl-error-possibly-causing-tcp-resets/76308/1 "2025-07-08T21:02:33Z")

</div>

Good day all,

Thanks for taking the time to read and hopefully respond with helpful suggestions on my issue.&nbsp; We are experiencing random TCP Reset / Forcibly closed connection issues from Windows Web Application Servers to our iPaaS DB servers and we are investigating traffic routing and a few other options.&nbsp; I’ve also recently discovered these “TCL Errors…” in our logs.&nbsp; Internet search suggests that improper iRules with [LB::server pool] configuration&nbsp;_could_&nbsp;cause TCP Resets.

Based on the image of the logs below and the portion of irule that the logs reference, what is potentially incorrect with my code on lines 1 and 282?:

 ![image_342392.jpg](https://d20hrnpixdzcsd.cloudfront.net/original/3X/6/1/618c35afabf7bf48274afc078fd4f94741c1c54b.jpeg)

iRule Lines 1 - 52:

when HTTP\_REQUEST {

if { [HTTP::has\_responded] } { return };

# &nbsp;X-Forwarded header clean-up

if {[HTTP::header exists “X-Forwarded-Host”]}{

HTTP::header remove X-Forwarded-Host

}

if { [class match -- [string tolower [HTTP::header “User-Agent”]] contains “/Common/user\_agent\_blocklist”] } {

log local0. “User\_agent [HTTP::header “User-Agent”] is blocked. from: [IP::client\_addr]”

drop

}

if { [class match [string tolower [HTTP::host]] contains “/Common/user\_agent\_block\_list\_claudebot”] && [string tolower [HTTP::header “User-Agent”]] contains “claudebot” } {

log local0. “User\_agent [HTTP::header “User-Agent”] is blocked from: [IP::client\_addr] for domain [HTTP::host]”

drop

}

if { [HTTP::header “Referer”] contains “[https://darknet-markets-onion.com](https://darknet-markets-onion.com)”} {

log local0. “Referer [HTTP::header “Referer”] is blocked. from: [IP::client\_addr]”

reject

}

if { [string tolower [HTTP::path]] contains “\<redadcted\>” && (![class match [IP::client\_addr] equals “/Common/\<redacted\>”])} {

log local0. “TDINTERNALWEBAPI dropping traffic from [IP::client\_addr] to [HTTP::host][HTTP::uri]”

drop

}

elseif { [string tolower [HTTP::uri]] starts\_with “/\<redacted\>” || [string tolower [HTTP::uri]] starts\_with “/\<redacted\>” } {

if { !( [HTTP::header exists “X-Forwarded-Port”]) }{

HTTP::header insert X-Forwarded-Port [TCP::local\_port clientside]

}

pool \<pool\_name\>

if { [class match “enabled” equals \<redacted\>] } {

if { [string tolower [HTTP::uri]] starts\_with “/\<redacted\>” } {

HTTP::respond 503 content [ifile get \<redacted\>.json] “Content-Type” “application/json”

}

else {

HTTP::respond 503 content [ifile get \<redacted\>.html] Cache-Control “no-store, must-revalidate”

}

}

elseif { [active\_members [LB::server pool]] == 0 } {

if { [string tolower [HTTP::uri]] starts\_with “/\<redacted\>” } {

HTTP::respond 503 content [ifile get \<redacted\>.json] “Content-Type” “application/json”

}

else {

HTTP::respond 503 content [ifile get \<redacted\>.html] Cache-Control “no-store, must-revalidate”

}

}

}

iRule Lines 272 - 294:

else {

pool \<pool\>

if { [class match “enabled” equals \<redacted\>] } {

if { [string tolower [HTTP::uri]] starts\_with “/\<redacted\>” } {

HTTP::respond 503 content [ifile get \<redacted\>.json] “Content-Type” “application/json”

}

else {

HTTP::respond 503 content [ifile get \<redacted\>.html] Cache-Control “no-store, must-revalidate”

(line 282)}

}

elseif { [active\_members [LB::server pool]] == 0 } {

if { [string tolower [HTTP::uri]] starts\_with “/\<redacted\>” } {

HTTP::respond 503 content [ifile get \<redacted\>.json] “Content-Type” “application/json”

}

else {

HTTP::respond 503 content [ifile get \<redacted\>.html] Cache-Control “no-store, must-revalidate”

}

}

}

}

I sincerely appreciate your time and energy in this.&nbsp; Thanks.

- Paul C.

---

<div class="post-metadata">

**Author:** ![Injeyan\_Kostas](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/injeyan_kostas/32/263_2.png) [@Injeyan\_Kostas](https://community.f5.com/u/Injeyan_Kostas)\
**Post date:** [July 8, 2025, 10:30pm UTC](https://community.f5.com/t/tcl-error-possibly-causing-tcp-resets/76308/2 "2025-07-08T22:30:39Z")

</div>

Hello @pcourtois

As I see you are using [LB::server pool] under HTTP\_REQUEST

In this case [LB::server pool] returns default pool as no lb selection has been happened yet

So my question is do you have a default pool configured?

---

<div class="post-metadata">

**Author:** ![VishnuGatla](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/vishnugatla/32/10865_2.png) [@VishnuGatla](https://community.f5.com/u/VishnuGatla)\
**Post date:** [July 8, 2025, 11:47pm UTC](https://community.f5.com/t/tcl-error-possibly-causing-tcp-resets/76308/3 "2025-07-08T23:47:15Z")

</div>

Try this irule.

when HTTP\_REQUEST {

if { [HTTP::has\_responded] } { return }

# X-Forwarded header clean-up  
&nbsp; &nbsp; if { [HTTP::header exists “X-Forwarded-Host”] } {  
&nbsp; &nbsp; &nbsp; &nbsp; HTTP::header remove X-Forwarded-Host  
&nbsp; &nbsp; }

# Block specific user agents (blocklist)  
&nbsp; &nbsp; if { [class match -- [string tolower [HTTP::header “User-Agent”]] contains “/Common/user\_agent\_blocklist”] } {  
&nbsp; &nbsp; &nbsp; &nbsp; log local0. “User\_agent [HTTP::header “User-Agent”] is blocked. From: [IP::client\_addr]”  
&nbsp; &nbsp; &nbsp; &nbsp; drop  
&nbsp; &nbsp; &nbsp; &nbsp; return  
&nbsp; &nbsp; }

# Block Claudebot on specific domains  
&nbsp; &nbsp; if { [class match [string tolower [HTTP::host]] contains “/Common/user\_agent\_block\_list\_claudebot”] &&&nbsp;  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[string tolower [HTTP::header “User-Agent”]] contains “claudebot” } {  
&nbsp; &nbsp; &nbsp; &nbsp; log local0. “User\_agent [HTTP::header “User-Agent”] is blocked from: [IP::client\_addr] for domain [HTTP::host]”  
&nbsp; &nbsp; &nbsp; &nbsp; drop  
&nbsp; &nbsp; &nbsp; &nbsp; return  
&nbsp; &nbsp; }

# Block specific referer  
&nbsp; &nbsp; if { [HTTP::header “Referer”] contains “[https://darknet-markets-onion.com](https://darknet-markets-onion.com)” } {  
&nbsp; &nbsp; &nbsp; &nbsp; log local0. “Referer [HTTP::header “Referer”] is blocked. From: [IP::client\_addr]”  
&nbsp; &nbsp; &nbsp; &nbsp; reject  
&nbsp; &nbsp; &nbsp; &nbsp; return  
&nbsp; &nbsp; }

# Block or allow based on IP class and path  
&nbsp; &nbsp; if { [string tolower [HTTP::path]] contains “\<redacted\>” &&&nbsp;  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(![class match [IP::client\_addr] equals “/Common/\<redacted\>”]) } {  
&nbsp; &nbsp; &nbsp; &nbsp; log local0. “TDINTERNALWEBAPI dropping traffic from [IP::client\_addr] to [HTTP::host][HTTP::uri]”  
&nbsp; &nbsp; &nbsp; &nbsp; drop  
&nbsp; &nbsp; &nbsp; &nbsp; return  
&nbsp; &nbsp; }

# Condition for certain paths  
&nbsp; &nbsp; elseif { [string tolower [HTTP::uri]] starts\_with “/\<redacted\>” || [string tolower [HTTP::uri]] starts\_with “/\<redacted\>” } {

if { ![HTTP::header exists “X-Forwarded-Port”] } {  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; HTTP::header insert X-Forwarded-Port [TCP::local\_port clientside]  
&nbsp; &nbsp; &nbsp; &nbsp; }

# Pool assignment  
&nbsp; &nbsp; &nbsp; &nbsp; pool \<pool\_name\>

# Check feature flag or maintenance mode  
&nbsp; &nbsp; &nbsp; &nbsp; if { [class match “enabled” equals \<redacted\>] } {  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if { [string tolower [HTTP::uri]] starts\_with “/\<redacted\>” } {  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; HTTP::respond 503 content [ifile get \<redacted\>.json] “Content-Type” “application/json”  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } else {  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; HTTP::respond 503 content [ifile get \<redacted\>.html] “Cache-Control” “no-store, must-revalidate”  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }  
&nbsp; &nbsp; &nbsp; &nbsp; }  
&nbsp; &nbsp; &nbsp; &nbsp; elseif { [active\_members \<pool\_name\>] == 0 } {  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if { [string tolower [HTTP::uri]] starts\_with “/\<redacted\>” } {  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; HTTP::respond 503 content [ifile get \<redacted\>.json] “Content-Type” “application/json”  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } else {  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; HTTP::respond 503 content [ifile get \<redacted\>.html] “Cache-Control” “no-store, must-revalidate”  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }  
&nbsp; &nbsp; &nbsp; &nbsp; }  
&nbsp; &nbsp; }

# Default pool assignment  
&nbsp; &nbsp; else {  
&nbsp; &nbsp; &nbsp; &nbsp; pool \<pool\>

if { [class match “enabled” equals \<redacted\>] } {  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if { [string tolower [HTTP::uri]] starts\_with “/\<redacted\>” } {  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; HTTP::respond 503 content [ifile get \<redacted\>.json] “Content-Type” “application/json”  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } else {  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; HTTP::respond 503 content [ifile get \<redacted\>.html] “Cache-Control” “no-store, must-revalidate”  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }  
&nbsp; &nbsp; &nbsp; &nbsp; }  
&nbsp; &nbsp; &nbsp; &nbsp; elseif { [active\_members \<pool\>] == 0 } {  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if { [string tolower [HTTP::uri]] starts\_with “/\<redacted\>” } {  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; HTTP::respond 503 content [ifile get \<redacted\>.json] “Content-Type” “application/json”  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } else {  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; HTTP::respond 503 content [ifile get \<redacted\>.html] “Cache-Control” “no-store, must-revalidate”  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }  
&nbsp; &nbsp; &nbsp; &nbsp; }  
&nbsp; &nbsp; }  
}

---

<div class="post-metadata">

**Author:** ![pcourtois](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/pcourtois/32/34551_2.png) [@pcourtois](https://community.f5.com/u/pcourtois)\
**Post date:** [July 9, 2025, 2:53pm UTC](https://community.f5.com/t/tcl-error-possibly-causing-tcp-resets/76308/4 "2025-07-09T14:53:51Z")

</div>

Thanks for your response.&nbsp; No default pool is configured.

---

<div class="post-metadata">

**Author:** ![pcourtois](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/pcourtois/32/34551_2.png) [@pcourtois](https://community.f5.com/u/pcourtois)\
**Post date:** [July 9, 2025, 2:55pm UTC](https://community.f5.com/t/tcl-error-possibly-causing-tcp-resets/76308/5 "2025-07-09T14:55:46Z")

</div>

Thank you.&nbsp; I’ll give this a try and update the thread once tested/verified.&nbsp; Much appreciated.

---

<div class="post-metadata">

**Author:** ![Injeyan\_Kostas](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/injeyan_kostas/32/263_2.png) [@Injeyan\_Kostas](https://community.f5.com/u/Injeyan_Kostas)\
**Post date:** [July 9, 2025, 3:26pm UTC](https://community.f5.com/t/tcl-error-possibly-causing-tcp-resets/76308/6 "2025-07-09T15:26:14Z")

</div>

So then better look for specific pool active members&nbsp;  
like @VishnuGatla mentions below.

---

<div class="post-metadata">

**Author:** ![pcourtois](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/pcourtois/32/34551_2.png) [@pcourtois](https://community.f5.com/u/pcourtois)\
**Post date:** [July 21, 2025, 2:27pm UTC](https://community.f5.com/t/tcl-error-possibly-causing-tcp-resets/76308/7 "2025-07-21T14:27:01Z")

</div>

Good day all, thank you so much for the time and energy into this issue.&nbsp; The change was made and now we are no longer seeing the errors.&nbsp; I appreciate all the help.&nbsp; Be well.
