Upgrade Killed CDR reports :(

Just doing a couple of updates and I noticed CDR reports not install. I installed them after running the latest updates and now I get this wonderful message. I have checked sql user permissions granted all access for freepbxuser and asteriskuser just to be sure. Nothing seems to work. Any input would be wonderful!!!

Please wait while module actions are performed
Checking if field did is present in cdr table…
Adding did field to cdr
This might take a while…
DB Error: unknown error

I can confirm this same exact issue, using FreePBX 2.11. Granted all access to freepbxuser, no go. Started after an update yesterday (2/10), never had an issue previously.

File: /etc/asterisk/cdr_mysql.conf
;
[global]
hostname = localhost
dbname=asteriskcdrdb
user = freepbxuser

[[email protected]]# mysql -u root -p
mysql> show databases;
±-------------------+
| Database |
±-------------------+
| information_schema |
| asterisk |
| asteriskcdrdb |
| mysql |
| test |
±-------------------+
5 rows in set (0.00 sec)

mysql> use asteriskcdrdb;
Database changed
mysql> show tables;
±------------------------+
| Tables_in_asteriskcdrdb |
±------------------------+
| cdr |
| cel |
±------------------------+
2 rows in set (0.00 sec)

mysql> show columns from cdr;
±--------------±-------------±-----±----±--------------------±------+
| Field | Type | Null | Key | Default | Extra |
±--------------±-------------±-----±----±--------------------±------+
| calldate | datetime | NO | MUL | 0000-00-00 00:00:00 | |
| clid | varchar(80) | NO | | | |
| src | varchar(80) | NO | | | |
| dst | varchar(80) | NO | MUL | | |
| dcontext | varchar(80) | NO | | | |
| channel | varchar(80) | NO | | | |
| dstchannel | varchar(80) | NO | | | |
| lastapp | varchar(80) | NO | | | |
| lastdata | varchar(80) | NO | | | |
| duration | int(11) | NO | | 0 | |
| billsec | int(11) | NO | | 0 | |
| disposition | varchar(45) | NO | | | |
| amaflags | int(11) | NO | | 0 | |
| accountcode | varchar(20) | NO | MUL | | |
| uniqueid | varchar(32) | NO | | | |
| userfield | varchar(255) | NO | | | |
| did | varchar(50) | NO | | | |
| recordingfile | varchar(255) | NO | | | |
| cnum | varchar(40) | NO | | | |
| cnam | varchar(40) | NO | | | |
| outbound_cnum | varchar(40) | NO | | | |
| outbound_cnam | varchar(40) | NO | | | |
| dst_cnam | varchar(40) | NO | | | |
±--------------±-------------±-----±----±--------------------±------+
23 rows in set (0.00 sec)

mysql> grant all privileges on asteriskcdrdb.* to [email protected];
Query OK, 0 rows affected (0.04 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)


CDR Reports, 2.11.0.4, FreePBX, Disabled, Pending upgrade to 2.11.0.5
;
Upgrade to 2.11.0.5 and Enable
;
Upgrades, installs, enables and disables:
CDR Reports 2.11.0.4 will be upgraded to 2.11.0.5
;
Please wait while module actions are performed
Checking if field did is present in cdr table…
Adding did field to cdr
This might take a while…
DB Error: unknown error

I’ll also report I could’ve sworn the update yesterday was trying to update to 2.11.0.6 instead. I’m about 90% positive.

Any ideas or comments on this issue please? What we can do to have a working CDR module again?

mysqlcheck --repair --all-databases

Run that command voipguy440. That should take care of your problem!

As josh kindly pointed out. You need to run that command. Your database tables are corrupt.