FreePBX 17 core module not enabling

All of my modules updated nicely this morning, except core.

When I try to update core, I get this error message on the console:

~# fwconsole ma install core
Updating tables trunks, pjsip, sip, dahdi, iax, indications_zonelist, devices, users, incoming, dahdichandids, outbound_route_patterns, outbound_route_sequence, outbound_route_trunks, outbound_routes, outbound_route_email, trunk_dialpatterns…
In ExceptionConverter.php line 117:

An exception occurred while executing a query: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column ‘description’ at row 557

In Exception.php line 28:

SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column ‘description’ at row 557

In Connection.php line 32:

SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column ‘description’ at row 557

moduleadmin [-f|–force] [-d|–debug] [–edge] [–ignorecache] [–stable] [–color] [–skipchown] [-e|–autoenable] [–skipdisabled] [–snapshot SNAPSHOT] [–format FORMAT] [-R|–repo REPO] [-t|–tag TAG] [–skipbreakingcheck] [–sendemail] [–onlystdout] [–] […]

I think one of our database tables might have too much information stored in the description field, but how would I find which table it’s complaining about to look at the database and see if we have a row I need to tweak?

I tried to downgrade back to the version we were on, and it would not let me do that either. Here’s what module we were on and I tried to upgrade to:

| core | 17.0.18.14 | Online upgrade available (17.0.18.23) | GPLv3+ | Sangoma |

Here’s the output I see when I try to go back to the version we had installed:

~# fwconsole ma downloadinstall core --tag 17.0.18.14 -f
No repos specified, using: [commercial,standard] from last GUI settings

Starting module download from https://mirror.freepbx.org/modules/packages/core/core-17.0.18.14.tgz.gpg
Processing
Downloading…
1176216/1176216 [============================] 100%
Finished downloading
Extracting…Done
Module https://mirror.freepbx.org/modules/packages/core/core-17.0.18.14.tgz.gpg successfully downloaded
Updating tables trunks, pjsip, sip, dahdi, iax, indications_zonelist, devices, users, incoming, dahdichandids, outbound_route_patterns, outbound_route_sequence, outbound_route_trunks, outbound_routes, outbound_route_email, trunk_dialpatterns…
In ExceptionConverter.php line 117:

An exception occurred while executing a query: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column ‘description’ at row 557

In Exception.php line 28:

SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column ‘description’ at row 557

In Connection.php line 32:

SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column ‘description’ at row 557

moduleadmin [-f|–force] [-d|–debug] [–edge] [–ignorecache] [–stable] [–color] [–skipchown] [-e|–autoenable] [–skipdisabled] [–snapshot SNAPSHOT] [–format FORMAT] [-R|–repo REPO] [-t|–tag TAG] [–skipbreakingcheck] [–sendemail] [–onlystdout] [–] […]

Check 1st status of SQL service is up and running.

systemctl status mariadb

That error means that the data being inserted into the description column of that table exceeds the limit of the column. If the column was set to VARCHAR(50), for example, it takes 50 characters. So trying to insert or update that data with something that is 60 characters, that error is thrown.

The solution is to either increase the size of the description field or shorten the actual description being saved.

systemctl reports mariadb is running and I can query the database so I can see it’s up and running too.

The problem is, which table is the core module trying to update that it’s complaining about the description field. Most of the ones I can see are set to VARCHAR(255) or VARCHAR(100) and we have not found what table it’s complaining about.

I have looked at row 557 in various tables and the description fields do not look like they have too much data in them. The problem is I do not know exactly which table to look at and see if we have too much in a field.

Why are you trying to install when you should be doing an update? What happens if you do fwconsole ma upgrade core?

When I tried to upgrade it, it said it’s already the same version… but it won’t enable. I tried install as well just because it’s in the error message to try.

fwconsole ma upgrade core

No repos specified, using: [commercial,standard] from last GUI settings

core is the same as the online version, unable to upgrade
Updating Hooks…Done
Chowning directories…
In Self_Helper.class.php line 214:

Unable to locate the FreePBX BMO Class 'Core’A required module might be disabled or uninstalled. Recommended steps (run from the CLI): 1) fwconsole ma install core 2) fwconsole ma enable core

Also if I try to bring up the web interface, it says to try to install and then enable core, but it says “Module core cannot be enabled”.

It may or may not be related, but I see this error repeated often in my logs:

[2025-06-03 11:59:34] ERROR[618320] phone_utils.c: Format ‘mac=%s;auth_flags=%d;data=%s;data_len=%d;ran=%s;contact=%s;uri=%s;cfgd=%d;ua=%s;client_cert=%s;origination_network=%s’ truncated. Wrote ‘2096’ with ‘3192’ remaining

That looks like something is getting truncated also.

Do you have a backup? Because it sounds like you may need to uninstall and reinstall core which could result in data lose.

We just tried for probably the third time, but we got this command to get us back to the core module we were running last night:

fwconsole ma downloadinstall core --tag=17.0.18.14

We’re done doing updates for a while until we can figure out why core broke!

This is a bug and should be filed as a bug report.

If data is being migrated or inserted into the database by the core install script then it should be handled correctly. It should not be up to the user to figure out which piece of data is too long and deal with extending the field.

Meanwhile, don’t update core. Wait for the developers to fix the problem.

I tried this morning just to jump up one release to 17.0.18.15, and it gives me the same error.

I agree, it sounds like a check is missing in the upgrade script to make sure it doesn’t try to write more data to a field than it can store. I opened up [bug]: Updating core: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'description' · Issue #769 · FreePBX/issue-tracker · GitHub

Thank you all!

1 Like

To follow up on this instance, using this select statement on the asterisk database found a few extensions where there were more than 50 characters in the description field. Description was a VARCHAR(255) field so you would think it would be ok, but it was not ok.

SELECT * FROM users WHERE LENGTH(description) > 50;

Once I trimmed those descriptions down under 50 characters, I was able to upgrade the core module.