Unknown column 'reversal' in 'field list'

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

When I try to add a new inbound route I get the error mentioned above. I recently upgraded from 12.x to 13.latest. I also restored a backup from a 12.x server. At one point, this worked because, for testing purposes I was able to add an inbound route and test with it. After restoring a fresh backup I’m no longer able to add an inbound route. (I’m not sure if I’d encounter a similar error on ANY change …or if its specific to inbound routes.)

If it helps, here’s the saga for my upgrade: Asterisk won’t start after upgrade to 13

So, a restore to a previous backup fixed this issue. I still need to make sure I have the most up-to-date info from the other server on this server …since the old server is being decommissioned. Is there something obvious I’m doing wrong with the restore from the old server?

We would have to see the full error. Usually it has traceback in it

Here’s the output from the “copy to clipboard option” (but there’s a lot more info on the page).

PDOException thrown with message "SQLSTATE[42S22]: Column not found: 1054 Unknown column 'reversal' in 'field list'"

Stacktrace:
#6 PDOException in /var/www/html/admin/modules/core/Core.class.php:1930
#5 PDOStatement:execute in /var/www/html/admin/modules/core/Core.class.php:1930
#4 FreePBX\modules\Core:addDID in /var/www/html/admin/modules/core/functions.inc.php:4125
#3 core_did_add in /var/www/html/admin/modules/core/Core.class.php:1282
#2 FreePBX\modules\Core:doConfigPageInit in /var/www/html/admin/libraries/BMO/GuiHooks.class.php:290
#1 FreePBX\GuiHooks:doBMOConfigPage in /var/www/html/admin/libraries/BMO/GuiHooks.class.php:252
#0 FreePBX\GuiHooks:doConfigPageInits in /var/www/html/admin/config.php:352

Each time I restore a backup, I’m also having to:

fwconsole ma download http://mirror.freepbx.org/modules/packages/framework/framework-13.0.61.3.tgz && fwconsole ma install framework

Any ideas what I need to exclude so that the backup being restored on this machine (backing up another machine) doesn’t require me to have to upgrade the framework each time?

The reversal field is added at install time. Will have to look into why this is failing

The code that adds the reversals column is being blocked by your database. Probably because the database user doesn’t have permissions. The code is however correct.

I found the column in question. Looks like its in my new server, but it is NOT in the old server’s incoming table.

It needs to be added to the incoming table. The whole issue is it’s trying to add the column by your database is blocking that add.

I updated my reply as you were posting.

You can also reinstall core after you restore the backup

fwconsole ma install core

What does reinstalling core do exactly? Does that fix the schema for this (and other?) tables?

Yes it will just install it again. Running the install scripts. You can look at the code by looking at install.php. There are many things it will do.

So, I’d need to download && install the framework && install core as well? If I’m understanding correctly, there’s probably not a good way to edit the backup so that it will restore without all this fuss. Is that right?

You dont need to download and install framework and you don’t need to download core.

Just run:

fwconsole ma install core

on the system experiencing the error

fwconsole ma download http://mirror.freepbx.org/modules/packages/framework/framework-13.0.61.3.tgz && fwconsole ma install framework && fwconsole ma install core

That did it!

The same command doesn’t seem to fix the similar error I’m getting when I change a PIN for a conference room.

Unknown column ‘language’ in ‘field list’

PDOException thrown with message “SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘language’ in ‘field list’”

Stacktrace:
#5 PDOException in /var/www/html/admin/modules/conferences/Conferences.class.php:220
#4 PDOStatement:execute in /var/www/html/admin/modules/conferences/Conferences.class.php:220
#3 Conferences:addConference in /var/www/html/admin/modules/conferences/Conferences.class.php:39
#2 Conferences:doConfigPageInit in /var/www/html/admin/libraries/BMO/GuiHooks.class.php:290
#1 FreePBX\GuiHooks:doBMOConfigPage in /var/www/html/admin/libraries/BMO/GuiHooks.class.php:252
#0 FreePBX\GuiHooks:doConfigPageInits in /var/www/html/admin/config.php:352

You now need to go and reinstall conferences. Your backup is restoring and old database while you have new modules. This is very bad. You need to restore to the SAME version you backed up from.

I added a language column to the table “meetme” and that seemed to fix it (and the bad destinations error you may’ve seen. That doesn’t sound like its the preferred solution though, so what’s the command to install that module (or all the modules)?

Now that you mention it, I remember seeing something about updating (??) modules in the dialog box for the restore, but clicked away from it too soon.

fwconsole ma install conferences