PacketFence - BTS - PacketFence
View Issue Details
0001186PacketFencecaptive portalpublic2011-02-16 11:192012-06-14 12:52
hawk 
obilodeau 
normalcrashrandom
closedunable to reproduce 
2.0.1 
 
0001186: Captive portal redir.cgi sometimes dies with a 500 Internal Server Error

The Captive portal sometimes dies with a "Internal Server Error" code 500, which is shown to the user.

This error is caused by a failure to load/require the perl module "pf/web.pm" by the script "cgi-bin/redir.cgi". This can be seen via the apache error_log:

[Wed Feb 16 16:56:36 2011] [error] Attempt to reload pf/web.pm aborted.\nCompilation failed in require at /usr/local/pf/cgi-bin/redir.cgi line 24.\nBEGIN failed--compilation aborted at /usr/local/pf/cgi-bin/redir.cgi line 24.\n

This error, unfortunately, happens almost randomly, thus is difficult to reproduce consistently. I have experienced this error 5 times over 3 days, while playing with PacketFence.

# apache2 -v
Server version: Apache/2.2.11 (Ubuntu)
Server built: Aug 16 2010 17:44:11

Logs:
=====
access_log:
10.10.10.42 - - [16/Feb/2011:16:56:35 +0100] "GET / HTTP/1.1" 302 223 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101206 Ubuntu/10.04 (lucid) Firefox/3.6.13"
10.10.10.42 - - [16/Feb/2011:16:56:35 +0100] "GET /cgi-bin/redir.cgi?destination_url=http://10.10.10.1/ [^] HTTP/1.1" 500 344 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101206 Ubuntu/10.04 (lucid) Firefox/3.6.13"

error_log:
[Wed Feb 16 16:56:36 2011] [error] Attempt to reload pf/web.pm aborted.\nCompilation failed in require at /usr/local/pf/cgi-bin/redir.cgi line 24.\nBEGIN failed--compilation aborted at /usr/local/pf/cgi-bin/redir.cgi line 24.\n

The packetfence.log is empty during this timeslot.
No tags attached.
Issue History
2011-02-16 11:19hawkNew Issue
2011-02-16 11:42hawkNote Added: 0001870
2011-02-16 11:43hawkNote Edited: 0001870
2011-02-16 11:44hawkNote Edited: 0001870
2011-02-16 11:46hawkNote Edited: 0001870
2011-02-18 17:20obilodeauStatusnew => assigned
2011-02-18 17:20obilodeauAssigned To => obilodeau
2011-02-18 17:23obilodeauNote Added: 0001872
2011-05-30 15:26obilodeauNote Added: 0002074
2011-05-30 15:26obilodeauStatusassigned => feedback
2011-05-30 20:08hawkNote Added: 0002080
2011-08-29 10:57obilodeauNote Added: 0002173
2011-08-29 10:57obilodeauStatusfeedback => resolved
2011-08-29 10:57obilodeauResolutionopen => unable to reproduce
2012-06-14 12:52obilodeauStatusresolved => closed

Notes
(0001870)
hawk   
2011-02-16 11:42   
(edited on: 2011-02-16 11:46)
Googling around for answers I now have a hypothesis/guess what wrong...

The following link explains that this situation can happen if another module modifies a value stored in the package space.

 http://goo.gl/rJmPl [^] (the real link gets screwed by mantis)

Looking through the comments in the code, the module pf::web::custom states that it "redefining subs in pf::web". Guess this could be the issue?

(0001872)
obilodeau   
2011-02-18 17:23   
Does this happens during you making changes to pf::web?

I know I restart apache each time I do some changes to pf::web otherwise I run into issues. mod_perl seems to be aggressive about code re-use and this 'caching' is per thread so a page refresh might work but another not.

Otherwise I'm not so sure, I mean we are in production on a lot of sites and I've never heard of such a high-rate of 500's (and we monitor logs).
(0002074)
obilodeau   
2011-05-30 15:26   
Do you still have this issue?
(0002080)
hawk   
2011-05-30 20:08   
I have not used PacketFence for a while (been too busy on my other project www.iptv-analyzer.org).

But we actually have kickoff on the project, tomorrow, that need some of the functionality available in PacketFence. So, I'll soon be back on evaluation PacketFence ;-)
(Although, we have not decided if we are going to use PacketFence or not, in our setup)
(0002173)
obilodeau   
2011-08-29 10:57   
Closing this issue. Feel free to re-open if you are able to reproduce and provide instructions if possible.