SQL error installing some modules

Hi all,

I upgraded my FreePBX distro from v1.1100.211.63, all the way up to v10.13.66-6, following instructions and using upgrade scripts from here :-


I’m now getting the following error when I try to install/upgrade some modules, notably “core” v13.0.9 and “recordings” v13.0.4 :-

SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘helptext’ in ‘field list’

I’m relatively inexperienced in this stuff, but it looked like a possible corrupt table in some database so I ran > mysqlcheck -u root --check --auto-repair --all-databases but it hasn’t solved the problem.

I have a feeling I shouldn’t be on this distro at all - probably should have stayed at 6.12.65-31?

Anyway I’d really appreciate any help on this - if any more information on my install/setup etc would be helpful just let me know.

Thanks in advance!



The table is not corrupt, it has fields missing as if not all the upgrade scripts has been run…

I have never upgraded from so many versions but it looks like you would need to run all the scripts from the page you posted and also all the script from all the other similar pages until you get to the version you want.

If you only ran the scripts on that page it’s not enough…

As for the distro version FreePBX 13 will very soon be stable so it’s ok to be on that version…

Good luck and have a nice day!


Thanks a lot for your reply Marbled, I did indeed run all upgrade scripts from the linked page, plus all upgrade scripts from the other pages sequentially right up to the latest. I should have clarified this in the oringial post.

I didn’t think I missed any, but I guess it’s possible! Is there any way I can check to see if I missed any?

Or is there any way to fix this problem, other than a clean install? Really don’t want to have to do that!!

Thanks again


It looks like these scripts log under /var/log/pbx/upgrade so I guess you could theorically find which one was not run…

However, I am pretty sure that running them out of sequence is seriously asking for trouble, you could partially revert some database fields to their previous definitions, corrupt the content of other fields, etc…

Your system would most likely be quite confused as to the version of the distro it is running too…

If you could find which script was not run I guess some part of it could manually be run but I would not try to run the script in its entirety…

That said, I once reported a problem with a similar update, maybe you run all scripts and there is a very localized problem with one of the updates.

Maybe adding that field manually could work or If you could figure out what table is implicated and if it is not a mandatory module you could uninstall it and reinstall it again so that it would recreate the table correctly…

Of course, it might most likely mean reconfiguring some stuff…

Let’s hope one of the FreePBX devs like @tm1000 pops up here and has a better suggestion…

Good luck and have a nice day!



Assuming the command I dig up is the right one it looks like it’s the featurecodes table which table definition is

mysql> desc featurecodes;
| Field       | Type         | Null | Key | Default | Extra |
| modulename  | varchar(50)  | NO   | PRI |         |       |
| featurename | varchar(50)  | NO   | PRI |         |       |
| description | varchar(200) | NO   |     |         |       |
| helptext    | varchar(250) | NO   |     |         |       |
| defaultcode | varchar(20)  | YES  |     | NULL    |       |
| customcode  | varchar(20)  | YES  |     | NULL    |       |
| enabled     | tinyint(4)   | NO   | MUL | 0       |       |
| providedest | tinyint(4)   | NO   |     | 0       |       |

This is unfortunately not optional so you might want to try manually adding the field…

You did take a backup before doing all this, right?

Good luck and have a nice day!


Just checked and I seem to have run all scripts - looks like the 1.1100-210-63-2 script was run twice though, do you think that could be relevant?

I’ve tried uninstalling and reinstalling again but get the same error unfortunately.

Thanks for digging into which table it is, which database is that within? And also how do I manually add the missing field… sorry, very inexperienced!

I want to answer that last question but I think it best if I don’t… :persevere:

Scratch that, as is very obvious from the screenshot attached to last post, 1.1100-210-63-2 was not run twice at all!

Ok, so I added the helptext column to the featurecodes table, ran fwconsole chown and then fwconsole ma install core, which spat me out this little beauty :-

Module core successfully installed


I then went in and upgraded all other modules, which seemed to go smoothly. The dashboard module had been disabled up until now, because it depended on core. It’s now enabled and I get this error instead of the dashboard view :-

SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘signature’ in ‘field list’

Do you know which table the signature field should be in? Hopefully I can just add it like I did helptext

I have a feeling this could be a trend though, is there any way I can check for missing columns without having to wait until they pop up in errors like this?

Thanks again for your help so far, Nick, I really appreciate it!

Please file bugs when you find these. No one else has seen or reported this so it may just be an edge case. Edge cases are almost impossible to reproduce but if there is something obvious in the code we should be able to correct it. be sure to include your errors in any bug reports.


Thanks @jfinstrom, just filed bug report. Are there some logs I should include to help more?


I don’t know if there is a way to globally check for those, sorry…

You are right, there could be a few others as well and they might not be properly initialized if they are not added by the script/code which is supposed to add them.

As for signature, it’s apparently part of two tables…

| TABLE_NAME         |
| modules            |
| restapi_log_events |

These are the definitions of those two tables… You might want to check if it’s only those fields or if additional fields from those tables could be missing:

mysql> desc modules;
| Field      | Type        | Null | Key | Default | Extra          |
| id         | int(11)     | NO   | PRI | NULL    | auto_increment |
| modulename | varchar(50) | NO   |     |         |                |
| version    | varchar(20) | NO   |     |         |                |
| enabled    | tinyint(4)  | NO   |     | 0       |                |
| signature  | blob        | YES  |     | NULL    |                |
5 rows in set (0.00 sec)

mysql> desc restapi_log_events;
| Field     | Type         | Null | Key | Default | Extra          |
| id        | int(11)      | NO   | PRI | NULL    | auto_increment |
| time      | int(11)      | YES  | MUL | NULL    |                |
| token     | varchar(75)  | YES  | MUL | NULL    |                |
| signature | varchar(150) | YES  |     | NULL    |                |
| ip        | varchar(20)  | YES  |     | NULL    |                |
| server    | varchar(75)  | YES  |     | NULL    |                |
6 rows in set (0.00 sec)

Sorry for the delayed reply, I had to wait for my lunch break…

Good luck and have a nice day!


Thanks Nick, I don’t have the restapi_log_events table at all (think I should add it?) but I added signature to modules, restarted mysql and I don’t get that error anymore, but the onion keeps peeling!

This is my dashboard view now :-

When I try to Apply Config I get this error:

Reload failed because retrieve_conf encountered an error: 1
exit: 1
Exception: Tried to investigate file /var/www/html/admin/modules/faxpro/Faxpro.class.php, and can’t tell if it’s obfs or licenced (’
') in file /var/www/html/admin/modules/sysadmin/functions.inc/Schmooze.class.php on line 74
Stack trace:

  1. Exception->() /var/www/html/admin/modules/sysadmin/functions.inc/Schmooze.class.php:74
  2. Schmooze\Zend->fileIsLicenced() /var/www/html/admin/modules/sysadmin/functions.inc/Schmooze.class.php:32
  3. Schmooze\Zend->fileIsLicensed() /var/www/html/admin/libraries/BMO/Self_Helper.class.php:200
  4. FreePBX\Self_Helper->loadObject() /var/www/html/admin/libraries/BMO/Self_Helper.class.php:104
  5. FreePBX\Self_Helper->autoLoad() /var/www/html/admin/libraries/BMO/Self_Helper.class.php:37
  6. FreePBX\Self_Helper->__get() /var/www/html/admin/libraries/BMO/Hooks.class.php:203
  7. FreePBX\Hooks->preloadBMOModules() /var/www/html/admin/libraries/BMO/Hooks.class.php:39
  8. FreePBX\Hooks->updateBMOHooks() /var/lib/asterisk/bin/retrieve_conf:44


Looks like it’s the field used to know if the packages have been altered, it’s the package “signature”…

I think there is a way to refresh those, let me dig it up…

You did make a backup before starting to play with this, right?

As for the table, don’t add it, it’s most likely used by a module I have or had installed…

Good luck and have a nice day!


Try this

amportal chown
amportal a ma refreshsignatures
amportal a reload

This is from: http://wiki.freepbx.org/display/FPG/Module+Signing

Good luck and have a nice day!


None of the commands you are providing are going to help. There are serious errors in this install and I think you are just at the tip of the iceberg.

At this point I suggest A) reinstall or B) restore from backup and try again

Seriously if you continue down this road it’s just going to get worse. The upgrade scripts are fine. During upgrade your system completely skipped the 10 Framework upgrade scripts



There’s many more of these. But it’s too late to get freepbx to run them at this point.

Thanks @tm1000, that’s a real pain but at least I’m out of my misery now in trying to fix and can focus on reinstalling.

Was this likely something I did wrong during upgrade process or just some fluke weirdness?

If you ran all of the scripts in Order then I doubt it was you but going from 1 to 6 without skipping any. You have more will power than I. I am wondering if you skipped going to 12 and went from 11 to 13 which would have caused this issue.

You can try running these two lines in mysql yourself, but you are missing other scripts too.:

ALTER TABLE `featurecodes` ADD COLUMN `helptext` varchar (250) NOT NULL AFTER `description`
ALTER TABLE `modules` ADD COLUMN `signature` BLOB NULL AFTER `enabled`

Then get rid of the really old module

rm -Rf /var/www/html/admin/modules/faxpro

Yep I did indeed run every single script, took a while but I got there. I don’t think I missed any, see below:

Oh well, thanks a lot for your help @Marbled and @tm1000, my biggest mistake was forgetting to backup before I started, lesson learned!

I know it’s quite a long shot, take a look at the warnings I wrote before this even started…

My day job is programming (Senior Analyst-Programmer) and we run upgrade scripts/one-shuts quite frequently so I knew the risks involved…

Hopefully that’s what he already added…

He will need to refresh the signatures after that, right?

Have a nice day!