asterisk -vr prints SQL WARNINGS insert failed Data too long

asterisk -vr prints SQL WARNINGS insert failed Data too long

Symptom


asterisk -vr


Prints like:

[2026-02-11 15:13:49] WARNING[29897]: res_odbc.c:529 ast_odbc_print_errors: SQL Execute returned an error: 22001: [ma-3.1.12][10.3.39-MariaDB]Data too long for column 'lastdata' at row 1[2026-02-11 15:13:49] WARNING[29897]: res_odbc.c:424 ast_odbc_prepare_and_execute: SQL Execute error -1![2026-02-11 15:13:49] WARNING[29897]: cdr_adaptive_odbc.c:766 odbc_log: cdr_adaptive_odbc: Insert failed on 'scopserv:cdr_pre'. CDR failed: INSERT INTO cdr_pre (calldate, clid, src, dst, dcontext, channel, dstchannel,lastapp,lastdata, duration, billsec, disposition, amaflags, accountcode, uniqueid, userfield, hangupcause, recvip, fromchan, uri, useragent, codec1, codec2, llp, rlp,


Fix

Execute:

First verify all packages are up to date either by using the graphical Packages Manager or ssh.
If using ssh then:
scopserv_yum update to install the minimum required release = scopserv-telephony25-7.92.0.0.20260402-1

During this update the telephony commit runs a sanity check and will execute the following update script (if the update script fails to complete or it must otherwise be executed manually due to WARNING's printed by asterisk -vr):

Then

rm -rf /var/www/scopserv/telephony/scripts/upgrade/*.lock

php -q  /var/www/scopserv/telephony/scripts/update


Then to validate (optional):
mysql scopserv
show fields from cdr;
show fields from asterisk_extensions;
show fields from cel;

Warning

Adding the column length can lock tables the tables for some time. Only execute during idle periods.
Expect it to run automatically during the any scopserv-telephony25 package scopserv-telephony25-7.92.0.0.20260402-1 or higher.
However it is critical to resolve mysql blocking issues that can effect asterisk call processing.






    • Related Articles

    • Module 21 - ScopTEL IP PBX Software - Asterisk T.38 Fax Gateway Configuration

      ScopTEL Asterisk T.38 Fax Gateway Full T.38 Capabilities Initial support for handling of T.38 sessions was merged into the Asterisk 1.4 codebase. Inside of Asterisk 1.4, it is possible to perform what is referred to as T.38 passthrough. T.38 ...
    • Database recovery commands

      Check and repair mysql db mysqlcheck -A -r Asterisk prints mysql.column errors [ERROR] Incorrect definition of table mysql.column_stats: expected column 'histogram' at position 10 to have type longblob, found type varbinary(255). Cause: MySQL ...
    • Asterisk 18 is Officially Deprecated. Update to Asterisk 20 Recommended

      Background Sangoma manages a release cycle with Asterisk versions and Asterisk 18 is in Security Fix Only mode. See: https://docs.asterisk.org/About-the-Project/Asterisk-Versions/ Asterisk 20 LTS (EOL 2027-10-19) is its obvious replacement since ...
    • Product Bulletin- End Of Life Announcement for Asterisk 13

      As of September 21, 2021 ScopServ is officially deprecating all versions of Asterisk 13 and marking all support for Asterisk 13.x End Of Life. Beginning with scopserv-telephony25-7.4.3.3.20210914-2 Asterisk 18.x will be the default version of ...
    • ScopSERV Introduces New Telephony Import/Export Manager to Migrate Multi Tenants

      Overview In the past backing up and restoring a telephony configuration meant overwriting any existing telephony configuration. While this is expected behaviour for a backup and restore it didn't offer any convenience for administrators wanting to ...