"core" module stuck disabled after module update (DB_Error)

I’ve been digging around but so far have not been able to find anything “exactly” like the issue that I’m currently running in to so here goes –
We applied module updates and most everything applied successfully. It seems, however, that the “core” module(currently is not able to update successfully and is now stuck in a state of

Disabled; Pending upgrade to

When trying to enable and update the “core” module the progress box shows that it hangs after the step

upgrading any zap trunks to dahdi if foundok

The http/error_log drops this line in to correspond with the update stalling -

PHP Fatal error: Cannot use object of type DB_Error as array in /var/www/html/admin/modules/core/install.php on line 1047, referer: pbxhost/admin/config.php

I looked and line 1047 is line 3(if…) of the following blob -

//migrate the username field in ampusers
$res = $db->getAll(‘SHOW COLUMNS FROM ampusers WHERE FIELD = “username”’);
if ($res[0][‘Type’] == ‘varchar(20)’) {
sql(‘ALTER TABLE ampusers CHANGE username username varchar(255) NOT NULL’);
outn(_(“migrated username column to allow for longer usernames”));

So far we have tried amportal chown, restarting the server and tried copying core module files from another of our instances over to this instance to see if it was something specific to the .32 version.

Has anyone else come across this previously? Sorry if this is a duplicate, I’ve been searching around quite a bit and haven’t found this exactly though.

run: amportal a m

Then try to run the command yourself: SHOW COLUMNS FROM ampusers WHERE FIELD = “username”


Excellent, thank you very much! I wasn’t aware of that route to enter the mysql prompt, convenient! It was, in fact, throwing out a valid mysql error -

Can’t create/write to file '/tmp/#sql

I’m not sure how but the permissions on /tmp seem to have been messed up so after a ‘chmod 1777 /tmp’ things are looking much better.

Thanks again for the pointer!

1 Like

I’ve had that happen before. You aren’t alone :smile: