Forum Discussion
Sep 29, 2009
12031 error
Hello all,
I am getting a 12031 error on accessing static files on a proxy server that needs credentials. It's suppose to prompt the user for credentials, but it doesn't.
Link: http://www11.qad.com/Employee/Presentations/Sales%20Training%20Presentations/QAD2008_CoreEnhancemnts_internal.ppt
Please help!
Thank you in advance.
Regards,
TRX
15 Replies
- James_Quinby_46Historic F5 AccountAll I can see from the outside is a RST-ACK sent by (what I presume to be) your LTM. How is this configured? You'll need to post a bit more information.
If you dump packets on the server-side, can you see what happens during a client request? - Hello,
So after doing some testings, I found that security on the IIS level is causing the issue of the
URL breaking. Without the IRule enabled, you're supposed to get a prompt for credentials, but with
it enabled, you get an error page (Connection was reset) returned.
IRule URL: http://www11.qad.com/Employee/Presentations/Sales%20Training%20Presentations/QAD2008_CoreEnhancemnts_internal.ppt
Direct Proxy URL: http://exnt23.qad.com/Employee/Presentations/Sales%20Training%20Presentations/QAD2008_CoreEnhancemnts_internal.ppt
Here is the IRule that is enabled. Is there something wrong with it or it a setting on the F5 or Proxy that needs to be changed?
Request Method
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::path]] {
"/employee*" -
"/solutions guide*" -
"/static files*" -
"/vgn-ext-templating*" -
"/public*" -
"/erp/aboutQAD/careers " -
"/erp/aboutQAD/company " -
"/erp/aboutQAD/newsroom " -
"/erp/aboutQAD/newsroom/2004 " -
"/erp/aboutQAD/newsroom/2005 " -
"/erp/aboutQAD/newsroom/2006 " -
"/erp/aboutQAD/newsroom/2007 " -
"/erp/aboutQAD/newsroom/2008 " -
"/erp/aboutQAD/newsroom/2009 " -
"/erp/aboutQAD/partners " -
"/erp/customers/events" -
"/erp/industries/automotive" -
"/erp/industries/automotive/mmog-le" -
"/erp/resources/events" -
"/erp/resources/glossary" -
"/erp/resources/newsroom" -
"/erp/resources/newsroom/2004 " -
"/erp/resources/newsroom/2005 " -
"/erp/resources/newsroom/2006 " -
"/erp/resources/newsroom/2007 " -
"/erp/resources/newsroom/2008 " -
"/erp/resources/newsroom/2009 " -
"/erp/resources/partners" -
"/erp/resources/technology" -
"/erp/resources/technology/garbage" -
"/erp/resources/webinars" -
"/erp/services/education" -
"/erp/services/consulting" -
"/qadadvantage/qadadv-center" -
"/qadadvantage/qadadv-left" -
"/qadadvantage/qadadv-right" -
"/partnercenter/accreditation" -
"/partnercenter/certification" -
"/qad-explore/agenda*" -
"/qad-excellence/agenda*" -
"/documentlibrary/interoperability" -
"/documentlibrary/interoperability/qxtend" -
"/documentlibrary/manufacturing" -
"/documentlibrary/manufacturing/planner" {
return
}
}
if { ([HTTP::uri] contains "/solutioncenter") } {
set global variable flag for any old solutioncenter URL
set global_URL 1
HTTP::respond 301 Location [string map {"/solutioncenter" "/erp"} "[HTTP::uri]"]
return
} elseif { ([HTTP::uri] contains "+") or ([HTTP::uri] contains "action.process") or ([HTTP::host] equals "outside.qad.com") } {
return
} elseif { ([HTTP::uri] starts_with "/portal/site") } {
if { ([HTTP::uri] ends_with "/") or ([HTTP::uri] contains "menuitem.")} {
HTTP::respond 301 Location [string map {"/portal/site" "" } "[HTTP::uri]"]
}
else {
HTTP::respond 301 Location [string map {"/portal/site" "" } "[HTTP::uri]/"]
}
return
} elseif { ([HTTP::uri] equals "/") } {
HTTP::respond 301 Location "http://[HTTP::host]/erp/"
return
} elseif { ([HTTP::uri] starts_with "/qad-explore") or ([HTTP::uri] starts_with "/qad-excellence") or
([HTTP::uri] starts_with "/erp") or ([HTTP::uri] starts_with "/qadadvantage") or
([HTTP::uri] starts_with "/partnercenter") or ([HTTP::uri] starts_with "/documentlibrary") } {
HTTP::uri "/portal/site[HTTP::uri]"
return
}
}
when HTTP_RESPONSE {
if { ([HTTP::status] starts_with "3") } {
set newRedir [string map {"/portal/site" "" } [HTTP::header Location]]
HTTP::header replace Location $newRedir
return
} elseif { ([HTTP::status] starts_with "4") and ($global_URL == 1) } {
HTTP::respond 301 Location "http:[HTTP::host]/erp/"
return
}
}
Any help would appreciated.
Thank you.
Regards,
TRX - hoolio
Cirrostratus
You might try verifying first that the issue is with the iRule. If you remove the iRule from the VIP and make a request does the process work correctly?
If the issue is with the iRule, do you see any TCL errors in /var/log/ltm when it is enabled? If not, can you add logging to see when the issue occurs in the iRule?
Also, you're setting the path to lower case, but have several switch cases in mixed case. These will never be matched until they are also set to lower case.
Aaron - Thank you for your quick response.
Answers to your question:
1) When the IRule is disabled, the process does work and it does prompt for credentials on both IE and FF>
2) I will enable logging and get back to on when it happens.
3) In the switch case, they are ALL lower case, so I'm NOT sure what you mean that they are mixed. Can you please elaborate and point an example?
Thank you.
Regards,
TRX - hoolio
Cirrostratus
1. What auth method is the application using? Please do reply with details on the debug logging to see when the issue occurs.
2. Do you see any TCL errors in /var/log/ltm now without additional debug logging?
3. All of the paths with aboutQAD in them.
Aaron - Thank you again. Good catch.
The issue is now resolved.
1) Windows authenthication is what the application is using.
2) Logs NOT needed now since that issues fixed.
Resolution: Changed "elseif { ([HTTP::status] starts_with "4") and ($global_URL == 1) } {" to "elseif { ([HTTP::status] contains "404") and ($global_URL == 1) } {".
3) fixed. Thanks.
If you don't mind, may I ask another question in regards to global variables.
Here are the logs:
Wed Sep 30 09:50:34 PDT 2009 tmm tmm[1647] 01220001 TCL error: remove_portal_site_TRX HTTP_REQUEST - cant read global_URL: no such variable while executing if { $global_URL == 1 } { Do nothing } else { set global_URL 0 }
Wed Sep 30 09:50:43 PDT 2009 tmm tmm[1647] Rule remove_portal_site_TRX HTTP_REQUEST: ------initial request has /solutioncenter in URL.-----
Wed Sep 30 09:50:44 PDT 2009 tmm tmm[1647] Rule remove_portal_site_TRX HTTP_REQUEST: ------VCM FURL, action.process, or outside.qad.com.-----
Wed Sep 30 09:50:45 PDT 2009 tmm tmm[1647] Rule remove_portal_site_TRX HTTP_RESPONSE: 404 error re-direct to erp homepage from solutioncenter
Wed Sep 30 09:50:45 PDT 2009 tmm tmm[1647] Rule remove_portal_site_TRX HTTP_REQUEST: ------Add portal site in URL.-----
Wed Sep 30 09:50:46 PDT 2009 tmm tmm[1647] 01220001 TCL error: remove_portal_site_TRX HTTP_RESPONSE - cant read global_URL: no such variable while executing if { [HTTP::status] starts_with 3 } { set newRedir [string map {/portal/site } [HTTP::header Location]] HTTP::header replace Location $ne...
Wed Sep 30 09:50:46 PDT 2009 tmm tmm[1647] Rule remove_portal_site_TRX HTTP_RESPONSE: 301 re-direct Header
Question 1) Why is it trying to read $global_URL under the first if statement:
when HTTP_RESPONSE {
if { ([HTTP::status] starts_with "3") } {
set newRedir [string map {"/portal/site" "" } [HTTP::header Location]]
HTTP::header replace Location $newRedir
log local0. "301 re-direct Header: $newRedir"
return
}
Question 2) Why can't it understand $global_URL? I thought variables set in the request are all global?
elseif { ([HTTP::status] contains "404") and ($global_URL == 1) } {
HTTP::respond 301 Location "http:[HTTP::host]/erp/"
log local0. "404 error re-direct to erp homepage from solutioncenter"
return
}
}
Thank you.
Regards,
TRX - hoolio
Cirrostratus
Any variable set in RULE_INIT is global in scope. Any variable set with :: in the beginning of the name is also global regardless of which event it is set in. Global variables are accessible across all TCP connections. Variables set in any non-RULE_INIT event without :: in the front are local. Local variables are accessible across all events but only on that specific TCP connection.
If you set global_URI to 0 first it should fix that TCL error:set global_URL 0 if { ([HTTP::uri] contains "/solutioncenter") } { set global variable flag for any old solutioncenter URL set global_URL 1
Aaron - Yes I realized that earlier, but the real issue is this. When:
...............
set global_URL 0
if { ([HTTP::uri] contains "/solutioncenter") } {
set global variable flag for any old solutioncenter URL
set global_URL 1
HTTP::respond 301 Location [string map {"/solutioncenter" "/erp"} "[HTTP::uri]"]
return
} elseif { ([HTTP::uri] contains "+") or ([HTTP::uri] contains "action.process") or ([HTTP::host] equals "outside.qad.com") } {
return
........
In the first if statement, it will redirect and set "global_URL" to 1, but after it's redirected "global_URL" is set back to 0, when I really want it to be 1.
How can I overcome this issue?
Thank you.
Regards,
TRX - hoolio
Cirrostratus
I'm not sure I understand. You want global_URL to be set to 1 afterward for what? Subsequent requests on the same TCP connection or for some/all future TCP connections? Or something else?
Aaron
Sorry I should be been more specific. I want to keep the global_URL to be a 1 (the same) for all subsequent requests on the same TCP connection.
The logic is this (read comments):
set global_URL 0 set global variable to 0
if { ([HTTP::uri] contains "/solutioncenter") } {
set global variable flag for any old solutioncenter URL
set global_URL 1 if the initial request URI is an old URL then do a 301 re-direct to our new homepage URL which is "http://www.qad.com/erp/x+y ...."
HTTP::respond 301 Location [string map {"/solutioncenter" "/erp"} "[HTTP::uri]"]
return
} elseif { ([HTTP::uri] contains "+") or ([HTTP::uri] contains "action.process") or ([HTTP::host] equals "outside.qad.com") } { else URI contains a "+" characther then return
return
... when it is redirected in the 1st if statement to "http://www.qad.com/erp/x+y ...." then it will hit the second elseif
because of the "+" sign in the URI, but by now, the global_URL will be set to 0 due to the global variable set at the
begginging of HTTP_Request.
.. The reason why I want the global_URL to be 1 is because I do a check at the bottom of HTTP_RESPONSE. IF the global_URL is NOT 1, then it will never execute the else if.
when HTTP_RESPONSE {
if { ([HTTP::status] starts_with "3") } {
set newRedir [string map {"/portal/site" "" } [HTTP::header Location]]
HTTP::header replace Location $newRedir
log local0. "301 re-direct Header: $newRedir"
return
} elseif { ([HTTP::status] contains "404") and ($global_URL == 1) } {
HTTP::respond 301 Location "http:[HTTP::host]/erp/"
log local0. "404 error re-direct to erp homepage from solutioncenter"
return
}
}
I hope that clarified my issue.
Thank you.
Regards,
TRX
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects
