function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SFDC-SDSFDC-SD 

Cyclical server-side forwards detected: Did anyone face this APEX/VF issue?

This is how I ended up with this issue

 

I am receiving IP Address in a URL.

In APEX controller, using pagereference get I extract the IPAddress from query string.

I am verifying this IP Address and passing it to Server from where request came from.

 

This is working all fine in developer edition, but when I tried to test the same in Sandbox using a URL, system threw a error and my page kept on reloading. Any help on this is appreciated.

 

Cyclical server-side forwards detected:

 

Cyclical server-side forwards detected: /apex/validateip?checkip=123.4.56.78&core.apexpages.devmode.url=1

 

 

Best Answer chosen by Admin (Salesforce Developers) 
SFDC-SDSFDC-SD

This is an issue with Salesforce API version 26(Winter 13).

 

Below is the workaround...

I have used a edited a Class that was using Salesforce API version 25 and copied my new code to it and deployed, it worked fine. If you directly create this class in version 26 it still fails.

 

I have logged a case on 10/05/2012 and I am still waiting for them to resolve.

All Answers

SammyComesHereSammyComesHere

Please post the code for understanding 

SFDC-SDSFDC-SD
public with sharing class IP_Authorization
{   
    private List<account> IPList;
    public List<account> CIDRList; 
    public Boolean ipFound = false;       
    private string Input_IP4{get; set;}

    public PageReference p = ApexPages.currentPage();
    public string IP_PatternV4='^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$';
    
//*************************************************************************************************************************//
//***********************************************  Main Method for IP Validation ******************************************//    
    public pagereference VerifyIP()
    {
        Input_IP4=System.currentPageReference().getParameters().get('checkip');                              
        Boolean isValidIP = Pattern.matches(IP_PatternV4,Input_IP4); 
                                 
        if (isValidIP)                 
        {   
            integer SearchIP=0;            
            SearchIP=[SELECT COUNT() FROM account WHERE 
                            Static_IP_Address__c=:Input_IP4                                                           
            if( SearchIP > 0 )
            {   
                ipFound= true;                                    
            }
            else 
            {                
                ipFound=false;   
            }
        }
                  
         if (ipFound) 
         {
             p.getHeaders().put('Found','200');
             ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.CONFIRM, '200'));             
         }
         else    
         {
             p.getHeaders().put('NotFound','404');
             ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, '404'));              
         }    
        return p;
    }
}

 I am receiving a IP from a client, salesforce has to verify if the IP is present in account and return back response 200 if IP

found.

 

Below is my visualforce page I created to test this from controller.

 

<apex:page Controller="IP_Authorization" tabStyle="account" action="{!VerifyIP}">
<apex:pageMessages id="error"/>
</apex:page>

 

 

 

SFDC-SDSFDC-SD

This is an issue with Salesforce API version 26(Winter 13).

 

Below is the workaround...

I have used a edited a Class that was using Salesforce API version 25 and copied my new code to it and deployed, it worked fine. If you directly create this class in version 26 it still fails.

 

I have logged a case on 10/05/2012 and I am still waiting for them to resolve.

This was selected as the best answer
Baird_SBaird_S

Thanks for the heads-up.  Also a problem in version 27.

 

I just created a VF page which renders as a pdf and got this error.  When I changed the VF page back to version 25, it rendered fine.

SFDC-SDSFDC-SD

 

Thanks.

Salesforce accepted that it was indeed a defect but I don't get it why they are not fixing it.

Naresh KaneriyaNaresh Kaneriya
Great !!
SFDC-SD