Can not create cel table? Time Conditions disabled


(Mvogel4949) #1

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


(Mvogel4949) #2
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)

(Paul Ostrander) #3

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?


(Mvogel4949) #4

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


#5

Try

fwconsole ma downloadinstall cel

(Mvogel4949) #6

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::

#7

And

mysql asteriskcdrdb -e "show tables;describe cel"

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

#9

I would ‘bug-report’


(Mvogel4949) #10

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


#11

Does it?


(Mvogel4949) #12

I suppose we’re going to find out…


(Dave Burgess) #13

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).


(Mvogel4949) #14

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


(Dave Burgess) #15

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.


(TheJames) #16
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;


(Mvogel4949) #17

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!


(system) closed #18

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