After upgrade got critical system error during login at console

Hello,

Good day, any work around about this

** CRITICAL SYSTEM ERROR **

Unable to generate MOTD.
The /usr/sbin/fwconsole file is not accessible

You are likely to experience significant system issues.


| | __ ___ | _ | __ ) / /
| |
| '
/ _ / _ \ |
) | _ \ /
| || | | __/ __/ __/| |) /
|
| |
| _|_|| |__//_\

Interface eth0 IP: 192.168.255.19
Interface eth1 IP: 172.16.10.2

Please note most tasks should be handled through the FreePBX UI.
You can access the FreePBX GUI by typing one of the above IP’s in to your web br owser.
For support please visit http://www.freepbx.org/support-and-professional-service s

Thanks.

1 Like

Workaround is the wrong word. You need a fix. First thing I can think of is to try the command below.

chmod +x /usr/sbin/fwconsole

If that doesn’t work, please post the output of this command:

ls -lh /usr/sbin/fwconsole

Also, this belongs in Beta Program Issues - flagging for move

I dont have fwconsole under /usr/sbin,it resides at the following directories,

/usr/src/freepbx-13.0.1beta2/amp_conf/htdocs/admin/modules/framework/amp_conf/bin/fwconsole
/usr/src/freepbx-13.0.1beta2/amp_conf/bin/fwconsole

Ive create a symbolic link at /usr/sbin but I got the following error after executing the command

PHP Fatal error: Class ‘FreePBX\Console\Application\FWApplication’ not found in /usr/src/freepbx-13.0.1beta2/amp_conf/htdocs/admin/modules/framework/amp_conf/bin/fwconsole on line 65

Thanks again.

Basically you (or someone else) blew the install process or any upgrade process offered/followed.

Anyy way you figure it, creating a symlink to a broken program is a little Quixotean, no matter where you put it, no ?

I suggest you start over or experience the immediate pain of alpha software turning into beta software

FreePBX 12 should probably not be relied on for production systems yet, so unless you are in that place, just keep following . . ., They will fix it “soon” :wink:

I have to live with it and wait for the fix to come… Thanks anyway…

Including of course

Doesn’t sound like something i’d want to “live with”

No fix will come because it’s not a bug as dicko suggested

I’ve got just the same problem after applying the sequence of theese updates:
http://upgrades.freepbxdistro.org/stable/6.12.65/upgrade-6.12.65-28.sh
http://upgrades.freepbxdistro.org/stable/10.13.66/upgrade-10.13.66-1.sh

Is there any way to fix this? Thanks.

1 Like

I have the following on my 13 box:
lrwxrwxrwx 1 root root 31 May 26 06:57 /usr/sbin/fwconsole -> /var/lib/asterisk/bin/fwconsole

The file contents are below. Try creating the /var/lib file and then linking as described above AT YOUR OWN RISK
Remember: Always create a backup of your “stuff” before overwriting it.

#!/usr/bin/env php
<?php
$options = getopt("", array("fix_zend"));
/* Optional. It’s better to do it in the php.ini file */
date_default_timezone_set('America/Los_Angeles');

//Bootstrap to give access to FreePBX internals
$bootstrap_settings['freepbx_auth'] = false;
$bootstrap_settings['fix_zend'] = isset($options['fix_zend']);
//Wrapped in a global try catch incase of zend errors
try {
        if ([email protected]_once(getenv('FREEPBX_CONF') ? getenv('FREEPBX_CONF') : '/etc/freepbx.conf')) {
                include_once('/etc/asterisk/freepbx.conf');
        }
} catch(\Exception $e) {
        if(!isset($options['fix_zend']) && function_exists('SPLAutoloadBroken') && SPLAutoloadBroken()) {
                modgettext::push_textdomain("amp");
                echo _("Autoloader is damaged")."\n";
                $name = isset($argv[0]) ? basename($argv[0]) : "fwconsole";
                echo sprintf(_("Please run: %s --fix_zend"),$name)."\n";
                exit(5);
        } else {
                 throw $e;
        }
}

if(!isset($options['fix_zend']) && function_exists('SPLAutoloadBroken') && SPLAutoloadBroken()) {
        echo _("Autoloader is damaged")."\n";
        echo sprintf(_("Please run: %s --fix_zend"),basename($argv[0]))."\n";
        die();
}
if(isset($options['fix_zend'])) {
        if(SPLAutoloadBroken()) {
                die(_("Autoloader was damaged before we even started!")."\n");
        }
        //autoload our fix it classes now before autoloading breaks
        $mf = module_functions::create();
        error_reporting(0);
        $disable = null;
        if(!empty($zended) && is_array($zended)) {
                foreach($zended as $key => $file) {
                        if(file_exists($file)) {
                                bootstrap_include_hooks('pre_module_load', $key);
                                require_once($file);
                                bootstrap_include_hooks('post_module_load', $key);
                                if(SPLAutoloadBroken()) {
                                        $disable = $key;
                                        break;
                                }
                        }
                }
        }
        if(!empty($disable)) {
                echo sprintf(_("Disabling malfunctioning module: %s"),$disable)."\n";
                $mf->disable($disable, true);
                exec(__FILE__." --fix_zend",$o);
                foreach($o as $line) {
                        echo $line."\n";
                }
        }
        if(!SPLAutoloadBroken()) {
                die(_("There's nothing left to fix")."\n");
                exit(0);
        }
}

$webrootpath = (isset($amp_conf['AMPWEBROOT']) && !empty($amp_conf['AMPWEBROOT'])) ?  $amp_conf['AMPWEBROOT'] : '/var/www/html';
include $webrootpath .'/admin/libraries/FWApplication.class.php';
include $webrootpath .'/admin/libraries/FWHelper.class.php';
include $webrootpath .'/admin/libraries/FWList.class.php';

use Symfony\Component\Console\Application;
use FreePBX\Console\Command;
use FreePBX\Console\Application as App;

try {
        $amodules = FreePBX::Modules()->getActiveModules();
        $fbc = new App\FWApplication('FW Console - FreePBX Utility', getVersion());
        /*
        * Framework is not like the others so we load up framework classes first.
        */
        $fwcpath = $webrootpath . '/admin/libraries/Console';
        $fwclasses = scandir($fwcpath);
        foreach ($fwclasses as $class){
                if( substr($class , -9) !== 'class.php'){
                        continue;
                }else{
                        $ifile = $fwcpath . '/' . $class;
                        if(file_exists($ifile)) {
                                include $ifile;
                                $classname = substr($class ,0,-10);
                                $class = 'FreePBX\\Console\\Command\\' . $classname;
                                $fbc->add(new $class);
                        }
                }
        }

        /*
        * Dynamic Class Loader. This looks to enabled modules for a Console folder
        * Then loads any file.class.php files found in that subdir.
        * This doesn't really handle bad includes. If your include in bad
        * It will likely break everything!
        */
        foreach($amodules as $module){
                //Module Path
                $mpath = $webrootpath . '/admin/modules/' . $module['rawname'] . '/Console/';
                if (file_exists($mpath)){
                        //Class files
                        $cfiles = scandir($mpath);
                        foreach($cfiles as $class){
                                //ignore anything in this dir that is NOT class.php
                                if( substr($class , -9) !== 'class.php'){
                                        continue;
                                }else{
                                        $ifile = $mpath . '/' . $class;
                                        if(!file_exists($ifile)) {
                                                continue;
                                        }
                                        include $ifile;
                                        $classname = substr($class ,0,-10);
                                        $class = 'FreePBX\\Console\\Command\\' . $classname;
                                        if(!class_exists($class)) {
                                                continue;
                                        }
                                        modgettext::push_textdomain($module['rawname']);
                                        $fbc->add(new $class);
                                        modgettext::pop_textdomain();
                                }
                        }
                }
        }
        $fbc->run();
} catch(Exception $e) {
        echo $e->getMessage()."\n";
}

Exactly the same circumstances after these updates:

http://upgrades.freepbxdistro.org/stable/6.12.65/upgrade-6.12.65-28.sh
http://upgrades.freepbxdistro.org/stable/10.13.66/upgrade-10.13.66-1.sh

…exactly the same problem today.

Unable to generate MOTD.
The /usr/sbin/fwconsole file is not accessible

You are likely to experience significant system issues.

[[email protected] ~]# chmod +x /usr/sbin/fwconsole
chmod: cannot access `/usr/sbin/fwconsole’: No such file or directory
[[email protected] ~]#

Using these update scripts: http://wiki.freepbx.org/display/PPS/FreePBX-Distro-10.13.66

which fwconsole

locate fwconsole

Hi Andrew,

Thanks for your reply.

[[email protected] ~]# which fwconsole
/usr/bin/which: no fwconsole in (/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)
[[email protected]~]#

[[email protected] ~]# locate fwconsole
/usr/src/freepbx-13.0.151/amp_conf/bin/fwconsole
/usr/src/freepbx-13.0.151/amp_conf/htdocs/admin/modules/framework/amp_conf/bin/fwconsole
/var/www/html/admin/modules/versionupgrade/assets/images/13-8-fwconsole.png
[[email protected]~]#

Thanks :slight_smile:

Freepbx 13 is not installed. You can do it through the gui

Andrew,

Thanks for this, just for the purposes of my education, I thought that running the scripts would do that - I didn’t realise there was a need to do this on the GUI as well - have I got this wrong or are you trying to figure out a workaround for whatever is wrong? Do I then re-run the first upgrade script for Version 13?

Thanks.

This is a workaround.

Thanks for this - can you be sure that there will not be other problems at this time - would you say it’s worth continuing down this road - if it’s helpful to you I will…

Do you want me to run the same script again after using the PBX updater?

Thanks again for your time.

Do not run the script again. Also for liability reasons I can’t answer your other questions. Sorry.

Ah yes, I can see why that would be tricky to comment on, I was too vague. Could there be other problems solely related to the way the install has gone?

There shouldn’t be. If not we can guide you out