Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

IAC: gatewayURL with multiple paths

SA-22794

Summary



When the pega.web.config.gatewayURL is defined with multiple paths to the PRPCGateway Servlet the call to PRGatewayPing is incorrectly sent to PRPC. This causes excessive HTTP 303 looping within the PRPCGateway Servlet.

Example Setting:

pega.web.config.gatewayURL = "/path1/path2/PRPCGateway/";

or
pega.web.config.gatewayURL = "/path1/path2/path3/path4/PRPCGateway/";


Error Messages



The PRGateway error.jsp ends up displaying for the PRGatewayPing request. This is an AJAX request and is not visible to the user.

When you look at the PRGatewayLogfiles you will see many requests to for the PRGatewayPing being sent to PRPC and each time a 303 response. Each 303 response appends another pzPostData parameter.

This request should not be sent to PRPC when using the PRGateway. When PRPC gets this request it can't process the request causing it to return a HTTP 303 as seen with HttpAPI debug enabled:

2016-03-24 00:12:45,600 [fault (self-tuning)'] [ STANDARD] [] (ngineinterface.service.HttpAPI) WARN - Redirecting due to problematic context url
from: null
to: http://<pega_host>/path1/path2/prpcGateway/default/oO9O9iMscyJc_fy6LnBDXO9xEtRpDxfL3At36r8Aw8k%5B*/!STANDARD?pzPostData=-1570277542&pzPostData=875920915&pzPostData=1218920784


Steps to Reproduce



Internal Testing Setup using mod_proxy:

<Location /path1/path2>
ProxyPass http://<prpc_host>:8080/prgateway nocanon
ProxyPassReverse http://>prpc_host>:8080/prgateway
ProxyPassReverseCookiePath "/prgateway" "/path1/path2/PRPCGateway"
</Location>

Gadget Configuration:

<html>
<head>

<script>

pega.web.config.gatewayURL = "/path1/path2/PRPCGateway/";
pega.web.config.systemID = "default";
pega.web.config.appName = "SRWorkApp";
pega.web.config.thread = "STANDARD";
pega.web.config.encrypt= false;
</script>
<body>
<div id="TesMe"
style="overflow:auto"
PegaGadget="TestMe"
PegaResize="stretch"
PegaA="createNewWork"
PegaA_className="PegaSample-Task"
PegaA_flowName="BasicProcess"
PegaA_model=""
PegaDefer="false"
PegaE_onLoad = "pegaLoad"
PegaA_params="{UserIdentifier:'iac_user@pega.com'}">
</div>
<body>
</html>


Root Cause



The PegaInternetApplicationComposer.js  _pingGateway function is incorrectly reads multiple paths as part of a mulitenant URL and appending extra content to the URL. This extra content is causing the PRGateway application to forward the request to PRPC. 

Resolution



Add the following code to the top level application where the PRPC IAC DIV definition and PegaInternetApplicationComposer.js is included. 

pega.web.mgr._pingGateway = function() {
   try {
        var pingCallbackObj = {
            success: pega.web.mgr._pingGatewayCallback
            failure: pega.web.mgr._pingGatewayCallback
        };
        
        var pingUrl = "";
        if (pega.web.config.gatewayURL.indexOf("!") > -1 || pega.web.config.gatewayURL.indexOf("$") > -1) {
            pingUrl = pega.web.mgr._buildURLForPing(pega.web.config.gatewayURL);
        } else {
            if (pega.web.config.gatewayURL.substring(pega.web.config.gatewayURL.length - 1, pega.web.config.gatewayURL.length) == '/') {
                pingUrl = pega.web.config.gatewayURL.substring(0, pega.web.config.gatewayURL.length - 1);
            } else {
                        pingUrl = pega.web.config.gatewayURL.substring(0, pega.web.config.gatewayURL.length);
            }
        }

        pega.util.Connect.asyncRequest("Post", pingUrl, pingCallbackObj, "pyActivity=PRGatewayPing&dartmouth=true");
           pega.web.mgr._logMsg("info", "", "Manager", "Pinged gateway to find gateway session cookie");
    }
    catch(e) { }

}
 

 

Published May 1, 2016 - Updated October 8, 2020

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us