Forum Discussion

jma_44485's avatar
jma_44485
Icon for Nimbostratus rankNimbostratus
Oct 28, 2009

DotNet Exception after applying cookie persistence

I applied cookie Insert persistence profile to a virtual server.

 

I also applied following Irule to that virtual server.

 

A couple of DotNet application give warning message "Object reference not set to an instance of an object" in Event Viewer.

 

I have two Win2003 web servers in the one pool.

 

 

when HTTP_REQUEST {

 

if { [HTTP::cookie exists "cookie"]}{

 

HTTP::cookie decrypt "cookie" "keykey"

 

set serverid [lindex [HTTP::cookie cookie] 1]

 

use pool hardcode_pool member $serverid

 

}

 

else {

 

use pool hardcode_pool

 

}

 

}

 

when HTTP_RESPONSE {

 

HTTP::cookie insert name "cookie" value [concat [LB::server]]

 

HTTP::cookie encrypt "cookie" "keykey"

 

}

 

 

Anybody've seen that exception "Object reference not set to an instance of an object"?

 

Thanks
  • hoolio's avatar
    hoolio
    Icon for Cirrostratus rankCirrostratus
    If you take the iRule off and disable all but one pool member do you see the error? This would eliminate persistence and iRule issues as the cause of the error. Also, do you have any idea what the application layer error indicates in terms of the load balancing?

     

     

    Aaron
  • Thanks for reply. I have taken out the Irule. I can also disable one node in the pool. I think they use session variable in the applications.

     

    Do you think I need to set up state server if I have already used cookie insert persistence on Load Balancer?

     

     

    Thanks
  • hoolio's avatar
    hoolio
    Icon for Cirrostratus rankCirrostratus
    Does the error occur when you have the iRule removed and all but one pool member disabled? Do you have any idea what the application layer error indicates in terms of the load balancing?

     

     

    Aaron
  • hoolio's avatar
    hoolio
    Icon for Cirrostratus rankCirrostratus
    Also, this portion of your iRule doesn't look correct:

     

     

    [concat [LB::server]]

     

     

    The concat command (Click here) is normally used to concatenate strings or TCL lists. Running concat with a single argument will just return the value of that argument.

     

     

    I don't think this has anything to do with the issue you're describing, but it would still make sense to correct this.

     

     

    Aaron
  • Thanks for the advice. The Irule has been taken out, but I still use two nodes in the pool. Except one dotnet app, all the other web app works fine so far. I have been doing some research about session maintenance and machine key in web farm senario.

     

    It is very interesting that some of my web apps do not have machine key specified in web.config file, but they works fine with BigIP load balancer. I guess the cookie persistence profile makes sure the http requests are always directed to the server where it initially hits. Do you have advice about the web servers artitechture if we need to bring up State Server or SQL session server for DotNet app with BigIP load balancer?

     

     

    Thanks
  • Hi,

     

    I think I find out something. we have two web servers A and B. I can see that the http request from the user was directed to A first, say 08:10:15am. After 2 seconds, 08:10:17am, the user was directed to server B and finish the job on server B. The error with the application came out at 08:10:15am. I have round robin policy assigned to the pool that contains A and B. Server A and B have the same priority. I thought the cookie persistence profile is supposed to have sticky connection. Once the http request hits the server, it always stays on the same server until session expires. Have anyone seen this problem before?

     

     

    I want to write an Irule and hard code the http host to a node to see if that can get rid of the error message in event viewer. Any suggestions?

     

     

    Many Thanks
  • The error with the application came out at 08:10:15am on server A.