OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • Archive »
  • 19.7 Legacy Series »
  • how to RESET captive portal DB
« previous next »
  • Print
Pages: [1]

Author Topic: how to RESET captive portal DB  (Read 7752 times)

tong2x

  • Full Member
  • ***
  • Posts: 223
  • Karma: 9
    • View Profile
how to RESET captive portal DB
« 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
Logged

tong2x

  • Full Member
  • ***
  • Posts: 223
  • Karma: 9
    • View Profile
Re: how to RESET captive portal DB
« Reply #1 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)
Logged

tong2x

  • Full Member
  • ***
  • Posts: 223
  • Karma: 9
    • View Profile
Re: how to RESET captive portal DB
« Reply #2 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
« Last Edit: May 25, 2019, 08:38:12 am by tong2x »
Logged

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • Archive »
  • 19.7 Legacy Series »
  • how to RESET captive portal DB
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2024 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2