OPNsense Forum

English Forums => 25.1, 25.4 Production Series => Topic started by: saleh on May 06, 2025, 12:41:32 AM

Title: Version 25.1.5_5 Captive Portal Sessions Problem
Post by: saleh on May 06, 2025, 12:41:32 AM
After updating to the latest version 25.1.5_5, we are experiencing empty sessions in the Captive Portal Sessions. This issue does not occur immediately after a reboot, but it starts happening while the OPNsense router is running. It occurs multiple times a day. The sessions only reappear after we stop the captive portal, delete the captiveportal.sqlite file, and then restart the captive portal.

We are only facing this issue after updating OPNsense to version 25.1. Why is the captiveportal.sqlite file getting corrupted?

Services: Captive Portal: Sessions

Thank you
Title: Re: Version 25.1.5_5 Captive Portal Sessions Problem
Post by: saleh on May 06, 2025, 12:50:10 AM
Note: Another thing there are no logs in the
Services: Captive Portal: Log File



Title: Re: Version 25.1.5_5 Captive Portal Sessions Problem
Post by: saleh on May 14, 2025, 01:16:32 PM
Hello,
We are getting every day many log errors in the captive portal service regarding captiveportal.sqlite, what is the reson that the captiveportal.sqlite file is corrupted. please see the below logs and images.

025-05-14T13:44:39    Error    captiveportal    sqlite3 repair /var/captiveportal/captiveportal.sqlite   
2025-05-14T13:44:39    Error    captiveportal    Forcefully repair database (Traceback (most recent call last): File "/usr/local/opnsense/scripts/OPNsense/CaptivePortal/cp-background-process.py", line 251, in main bgprocess.db.cleanup_sessions() File "/usr/local/opnsense/scripts/OPNsense/CaptivePortal/lib/db.py", line 360, in cleanup_sessions cur.execute(""" delete sqlite3.OperationalError: no such table: accounting_state )

Thank you

Title: Re: Version 25.1.5_5 Captive Portal Sessions Problem
Post by: saleh on May 15, 2025, 11:48:27 AM
Hello Franco,

Could you please help us to fix this issue. This issue occurs multiple times a day. When it happens  current users Sessions in the captive portal not appears and users can connect the internet without the hotspot authentication.

Services: Captive Portal: Log File

2025-05-15T08:34:11   Error   captiveportal   sqlite3 repair /var/captiveportal/captiveportal.sqlite   
2025-05-15T08:34:11   Error   captiveportal   Forcefully repair database (Traceback (most recent call last): File "/usr/local/opnsense/scripts/OPNsense/CaptivePortal/cp-background-process.py", line 251, in main bgprocess.db.cleanup_sessions() File "/usr/local/opnsense/scripts/OPNsense/CaptivePortal/lib/db.py", line 360, in cleanup_sessions cur.execute(""" delete sqlite3.OperationalError: no such table: accounting_state )   
2025-05-15T08:33:11   Error   captiveportal   sqlite3 repair /var/captiveportal/captiveportal.sqlite [done]   
2025-05-15T08:32:40   Error   captiveportal   sqlite3 repair /var/captiveportal/captiveportal.sqlite   
2025-05-15T08:32:40   Error   captiveportal   Forcefully repair database (Traceback (most recent call last): File "/usr/local/opnsense/scripts/OPNsense/CaptivePortal/cp-background-process.py", line 251, in main bgprocess.db.cleanup_sessions() File "/usr/local/opnsense/scripts/OPNsense/CaptivePortal/lib/db.py", line 360, in cleanup_sessions cur.execute(""" delete sqlite3.OperationalError: no such table: accounting_state )   

Thank you.

Title: Re: Version 25.1.5_5 Captive Portal Sessions Problem
Post by: franco on May 16, 2025, 09:31:04 AM
Try to avoid a broken Sqlite database. There isn't much to do once it's been corrupted.

Check if you use UFS and your system has unexpected reboots, which easily kills Sqlite due to file system inconsistencies.


Cheers,
Franco
Title: Re: Version 25.1.5_5 Captive Portal Sessions Problem
Post by: saleh on May 16, 2025, 10:06:28 PM
Thank you so much Franco,
We are using ZFS not UFS. We know isn't much to do once it's been corrupted but the problem we want to know what is the reason for that.
I mean the corrupted captiveportal.sqlite.
This issue does not occur immediately in the reboot or after a reboot, but it starts happening while the OPNsense router is up, running and working normal. It occurs multiple times a day.
Best Regards,
Saleh