web gui crashed after update

Hello, last night I tried to update my VitelPBX to latest version on VitalPBX 4, but as soon as I hit update I got this error

Fatal error : Uncaught Exception: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘csfr_token’ in ‘field list’ With Query: select lower(hex(csfr_token)) as csfr_token from ombu_sessions where session_id = unhex(?) and modified >= from_unixtime(unix_timestamp(now()) - ?) in /usr/share/vitalpbx/www/includes/db.php:0 Stack trace: #0 /usr/share/vitalpbx/www/includes/db.php(0): vitalpbx\db->__construct() #1 /usr/share/vitalpbx/www/includes/session.php(0): vitalpbx\db::query() #2 /usr/share/vitalpbx/www/includes/session.php(0): vitalpbx\session::token_id() #3 /usr/share/vitalpbx/www/includes/session.php(0): vitalpbx\session::start() #4 /usr/share/vitalpbx/www/includes/acl/user.php(0): vitalpbx\session::current() #5 /usr/share/vitalpbx/www/includes/app/Core.php(0): vitalpbx\acl\user::current() #6 /usr/share/vitalpbx/www/includes/app/Core.php(0): app\Core->_loadMainView() #7 /usr/share/vitalpbx/www/index.php(0): app\Core->run() #8 {main} thrown in /usr/share/vitalpbx/www/includes/db.php on line 0

also, any paid modules that I have do not work, it said that module does not exist.
what can be the issue?

When something like this happen, just try doing a full update from Linux CLI using root privileges.

apt clean all
apt update
apt upgrade -y

Same issue here as well, miguel’s advice didn’t help.

It appears that the current VitalPBX version failed to upgrade the MySQL scheme properly. Creating a new column csfr_token of type varbinary(40) in table ombu_sessions solved the issue for me.

Could a VitalPBX employee please comment on this and tell us about the correct column property? varbinary(40) may not be correct.

Same issue here as well, miguel’s advice didn’t help.

Please post command for how to creating a new column csfr_token of type varbinary(40) in table ombu_sessions

OK, found it out myself. The correct column type is binary(20).

The error occurred because I had changed the MySQL root password. However, this caused the schema update scripts that are called during VitalPBX updates to fail because they expect the root user to have no password.

So the solution is to remove the MySQL root password so that future database migration scripts can be executed during apt upgrades.

1 Like

Good you found that. You sure should not change the root password. This was never a good idea in any version.

When I remove the MySQL root password, update was successful, but when I log of and try to log in, I got error

Exception : SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘csfr_token’ in ‘field list’ With Query: insert into ombu_sessions ( session_id, user_id, csfr_token, created, modified ) select unhex(?), user_id, unhex(?), now(), now() from ombu_users where (username = ? or email = ?) and password = unhex(?) on duplicate key update user_id = values(user_id), modified = values(modified) at file /usr/share/vitalpbx/www/includes/db.php on line 0

You can use the command below to apply pending migrations.

vitalpbx build-db

Good, it’s work fine

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.