[solved] Call Event Log installation reports errors

I have gone through the long process of updating from distro version 5 to 10.
I noticed during the module installation (and retrying by deleting and installing again) these errors appear:

Installing cel
Untarring…Done
Creating cel if needed…OK
checking for extra field…ERROR failed to update extra field
checking for userfield field…ERROR failed to delete userfield field
checking for src field…ERROR failed to delete src field
checking for dst field…ERROR failed to delete dst field
checking for channel field…ERROR failed to delete channel field
checking for dstchannel field…ERROR failed to delete dstchannel field
checking for context index…ERROR failed to add context index

The module always displays 0 events after it searches for a couple of seconds. I suspect there is something going wrong and I hope that somebody has an idea.

The database user is unable to alter tables.

mysql
use asterisk;
describe cel;

thanks

well that table does not exist :pensive:
I suppose the table creation was “skipped” during the update.
Where can I find the CREATE TABLE(s) I need to run to fix this?

run: fwconsole ma install cel.

Which I guess you already did but thats the issue. See it creates the table IN that module. So perhaps the problem is you have Asterisk CDRDB credentials set in Advanced Settings, which is a bug when restoring a backup.

I think I know what you mean.

I can’t find any cdr settings under Settings->Advanced Settings.

I took a deeper look into the database and it turns out there is the database “asteriskcdrdb” wich contains two tables, cdr and cel. the cel table seems to contain all events from when I installed the system in 2014 up to now.

cel table in asteriskcdrdb:

+-------------+--------------+------+-----+---------+----------------+
| Field       | Type         | Null | Key | Default | Extra          |
+-------------+--------------+------+-----+---------+----------------+
| id          | int(11)      | NO   | PRI | NULL    | auto_increment |
| eventtype   | varchar(30)  | NO   |     | NULL    |                |
| eventtime   | datetime     | NO   |     | NULL    |                |
| cid_name    | varchar(80)  | NO   |     | NULL    |                |
| cid_num     | varchar(80)  | NO   |     | NULL    |                |
| cid_ani     | varchar(80)  | NO   |     | NULL    |                |
| cid_rdnis   | varchar(80)  | NO   |     | NULL    |                |
| cid_dnid    | varchar(80)  | NO   |     | NULL    |                |
| exten       | varchar(80)  | NO   |     | NULL    |                |
| context     | varchar(80)  | NO   |     | NULL    |                |
| channame    | varchar(80)  | NO   |     | NULL    |                |
| src         | varchar(80)  | NO   |     | NULL    |                |
| dst         | varchar(80)  | NO   |     | NULL    |                |
| channel     | varchar(80)  | NO   |     | NULL    |                |
| dstchannel  | varchar(80)  | NO   |     | NULL    |                |
| appname     | varchar(80)  | NO   |     | NULL    |                |
| appdata     | varchar(80)  | NO   |     | NULL    |                |
| amaflags    | int(11)      | NO   |     | NULL    |                |
| accountcode | varchar(20)  | NO   |     | NULL    |                |
| uniqueid    | varchar(32)  | NO   | MUL | NULL    |                |
| linkedid    | varchar(32)  | NO   | MUL | NULL    |                |
| peer        | varchar(80)  | NO   |     | NULL    |                |
| userdeftype | varchar(255) | NO   |     | NULL    |                |
| eventextra  | varchar(255) | NO   |     | NULL    |                |
| userfield   | varchar(255) | NO   |     | NULL    |                |
+-------------+--------------+------+-----+---------+----------------+
25 rows in set (0.00 sec)

Ok I did some further research and found the settings I believe you refer to in the database

mysql> SELECT keyword,value FROM freepbx_settings WHERE keyword LIKE "CDRDB%";
+----------------+-------+
| keyword        | value |
+----------------+-------+
| CDRDBHOST      |       |
| CDRDBNAME      |       |
| CDRDBPASS      |       |
| CDRDBPORT      |       |
| CDRDBTABLENAME |       |
| CDRDBTYPE      |       |
| CDRDBUSER      |       |
+----------------+-------+
7 rows in set (0.00 sec)

Seemed to be OK.
Eventually I took a look into the install script of the module. I tried to run the alter queries by hand which failed, because of a crashed table.

mysql> CHECK TABLE cel;
+-------------------+-------+----------+-----------------------------------------------------------+
| Table             | Op    | Msg_type | Msg_text                                                  |
+-------------------+-------+----------+-----------------------------------------------------------+
| asteriskcdrdb.cel | check | warning  | Table is marked as crashed                                |
| asteriskcdrdb.cel | check | warning  | 11 clients are using or haven't closed the table properly |
| asteriskcdrdb.cel | check | error    | Found wrong record at 545783732                           |
| asteriskcdrdb.cel | check | error    | Corrupt                                                   |
+-------------------+-------+----------+-----------------------------------------------------------+
4 rows in set (10.65 sec)

I then ran
REPAIR TABLE cel;
but I guess deleting the table would have been ok too. (loosing old records of course)

cel installed successfully without any errors, seems like this was not caused by FreePBX directly.
However, I suggest you add detailed error output to the install script as this table is probably one of the biggest and thus more likely to get corrupted somehow.