OPNsense Forum

Archive => 19.7 Legacy Series => Topic started by: tong2x on May 24, 2019, 03:12:24 am

Title: how to RESET captive portal DB
Post by: tong2x on May 24, 2019, 03:12:24 am
how to RESET the DB?
where to local the captive portal session DB?


captiveportal: Traceback (most recent call last): File "/usr/local/opnsense/scripts/OPNsense/CaptivePortal/cp-background-process.py", line 218, in main bgprocess.db.update_accounting_info(bgprocess.ipfw.list_accounting_info()) File "/usr/local/opnsense/scripts/OPNsense/CaptivePortal/lib/db.py", line 274, in update_accounting_info for row in cur.fetchall(): DatabaseError: database disk image is malformed
Title: Re: how to RESET captive portal DB
Post by: tong2x on May 24, 2019, 04:34:42 am
I'm also having issues that sessions does not timeout even after idle timeout or hard timeout has been met.
but forcing session to terminate

what should be higher DHCP lease time timedout or captive portal?

current setting
captive portal idle timeout 60minutes
captive portal hard timeout 240minutes

dhcp leased timedout 300minutes

System Information
Name   OPNsense.wifi.aaplazahotel.com
Versions   OPNsense 19.7.a_701-amd64
FreeBSD 11.2-RELEASE-p9-HBSD
OpenSSL 1.0.2r 26 Feb 2019
Updates   Click to check for updates.
CPU Type   Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz (2 cores)
Title: Re: how to RESET captive portal DB
Post by: tong2x on May 25, 2019, 08:34:14 am
for corrupt captiveportal database do the below.
db can be read by portal but changes cant. hence what ever is in the db is accepted and has already
loggedin alot of users and that dont logout even with hard limit. apparently it was due to a currupt db. changes throws an error.

database_filename = '/var/captiveportal/captiveportal.sqlite'

STOP captive portal service

* goto shell (press 8) *

cd /
cd var
cd captiveportal
rm captiveportal.sqlite
exit

START captive portal service


Related post
https://forum.opnsense.org/index.php?topic=11647.msg52756#msg52756

hope in the future captive portal and redis will have a database "refresh" button in the UI