SOLVED error while run report in mail delivery report

irTech

Member
Sep 6, 2014
15
1
3
cPanel Access Level
Root Administrator
Hello
when i want to run report for delivery emails in whm, i have faced with this error

Code:
DeliveryReporter API internal failure: DBD::mysql::db selectall_arrayref failed: Table './eximstats/smtp' is marked as crashed and should be repaired at /usr/local/cpanel/Cpanel/Exception.pm line 96 Cpanel::Exception::new('Cpanel::Exception::Database::Error', 'Cpanel::ExceptionMessage::Raw=SCALAR(0x268e2e0)', 'HASH(0x2b65290)') called at /usr/local/cpanel/Cpanel/Exception.pm line 47 Cpanel::Exception::create('Database::Error', 'Cpanel::ExceptionMessage::Raw=SCALAR(0x268e2e0)', 'HASH(0x2b65290)') called at /usr/local/cpanel/Cpanel/Exception.pm line 55 Cpanel::Exception::create_raw('Database::Error', 'DBD::mysql::db selectall_arrayref failed: Table \'./eximstats...', 'HASH(0x2b65290)') called at /usr/local/cpanel/Cpanel/DBI.pm line 79 Cpanel::DBI::_create_exception('Cpanel::DBI::Mysql::db=HASH(0x2bd6490)', 'DBD::mysql::db selectall_arrayref failed: Table \'./eximstats...', undef) called at /usr/local/cpanel/Cpanel/DBI.pm line 70 Cpanel::DBI::_error_handler('DBD::mysql::db selectall_arrayref failed: Table \'./eximstats...', 'Cpanel::DBI::Mysql::db=HASH(0x2bd6490)', undef) called at /usr/local/cpanel/Cpanel/DeliveryReporter.pm line 477 Cpanel::DeliveryReporter::query('Cpanel::DeliveryReporter=HASH(0x2319e60)', 'success', 1, 'maxsendunixtime', 1410088380, 'inprogress', 1, 'deliverytype', 'all', ...) called at /usr/local/cpanel/bin/emailtrack line 53 eval {...} called at /usr/local/cpanel/bin/emailtrack line 53
 
  • Like
Reactions: ljbernardi

cPanelMichael

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

You can try repairing the eximstats database with a command such as:

Code:
mysqlcheck --repair eximstats
Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Hello guys
i have this problem and did not solved by these commands...
Do you notice any error messages when running the "mysqlcheck eximstats" command after attempting to repair the database?

Thank you.
 

John Martin

Registered
Apr 5, 2016
2
0
1
Tyler, Texas
cPanel Access Level
Root Administrator
I'm having similar issues. When I run `mysqlcheck eximstats` here's the output I get.

Code:
[email protected] [~]# mysqlcheck eximstats
eximstats.defers                                   OK
eximstats.failures
Error    : Incorrect file format 'failures'
error    : Corrupt
eximstats.sends
Error    : Can't find file: 'sends' (errno: 2)
status   : Operation failed
eximstats.smtp
Error    : Can't find file: 'smtp' (errno: 2)
status   : Operation failed
It looks like I'm missing the table files :S Anybody know how I can fix this? I don't need to data but I want to get eximstats working again.
 

John Martin

Registered
Apr 5, 2016
2
0
1
Tyler, Texas
cPanel Access Level
Root Administrator
Hello

You can recreate the table structure ( not the data) by executing the following script

/usr/local/cpanel/bin/updateeximstats
Hey ssfred, thanks for the advice! I'm getting errors from that command, too. Here's what it said:
Code:
[email protected] [~]# /usr/local/cpanel/bin/updateeximstats --verbose
                                                                                               
REPLACE INTO user (host, user, password)
    VALUES (
        'localhost',
        'eximstats',
  -- IMPORTANT: Change this password!
        password('REDACTED')
    )

                                                                                               
REPLACE INTO db (host, db, user, select_priv, insert_priv, update_priv,
                delete_priv, create_priv, drop_priv)
    VALUES (
        'localhost',
        'eximstats',
        'eximstats',
        'Y', 'Y', 'Y', 'Y',
        'Y', 'Y'
    )

FLUSH PRIVILEGES

CREATE DATABASE IF NOT EXISTS GRANT ALL ON eximstats.* TO 'eximstats'@'localhost' IDENTIFIED BY 'REDACTED'

mysqldiff failed: The “/usr/local/cpanel/3rdparty/perl/514/bin/mysqldiff” command (process 25372) reported error number 2 when it ended.
Output was: mysqldump failed. Exit status: 2:
mysqldump: Got error: 130: Incorrect file format 'failures' when using LOCK TABLES

-- MySQL dump 10.13  Distrib 5.5.48, for Linux (x86_64)

--

-- Host: localhost    Database: eximstats

-- ------------------------------------------------------

-- Server version5.5.48-cll


/*!40101 SET @[email protected]@CHARACTER_SET_CLIENT */;

/*!40101 SET @[email protected]@CHARACTER_SET_RESULTS */;

/*!40101 SET @[email protected]@COLLATION_CONNECTION */;

/*!40101 SET NAMES utf8 */;

/*!40103 SET @[email protected]@TIME_ZONE */;

/*!40103 SET TIME_ZONE='+00:00' */;

/*!40014 SET @[email protected]@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;

/*!40014 SET @[email protected]@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;

/*!40101 SET @[email protected]@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;

/*!40111 SET @[email protected]@SQL_NOTES, SQL_NOTES=0 */;
I then tried to just drop the database in MySQL but it failed, too.
Code:
[email protected] [~]# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 638442
Server version: 5.5.48-cll MySQL Community Server (GPL)

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> DROP DATABASE `eximstats`;
ERROR 1010 (HY000): Error dropping database (can't rmdir './eximstats', errno: 39)
mysql>
Awfully strange issue :S I think I'll open up a ticket with cPanel and update this thread they figure the problem out.
 

cPanelMichael

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

While it's not generally advised to manually move a database directory, you could try moving the database to another location and then regenerating it if you have no email report data you need to preserve. EX:

Code:
mkdir /var/mysql-backups
cp -a /var/lib/mysql/eximstats /var/mysql-backups/
mysql
mysql > DROP DATABASE eximstats;
mysql > quit
/usr/local/cpanel/bin/updateeximstats
If you want to import data back into the database, you can use a command such as:

Code:
/scripts/import_exim_data /var/log/exim_mainlog*
Note that this command take a while to complete, depending on the amount of data logged to the Exim log. You may also want to modify the following option in "WHM Home » Server Configuration » Tweak Settings" under the "Stats and Logs" tab:

"The interval, in days, to retain Exim stats in the database"

Reducing this value will decrease the amount of data that is stored in the Eximstats database.

Thank you.