Upgrade broke displaying of many things

TurabG

Member
Aug 25, 2022
79
10
8
45
Sometime last year, I upgraded Fusion from the source files (on the web interface Advanced -> Upgrade) as usual; but that one time, something unusual happened and some styling broke on the web UI. Since the system continued working without a problem, I didn't mind the UI deficiencies and have used the system like that since then.

A couple of months ago I decided to upgrade my Debian instance for as you know, Debian 10 was EOL last year. I upgraded it to 11 first, then to 12. (I was on Debian 10 because the first time I installed Fusion, I couldn't have it work with Debian 12 back then.)

Then I upgraded FreeSwitch to the latest release by now (1.10.12) and I upgraded Fusion from the source again, to 5.5.1 and I also upgraded PHP (8.2.29) and PostgreSQL (18) per the new Debian repo. After a few months, now I upgraded again to 5.5.2 from the Git main branch. But the problems below persist, since the big upgrade.

The style deficiencies of the UI went away but some more serious problems arose. Right now:

1- My dashboard is not showing any statistics except for active calls, all the widgets (like recent calls, missed calls etc.) are empty and never populating. Deleting the dashboard and re-applying the app defaults doesn't change anything. (Active calls both on dashboard and at Status -> Active Calls page correctly lists them real-time.)

2- Status -> Registrations is a big empty list. Nothing shows up, it says 0 registrations, although all my client phones are registered and working. SIP status, System status and SIP profiles pages/data are very normal. Also Accounts -> Extensions page indicate all of the extensions are unregistered, although they all are registered and functioning correctly.

3- Call Detail Records page show records only up to April when I made the big upgrades. Interestingly, there are then three calls recorded from September and nothing more before or after. But recording is actually functioning. I can see the recorded wav files (which then converts to ogg) are consistently in my /var/lib/freeswitch/recordings/mypbx/archive directory.

4- CDR Statistics, Extension Summary and Destination Summary pages are empty and never updating, all the stats are 0 except for the 3 calls from September that I mentioned earlier. Extension Summary page is showing records up to April only. (The date when I upgraded to 5.5.1)

5- Contacts list is empty, although it says "14" on the title. (Show all button doesn't change the result)

6- Some apps (like Languages and Backup) show this error although their source files are up to date too: Failed to locate the Project Root by searching for project_root.php please contact support for assistance.

7- Upgrade -> Menu Defaults throws this error:
Code:
Fatal error:  Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, bool given in /var/www/fusionpbx/resources/classes/groups.php:386Stack trace:#0 /var/www/fusionpbx/resources/classes/menu.php(696): groups->defaults()#1 /var/www/fusionpbx/core/menu/menu_restore_default.php(58): menu->restore_default()#2 /var/www/fusionpbx/core/upgrade/index.php(166): require_once('...')#3 {main}  thrown in /var/www/fusionpbx/resources/classes/groups.php on line 386

8- Upgrade -> Schema throws this error:
Code:
Fatal error:  Uncaught TypeError: Cannot access offset of type string on string in /var/www/fusionpbx/resources/classes/schema.php:537Stack trace:#0 /var/www/fusionpbx/core/upgrade/index.php(137): schema->schema()#1 {main}  thrown in /var/www/fusionpbx/resources/classes/schema.php on line 537

9- I can't install new apps. I just pulled all of the apps to the fusionpbx/app directory and reset the App Defaults, but none of the apps are installing. (Maybe because resetting to Menu Defaults is broken?) But the apps installed before are working (except for Backup and Languages that I mentioned earlier.)
 
Last edited:
Last time I checked, PHP 8.2 was not officially supported. This may cause some of the issues you are having. PHP 8.1 was the recommended version.
 
For FusionPBX PHP 8.1, 8.2, and 8.3 are officially.

If you are on the master branch, you need to run Upgrade -> Schema -> Data Types
php /var/www/fusionpbx/core/upgrade/upgrade.php --types

I think I'll optimize the Data Types code for speed and efficiency, and then incorporate it into the Upgrade -> Schema process. We don't change data types often, but we have done a few to correct things or to improve consistency across the project.

If you still have problems and you are willing to call me, the support number is available on the website at this URL
https://www.fusionpbx.com/support

Tell the person that Mark asked you to call him.
 
Thank you @markjcrane

As in the first post, I cannot complete the upgrade schema process because of the PHP error:
Code:
 php /var/www/fusionpbx/core/upgrade/upgrade.php --types

[ Update ] Table, field structure and data types.

PHP Fatal error:  Uncaught TypeError: Cannot access offset of type string on string in /var/www/fusionpbx/resources/classes/schema.php:537
Stack trace:
#0 /var/www/fusionpbx/core/upgrade/upgrade.php(255): schema->schema()
#1 {main}
  thrown in /var/www/fusionpbx/resources/classes/schema.php on line 537

Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /var/www/fusionpbx/resources/classes/schema.php:537
Stack trace:
#0 /var/www/fusionpbx/core/upgrade/upgrade.php(255): schema->schema()
#1 {main}
  thrown in /var/www/fusionpbx/resources/classes/schema.php on line 537

This is still relevant after a `git pull` as of now.

Now there's another problem. I cannot login to my panel at all, it says credentials are incorrect, although they're not. Looks like fail2ban banned our IP. All the clients got disconnected. I unbanned from the command line and added our IP to the whitelist. Then 2 of the clients came back online while the others cannot register anymore.

Since I cannot login, I tried renaming config file to have the installation script determine a new admin password, but it always inserts a new user entry to the `v_users` table in the database, leaving the previous entry for that user intact. I can never login with the new password either. I tried removing the old user from the database, letting the installation script add the new one, but still no use.

I also noticed that the existing passwords looks like argon hashed and no salt is present; but the new password that the installation hashes is hashed with md5 and there is a salt too. Meaning the existing user password in the database looks like this: `$2y$10$bRChaI.....` and the salt column is null, while the new user's password that is added by the installation script looks like: `0a1857f...` and there's also a salt similar to this hash. I tried different domain combinations, but nothing helps.

If there's something I can do now, please let me know, otherwise I will call you as you instructed.

Thanks a lot.
 
I think from the message it's likely you are on the master branch. Please update the source code and try again.

I'm no longer recommending fail2ban because it generates too many false positives. I would only use it to protect SSH at this point, as well as the web server (nginx), for handling a high volume of requests to the web server.
 
Last edited:
I've upgraded many people, and I'm confident that all issues on your list will be resolved once your code is updated. Running the upgrade scheme and data types is required.

My test machine is running PHP 8.2, the same version as you, and it is set up to show all errors by default. On the latest code, I'm not able to find any errors on PHP 8.2.

I'm even willing to help you by phone if you call our support number +1 208 906 8227 and ask for Mark. I haven't received a call.
 
Last edited: