Can not create cel table? Time Conditions disabled

I have a V14 that after an update TC and TG are disabled and cel can not be installed due to an error --> Can not create cel table. When I attempt to auto correct the database the issue persists.

Detected Missing Dependency of: cel
Found local Dependency of: cel 14.0.6
Installing Missing Dependency of: cel
Creating cel if needed…
In utility.functions.php line 207:

  Can not create cel table::

 mysqlcheck -u root -p asteriskcdr                   db --auto-repair
Enter password:
asteriskcdrdb.cdr                                  OK

Working system:
mysqlcheck -u root -p asteriskcdrdb --auto-repair
Enter password:
asteriskcdrdb.cdr OK
asteriskcdrdb.cel OK
asteriskcdrdb.queuelog OK

MariaDB [asteriskcdrdb]> repair table cel;
+-------------------+--------+----------+-----------------------------------+
| Table             | Op     | Msg_type | Msg_text                          |
+-------------------+--------+----------+-----------------------------------+
| asteriskcdrdb.cel | repair | Error    | Can't find file: 'cel' (errno: 2) |
| asteriskcdrdb.cel | repair | status   | Operation failed                  |
+-------------------+--------+----------+-----------------------------------+
2 rows in set (0.00 sec)

I am also having the same issue with one of my v14 systems. CEL is disabled along with TC and TG. The error i get from command line is "In utility.functions.php line 207: can not create cel table::.
Any ideas on how to fix?

1 Like

Is there a way to create the cel table if it has been disabled or lost?

Try

fwconsole ma downloadinstall cel

Maybe a permissions issue in mysql?

# fwconsole ma downloadinstall cel
No repos specified, using: [standard] from last GUI settings

Downloading module 'cel'
Processing cel
Verifying local module download...Verified
Extracting...Done
Download completed in 11 seconds
Creating cel if needed..
In utility.functions.php line 207:

  Can not create cel table::

And

mysql asteriskcdrdb -e "show tables;describe cel"
 mysql asteriskcdrdb -e "show tables;describe cel"
+-------------------------+
| Tables_in_asteriskcdrdb |
+-------------------------+
| cdr                     |
+-------------------------+
ERROR 1017 (HY000) at line 1: Can't find file: 'cel' (errno: 2)

I would ‘bug-report’

Do you think restoring from a backup would recreate the cel table?

Does it?

I suppose we’re going to find out…

It might be time to pop the hood on the mysql database directory.

IIRC, the database table files are in “/var/lib/mysql”. ‘cd’ to that and see what’s going on.

I’m going to guess that some of the ‘cel’ files are there and some aren’t. If worse comes to worse, you can delete all of the ‘cel’ files and restore them from a backup or recreate them using the “fwconsole install” approach. Another thing you can try is dropping the cel table from mysql to get rid of the reference pointers (which may not work, but should be worth a shot).

I was starting to go down this path. When I first accessed /var/lib/mysql there were no cel files.

mysql asteriskcdrdb -e "show tables;describe cel"
+-------------------------+
| Tables_in_asteriskcdrdb |
+-------------------------+
| cdr                     |
+-------------------------+
ERROR 1017 (HY000) at line 1: Can't find file: 'cel' (errno: 2)

I copied a cel file from a different system and set the permissions but still receive the can’t find file

asteriskcdrdb -e "show tables;describe cel"
+-------------------------+
| Tables_in_asteriskcdrdb |
+-------------------------+
| cdr                     |
| cel                     |
+-------------------------+
ERROR 1017 (HY000) at line 1: Can't find file: 'cel' (errno: 2)

Perhaps you can’t just copy a cel file from a different system

The data and index files aren’t there, so yeah, it’s going to have trouble with that. The “right” way to do this from another server would be to use
“mysqldump … --tables cel > cel.sql”
and
“mysql … asteriskcdrdb < cel.sql”

If you’re feeling creative, you can do it in one line:

“mysqldump … -h remote.ip --databases asteriskcdrdb --tables cel | mysql -u root”

That should drop the table if it exists and recreate the table for you with allocated space for the data ready to go.

1 Like
CREATE TABLE `cel` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `eventtype` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,
  `eventtime` datetime NOT NULL,
  `cid_name` varchar(80) COLLATE utf8mb4_unicode_ci NOT NULL,
  `cid_num` varchar(80) COLLATE utf8mb4_unicode_ci NOT NULL,
  `cid_ani` varchar(80) COLLATE utf8mb4_unicode_ci NOT NULL,
  `cid_rdnis` varchar(80) COLLATE utf8mb4_unicode_ci NOT NULL,
  `cid_dnid` varchar(80) COLLATE utf8mb4_unicode_ci NOT NULL,
  `exten` varchar(80) COLLATE utf8mb4_unicode_ci NOT NULL,
  `context` varchar(80) COLLATE utf8mb4_unicode_ci NOT NULL,
  `channame` varchar(80) COLLATE utf8mb4_unicode_ci NOT NULL,
  `appname` varchar(80) COLLATE utf8mb4_unicode_ci NOT NULL,
  `appdata` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `amaflags` int(11) NOT NULL,
  `accountcode` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `uniqueid` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL,
  `linkedid` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL,
  `peer` varchar(80) COLLATE utf8mb4_unicode_ci NOT NULL,
  `userdeftype` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `extra` varchar(512) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `uniqueid_index` (`uniqueid`),
  KEY `linkedid_index` (`linkedid`),
  KEY `context_index` (`context`)
) ENGINE=InnoDB AUTO_INCREMENT=219 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

2 Likes

Thanks to all! I’m certain the database dump would have worked but I was probably missing some info as I tried that solution. I appreciate the help!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.