SOLVED SQlite mod_security corrupt

urgido

Well-Known Member
Jul 19, 2005
129
10
168
cPanel Access Level
Root Administrator
I am experimentig and issue with SQLite of mod_security. Here is my log:


[
2018-05-12 19:04:29 -0500] E [/usr/local/cpanel/scripts/purge_modsec_log] The “/usr/local/cpanel/scripts/purge_modsec_log” command (process 7336) reported error number 255 when it ended.
as root /scripts/purge_modsec_log:

Cpanel::Exception::Database::Error/(XID 6ycjhs) The system received an error from the “SQLite” database “/var/cpanel/modsec/modsec.sqlite”: SQLITE_CORRUPT (database disk image is malformed)
at /usr/local/cpanel/Cpanel/Exception/CORE.pm line 336.
Cpanel::Exception::create("Database::Error", ARRAY(0x20f3160)) called at /usr/local/cpanel/Cpanel/Exception.pm line 61
Cpanel::Exception::__ANON__(__CPANEL_HIDDEN__, ARRAY(0x20f3160)) called at /usr/local/cpanel/Cpanel/DBI.pm line 200
Cpanel::DBI::_create_exception(Cpanel::DBI::SQLite::db=HASH(0x20f2cc8), "DBD::SQLite::db do failed: database disk image is malformed", undef) called at /usr/local/cpanel/Cpanel/DBI.pm line 188
Cpanel::DBI::_error_handler("DBD::SQLite::db do failed: database disk image is malformed", Cpanel::DBI::SQLite::db=HASH(0x20f2cc8), undef) called at /usr/local/cpanel/Cpanel/ModSecurity/DB.pm line 319
Cpanel::ModSecurity::DB::purge_stale_records_from_database(7) called at /scripts/purge_modsec_log line 41
scripts::purge_modsec_log::run() called at /scripts/purge_modsec_log line 27
Any help?
Thanks
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Hello,

Can you let us know the size of the /var/cpanel/modsec/modsec.sqlite file? EX:

Code:
du -sh /var/cpanel/modsec/modsec.sqlite
Also, can you confirm if you made any manual changes to this file in the past, or if it's ever been restored or recovered?

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Well, one month ago I had disk issues that generated problems with all my InnoDB databases.
Hello @urgido,

It's possible the issue with your drive also lead to the corruption of the /var/cpanel/modsec/modsec.sqlite file. You can use the following commands to generate a new instance of this file:

Code:
/scripts/restartsrv_tailwatchd --stop
mv /var/cpanel/modsec/modsec.sqlite /var/cpanel/modsec/modsec.sqlite.old1
/usr/local/cpanel/scripts/setup_modsec_db
/scripts/restartsrv_tailwatchd --start
Let us know if this helps.

Thank you.
 
  • Like
Reactions: speckados

urgido

Well-Known Member
Jul 19, 2005
129
10
168
cPanel Access Level
Root Administrator
Hello @urgido,

It's possible the issue with your drive also lead to the corruption of the /var/cpanel/modsec/modsec.sqlite file. You can use the following commands to generate a new instance of this file:

Code:
/scripts/restartsrv_tailwatchd --stop
mv /var/cpanel/modsec/modsec.sqlite /var/cpanel/modsec/modsec.sqlite.old1
/usr/local/cpanel/scripts/setup_modsec_db
/scripts/restartsrv_tailwatchd --start
Let us know if this helps.

Thank you.
Solved.
Thanks a lot.


Regards
 
  • Like
Reactions: cPanelMichael

Nord Stage

Registered
Apr 22, 2019
1
0
1
Venezuela
cPanel Access Level
Reseller Owner
Please
My cpanel gives the following message

The system received an error from the “SQLite” database “/var/cpanel/bandwidth/onletkrp.sqlite”: SQLITE_CORRUPT (database disk image is malformed)

Please
Please, what solution can I follow?
Thank you
 

Attachments

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Hello @Nord Stage,

Your cPanel Forums profile shows your access level as Reseller Owner. As a reseller, you'll want to report that error message to your reseller hosting provider so they can move the corrupted /var/cpanel/bandwidth/username.sqlite file to another location if necessary.

Thank you.