The pfSense Store

Author Topic: Pfsense 1.2.3 RC2 captive portal problems  (Read 10667 times)

0 Members and 1 Guest are viewing this topic.

Offline 900mhzdude

  • Jr. Member
  • **
  • Posts: 43
    • View Profile
Pfsense 1.2.3 RC2 captive portal problems
« on: August 18, 2009, 04:25:15 pm »
i am using Pfsense 1.2.3 RC2

im using Raduis with captive portal

i keep getting this error

php: : WARNING: unlock() - Could not unlock lock

then the portal page stops working and will not auth anyone

but if i reboot the box then it starts working perfect for a few days untill i get that error

any ideas? thanks  ???
« Last Edit: September 08, 2009, 06:29:40 pm by cmb »

Offline hepoberman

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Pfsense 1.2.3 RC2 PHP bug???
« Reply #1 on: August 20, 2009, 05:50:41 am »
I am seeing;

Aug 20 05:29:58    php[36437]: /index.php: WARNING: unlock() - Could not unlock lock.
Aug 19 17:28:12    php[624]: /index.php: WARNING: unlock() - Could not unlock lock.
Aug 19 08:41:13    php[620]: /index.php: WARNING: unlock() - Could not unlock lock.
Aug 19 08:41:13    php[624]: /index.php: WARNING: unlock() - Could not unlock lock.
Aug 19 08:41:13    php: /index.php: WARNING: lock() - Could not acquire captiveportal lock!
Aug 18 17:00:45    php[621]: /index.php: WARNING: unlock() - Could not unlock lock.
Aug 18 16:06:24    php: : WARNING: unlock() - Could not unlock lock.

Using radius auth (ack only) but everything seems to be functioning fine. I figured it was a normal error from an unauth'd host attempting access to something they shouldn't.

I've searched for this error to no avail here in the forums, looks like its just us with this in our log...

Offline cmb

  • Administrator
  • Hero Member
  • *****
  • Posts: 6283
    • LinkedIn
    • Twitter
    • View Profile
    • Chris Buechler
Re: Pfsense 1.2.3 RC2 PHP bug???
« Reply #2 on: August 28, 2009, 02:29:50 am »
Does this still come up frequently enough for either one of you that you can test changes and see if it has any impact?

Offline hepoberman

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Pfsense 1.2.3 RC2 PHP bug???
« Reply #3 on: August 31, 2009, 07:02:34 am »
Does this still come up frequently enough for either one of you that you can test changes and see if it has any impact?


Ive had to disable captive portal -that seemed to stop the error. I deployed this release before I should have apparently, downtime is a problem so I cant do much testing with this unit. I had several lock-ups resulting in a mid-night trip for a reboot over the weekend but cant be sure if this error was the culprit yet.

Complete testing environment is up and ready today, Ill know more soon.

Offline spectre

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: Pfsense 1.2.3 RC2 PHP bug???
« Reply #4 on: September 07, 2009, 09:13:45 am »
I have the exact same problem.  It happens every time either one of our Radius servers crashes or is rebooted.

The Radius server crashes, or goes down/reboots, and the captive portal service hangs.

I need to fix this problem as we cannot do without our captive portal and having to reboot our firewall every time one of our Radius servers goes down is disruptive to our business.

Even a command-line fix that did not require a reboot would be extremely helpful as we could automate that through Nagios.

Edit: Actually, to clarify, I don't know whether I'm getting the same "errors" the OP is getting as I am unsure of how to diagnose this issue, however the symptoms I have are the same.
« Last Edit: September 07, 2009, 09:22:59 am by spectre »

Offline 900mhzdude

  • Jr. Member
  • **
  • Posts: 43
    • View Profile
Re: Pfsense 1.2.3 RC2 PHP bug???
« Reply #5 on: September 07, 2009, 10:34:20 am »
when captive portal first starts to crash i get this bug under captive portal status

Warning: file(/var/db/captiveportal.db): failed to open stream: No such file or directory in /usr/local/www/status_captiveportal.php on line 60 Warning: Invalid argument supplied for foreach() in /usr/local/www/status_captiveportal.php on line 61


and i can get this to repet if you have anything for me to try  :'(

thanks  :D

Offline pk

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: Pfsense 1.2.3 RC2 captive portal problems
« Reply #6 on: September 08, 2009, 11:01:29 pm »
I've had this problem for a long, long time.  I wrote a script and put it in cron to delete the lock file every minute.  That pretty much solves my issue.  When it happens it locks everyone out.  Soon as I delete the file, it's OK for a few minutes.

From what I understand it happens when too many users are accessing the CP at the same time, or maybe the same computer accessing the CP too many times at the same time.  Anyway, I just delete the lock file and all is good.

Offline 900mhzdude

  • Jr. Member
  • **
  • Posts: 43
    • View Profile
Re: Pfsense 1.2.3 RC2 captive portal problems
« Reply #7 on: September 09, 2009, 12:46:07 pm »
is there ever going to be a fix for this bug?
i need pfsense to work with captive portal with about 500 users
if pfsense cant do it are there any other Routers that can? ???

Offline pk

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: Pfsense 1.2.3 RC2 captive portal problems
« Reply #8 on: September 10, 2009, 11:55:59 pm »
You can either a) write a script that deletes the /tmp/captiveportal.lock every 10 seconds.  or b) use m0n0wall.

Offline pk

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: Pfsense 1.2.3 RC2 captive portal problems
« Reply #9 on: September 11, 2009, 12:00:30 am »
#!/bin/sh
while [ true ]; do
  while [ -f /tmp/captiveportal.lock ]; do
    echo "Deleting captiveportal.lock"
    rm /tmp/captiveportal.lock
    sleep 5
  done
  sleep 30
done

Offline cmb

  • Administrator
  • Hero Member
  • *****
  • Posts: 6283
    • LinkedIn
    • Twitter
    • View Profile
    • Chris Buechler
Re: Pfsense 1.2.3 RC2 captive portal problems
« Reply #10 on: September 11, 2009, 01:10:35 am »
You can either a) write a script that deletes the /tmp/captiveportal.lock every 10 seconds.  or b) use m0n0wall.

That's the consequence of a bug in previous versions. The locking was replaced entirely in 1.2.3 with semaphores, which fixed many things, but appears to have created some new issues that we have a ticket open on and will be resolved. m0n0wall has locking issues as well, a similar locking replacement is being looked at for it.
« Last Edit: September 11, 2009, 08:07:43 pm by cmb »

Offline cmb

  • Administrator
  • Hero Member
  • *****
  • Posts: 6283
    • LinkedIn
    • Twitter
    • View Profile
    • Chris Buechler
Re: Pfsense 1.2.3 RC2 PHP bug???
« Reply #11 on: September 11, 2009, 06:27:31 pm »
when captive portal first starts to crash i get this bug under captive portal status

Warning: file(/var/db/captiveportal.db): failed to open stream: No such file or directory in /usr/local/www/status_captiveportal.php on line 60 Warning: Invalid argument supplied for foreach() in /usr/local/www/status_captiveportal.php on line 61


and i can get this to repet if you have anything for me to try  :'(

thanks  :D

How exactly can you repeat it?

Offline 900mhzdude

  • Jr. Member
  • **
  • Posts: 43
    • View Profile
Re: Pfsense 1.2.3 RC2 captive portal problems
« Reply #12 on: September 13, 2009, 10:16:28 pm »
have about 5 PC's try and re-auth at the same time

or

have a PC auth with radius then remove MAC from Radius then let the portal page come up
put MAC back in Radius and go to a website if you do this in under 1min you will get the error

or

just run the Pfsense on a live WISP network and you will get the error within a few days  >:(

hope that helps please let me know if theres anything more i can do to help :)

Offline cmb

  • Administrator
  • Hero Member
  • *****
  • Posts: 6283
    • LinkedIn
    • Twitter
    • View Profile
    • Chris Buechler
Re: Pfsense 1.2.3 RC2 captive portal problems
« Reply #13 on: September 17, 2009, 05:06:33 pm »
Can you try the latest snapshots? We made a couple changes in the locking. I can't replicate problems, so your help in testing would be much appreciated.

Offline sullrich

  • Hero Member
  • *****
  • Posts: 5111
    • View Profile
    • pfSense
Re: Pfsense 1.2.3 RC2 captive portal problems
« Reply #14 on: September 17, 2009, 08:52:41 pm »
Made some more changes..  Please test the next snapshot that should be posted in about 3-4 hours.  Thanks!