Asterisk 14 - UTC Time Zone - cant access system now

System was working. However times were wrong on voicemails. Went to System > Timezone and changed to USA - NY to match my location. Immediately got the message below. Rebooted server and went into bios. Was showing the UTC timezone. Corrected it. When I rebooted got this message and now I cant Access system.

/var/www/html/admin/libraries/BMO/View.class.php

/**
 * Set System Timezone
 */
public function setTimezone($timezone=null) {
    if(empty($timezone) && !empty($this->tz)) {
        return $this->tz;
    }
    date_default_timezone_set('UTC');
    $freepbxtimezone = $this->freepbx->Config->get('PHPTIMEZONE');
    $phptimezone = !empty($timezone) ? $timezone : $freepbxtimezone;
    $phptimezone = trim($phptimezone);
    $invalidtimezone = false;
    if(!empty($phptimezone)) {
        $tzi = \DateTimeZone::listIdentifiers();
        if(!in_array($phptimezone,$tzi)) {
            $invalidtimezone = $phptimezone;
            $timezone = 'UTC';
        }
        date_default_timezone_set($phptimezone);
    }
    if(!empty($invalidtimezone)) {
        //$this->nt->add_warning("framework", "TIMEZONE", _("Unable to set timezone"), sprintf(_("Unable to set timezone to %s because PHP does not support that timezone, the timezone has been temporarily changed to UTC. Please set the timezone in Advanced Settings."),$invalidtimezone), "config.php?display=advancedsettings", true, true);
    } else {
        //$this->nt->delete("framework", "TIMEZONE");
    }
    $this->tz = date_default_timezone_get();
    return $this->tz;
}

What message?

What you see was the code portion that covered the majority of the screen. Here is the Message.

Whoops\Exception\ErrorException
/var/www/html/admin/libraries/BMO/View.class.php153

After I corrected time in bios to USA Eastern time, I rebooted. the I get a CLI error when I try to log in:

Shown in this image:

What version of freepbx are you using?

The latest down load.

SNG7-FBBX-64Bit-1706-1

Freepbx 14.0.1.1
Linux 7.3
Asterisk 14

Update your framework… fwconsole ma update framework --edge

The command as written does nothing. from the command line I typed:

fwconsole ma update framework --edge

Received the same stack trace message.

Interestingly, I can not connect to the Admin Console, nor the User Console. However, my eyebeam soft phone is connected and registered and receiving calls.

Phone connectivity doesn’t rely on freepbx.

mysql
use asterisk;
UPDATE freepbx_settings SET value = 'UTC' where keyword = 'PHPTIMEZONE';
1 Like

tm1000 - I don’t understand how to do the update you are recommending. I was able to change time in my bios. Then got to the cli and updated my php.ini file from “/” to “America/New_York”. when I used the timedatectl command it was corrected. As soon as I started asterisk from the CLI it changed it back to 4 hours advanced. I then went to View.class.php file shown in the previous error picture and changed it there too. As soon as I start Asterisk, it changes it back and I cannot get into FreePBX to complete my set up.


Check out this thread from two weeks ago and see if it sounds familiar…

I dont understand how to process the instructions. Getting to the shell is no issue. If I type mysql from shell command it opens Mariadb. Where do I put the *? How do I get to sysadmin_options? etc…

Thanks for your help.

Please try the following from linux shell:

fwconsole mysql
select * from sysadmin_options where sysadmin_options.key like ‘tz%’;
You should see two entries:

±-------------±--------+
| key | value |
±-------------±--------+
| tz_continent | America |
| tz_region | Chicago |
±-------------±--------+

Please run the commands I posted from the cli. You are over complicating things. Mysql is Mariadb. Same thing. Just run the commands I posted in order. Don’t change anything anywhere else.

When you change php files you make it worse. Do what I said then upgrade framework because the issue was fixed here earlier in the week

It’s work for me, TKS