Can't update to FreePBX 13 Alpha

Please help me understand what is going on here.

Did you not previously say “I repeated upgradeall, and now everything is working fine and up-to-date!”

Why are you doing this now?

OK I was mistaken, I didn’t check every single module, that was the reason I provided you wrong information.
Then I tried to update them via Module Admin and got that issues.
Now I am updating you with this information.

That was completely my fault, so please exuse me for this misunderstanding.
That’s it. Thanks a lot for your help and time spent.
Just for making it clear, is this bad or something?

Up to now no more issues was found, because all other modules are working fine.
Once again, thanks a lot for your help.

That sounds like a framework bug, The best idea is to stop using the command line, and go back to the GUI. If you have any further problems when using the GUI, there’ll be a lot more debugging there.

I get just the same errors in GUI, but with beautiful colorful CSS applied to it)

There will be a lot more information, with line numbers etc. That’s what we need.

GUI provides this:

Error(s) installing miscapps:
Failed to run installation scripts

Nothing else.

OK, there’s TWO bugs here. The first one is some debugging code I left in, that’s hiding the REAL error.

If you could edit this file:

/var/www/html/admin/libraries/modulefunctions.class.php

And on line 2320 change:

} catch(Exception $e) {
to
} catch(\PDOException $e) {

You’ll see the REAL error :sunglasses:

Thanks for that!

A new framework with the don’t-hide-errors will be released at some point, but I’ve just published a fixed Miscapps (13.0.2.1) that SHOULD fix the error.

Great, it did. Now it’s fixed! Thanks a lot, everything works fine now.

By the way, I like the new Bootstrap GUI, and slow-GUI problem was solved, now it is fast and neat and smart.

2 Likes

Hi - I had very similar errors while trying to upgrade from 12 to 13 following the instructions above…got several module errors which I couldn’t install individually. The GUI wouldn’t allow me to access module admin (said it wasn’t installed), then fwconsole started throwing a bunch of errors, so I just restored my system backup.

The FreePBX13 announcement says that the upgrade can be done through the GUI in Module Admin, but I don’t see that option anywhere, can you please let me know how to do this upgrade through the GUI?

Thanks!

It does not say that. It says soon that will be available. Please make sure to document errors and report them here. It helps all of us

Hi Andrew -

Thanks for your response.

In my first attempt, I was getting all the same errors Dvbnhbq was getting (same module upgrade fails), which I had attempted to upgrade individually as you suggested. However, after doing that, then trying the “fwconsole ma updateall” again, I was getting an error about PHP dynamically loaded extensions weren’t enabled (I don’t have the exact error anymore). It didn’t matter which fwconsole command I ran, I was getting the same error over and over. Couldn’t shut it down, a system restart didn’t help, so i was forced to do a system restore.

I have attempted the manual upgrade again, here are my steps and results:

Asterisk
FreePBX Framework version = 12.0.72
Running on Ubuntu 14.04

update admin set value = '13.0.0alpha1' where variable = 'version'

Then I threw in an amportal a r, and confirmed the sql change stuck by rerunning the select statement. Then,

amportal a ma upgrade framework


Please wait...

Downloading 7092940 of 7092940 (100%)            

Untaring..Done
Module framework successfully downloaded
installing files to /var/www/html..done
installing files to /var/lib/asterisk/bin..done
installing files to /var/lib/asterisk/agi-bin..done
Checking for upgrades..
1 found
Upgrading to 13.0.1alpha1..
-> Running PHP script /var/www/html/admin/modules/framework/upgrades//13.0.1alpha1/upgrade.php
Upgrading to 13.0.1alpha1..OK
framework file install done, removing packages from module
file/directory: /var/www/html/admin/modules/framework/amp_conf removed successfully
file/directory: /var/www/html/admin/modules/framework/upgrades removed successfully
file/directory: /var/www/html/admin/modules/framework/start_asterisk removed successfully
file/directory: /var/www/html/admin/modules/framework/install removed successfully
file/directory: /var/www/html/admin/modules/framework/installlib removed successfully
PHP Fatal error:  Uncaught exception 'Exception' with message 'Attempted to load /var/www/html/admin/libraries/BMO/Database.class.php but it didn't define the class Database' in /var/www/html/admin/libraries/BMO/Self_Helper.class.php:210
Stack trace:
#0 /var/www/html/admin/libraries/BMO/Self_Helper.class.php(100): Self_Helper->loadObject('Database')
#1 /var/www/html/admin/libraries/BMO/Self_Helper.class.php(36): Self_Helper->autoLoad('Database')
#2 /var/www/html/admin/libraries/BMO/FreePBX.class.php(84): Self_Helper->__get('Database')
#3 /var/www/html/admin/libraries/modulefunctions.class.php(1875): FreePBX::__callStatic('Database', Array)
#4 /var/www/html/admin/libraries/modulefunctions.class.php(1875): FreePBX::Database()
#5 /var/lib/asterisk/bin/module_admin(68): module_functions->install('framework', false)
#6 /var/lib/asterisk/bin/module_admin(184): doInstall('framework', false)
#7 /var/lib/asterisk/bin/module_admin(905): doUpgrade('framework', false)
#8 {main}
  thrown in /var/www/html/admin/libraries/BMO/Self_Helper.class.php on line 210
session unlocked!
/var/lib/asterisk/bin/freepbx_engine: line 781: syntax error near unexpected token `fi'
/var/lib/asterisk/bin/freepbx_engine: line 781: `                fi'

As you can see I got an error. I don’t recall if I got this the first time (before I system restored), but anyways I tried to keep going with your instructions.

Your next command was just “amportal” so I ran it and got this:

    Please wait...

!!!!amportal is depreciated. Please use fwconsole!!!!
forwarding all commands to 'fwconsole'
 ______             _____  ______   __
|  ____|           |  __ \|  _ \ \ / /
| |__ _ __ ___  ___| |__) | |_) \ V /
|  __| '__/ _ \/ _ \  ___/|  _ < > <
| |  | | |  __/  __/ |    | |_) / . \
|_|  |_|  \___|\___|_|    |____/_/ \_\
FW Console - FreePBX Utility version 13.0.1beta3.20

Usage:
 command [options] [arguments]

Options:
 --help (-h)           Display this help message
 --quiet (-q)          Do not output any message
 --verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
 --version (-V)        Display this application version
 --ansi                Force ANSI output
 --no-ansi             Disable ANSI output
 --no-interaction (-n) Do not ask any interactive question

Available commands:
 _completion   BASH completion hook.
 chown         Change ownership of files
 context       Shows the specified context from the dialplan
 cx            Shows the specified context from the dialplan
 dbug          Stream files for debugging
 debug         Stream files for debugging
 externalip    Get External IP
 extip         Get External IP
 help          Displays help for a command
 list          Lists commands
 m             Run a mysql Query:
 ma            Module Administration
 moduleadmin   Module Administration
 motd          Prints MOTD
 mysql         Run a mysql Query:
 r             Reload Configs
 reload        Reload Configs
 restart       Start Asterisk and run other needed FreePBX commands
 session       Manage Session
 set           View and update settings
 setting       View and update settings
 start         Start Asterisk and run other needed FreePBX commands
 stop          Stop Asterisk and run other needed FreePBX commands
 unlock        Unlock Session
 util          Common utilities

I wasn’t sure maybe you had meant amportal a r so I did that too

!!!!amportal is depreciated. Please use fwconsole!!!!
forwarding all commands to 'fwconsole'
Reloading FreePBX
Successfully reloaded

Then “fwconsole ma updateall”

No repos specified, using: [standard] from last GUI settings

Up to date.
Updating Hooks...Done

Which is a very different result from my first attempt. I wonder perhaps if some of the module upgrades were retained from my previous attempt…

I went into the GUI and it looks to be upgraded…but isn’t there supposed to be a toolbar along the top?

As you can see there is a module requiring updating, so when I click on the module admin link, i get this:

Actually any page I tried to load through the “search” field gave me that error or

"Module Access Denied

	This module appears to be installed and enabled but your user does not seem to have permission to access it.	"

And I’m back to where I was before (except now the fwconsole command is working.

Tried to reload with:

fwconsole restart

Running FreePBX shutdown...

Checking Asterisk Status...
sh: 1: /bin/env: not found
Asterisk Seems to be NOT running
Not running Pre-Asterisk Shutdown Hooks.
Running FreePBX startup...

Checking Asterisk Status...
sh: 1: /bin/env: not found
Run Pre-Asterisk Hooks

Starting Asterisk...
  99/100 [===========================>]  99%sh: 1: /bin/env: not found
 100/100 [============================] 100%Asterisk Failed to Start

also tried a

 fwconsole chown
Setting Permissions...
 14089/14089 [============================] 100%
Finished setting permissions
An error occurred while changing ownership /var/www/html/admin/modules/core/sounds/en/agent-login.sln
An error occurred while changing group /var/www/html/admin/modules/core/sounds/en/agent-login.sln
An error occurred while changing ownership /var/www/html/admin/modules/core/sounds/en/agent-logoff.sln
An error occurred while changing group /var/www/html/admin/modules/core/sounds/en/agent-logoff.sln
An error occurred while changing ownership /var/www/html/admin/modules/core/sounds/en/exited-vm-will-be-transfered.sln
An error occurred while changing group /var/www/html/admin/modules/core/sounds/en/exited-vm-will-be-transfered.sln
An error occurred while changing ownership /var/www/html/admin/modules/core/sounds/en/featurecode.sln
An error occurred while changing group /var/www/html/admin/modules/core/sounds/en/featurecode.sln
An error occurred while changing ownership /var/www/html/admin/modules/core/sounds/en/incoming-call-1-accept-2-decline.sln
An error occurred while changing group /var/www/html/admin/modules/core/sounds/en/incoming-call-1-accept-2-decline.sln
An error occurred while changing ownership /var/www/html/admin/modules/core/sounds/en/incoming-call-no-longer-avail.sln
An error occurred while changing group /var/www/html/admin/modules/core/sounds/en/incoming-call-no-longer-avail.sln
An error occurred while changing ownership /var/www/html/admin/modules/core/sounds/en/line-busy-transfer-menu.sln
An error occurred while changing group /var/www/html/admin/modules/core/sounds/en/line-busy-transfer-menu.sln
An error occurred while changing ownership /var/www/html/admin/modules/core/sounds/en/please-enter-your-extension-then-press-pound.sln
An error occurred while changing group /var/www/html/admin/modules/core/sounds/en/please-enter-your-extension-then-press-pound.sln
An error occurred while changing ownership /var/www/html/admin/modules/core/sounds/en/you-will-be-transfered-menu.sln
An error occurred while changing group /var/www/html/admin/modules/core/sounds/en/you-will-be-transfered-menu.sln
An error occurred while changing ownership /var/www/html/admin/modules/cxpanel/
An error occurred while changing group /var/www/html/admin/modules/cxpanel/
An error occurred while changing ownership /var/www/html/admin/modules/sms/ucp
An error occurred while changing group /var/www/html/admin/modules/sms/ucp
An error occurred while changing ownership /var/www/html/admin/modules/webrtc/ucp
An error occurred while changing group /var/www/html/admin/modules/webrtc/ucp
An error occurred while changing ownership /var/www/html/admin/modules/cxpanel/
An error occurred while changing group /var/www/html/admin/modules/cxpanel/
An error occurred while changing ownership /var/www/html/admin/modules/webrtc/ari/js/adaptor.js
An error occurred while changing group /var/www/html/admin/modules/webrtc/ari/js/adaptor.js
An error occurred while changing ownership /var/www/html/admin/modules/webrtc/ari/js/jssip-devel.js
An error occurred while changing group /var/www/html/admin/modules/webrtc/ari/js/jssip-devel.js
An error occurred while changing ownership /var/www/html/admin/modules/webrtc/ari/js/phone.js
An error occurred while changing group /var/www/html/admin/modules/webrtc/ari/js/phone.js
An error occurred while changing ownership /var/www/html/admin/modules/webrtc/ari/js/webrtc.js
An error occurred while changing group /var/www/html/admin/modules/webrtc/ari/js/webrtc.js
An error occurred while changing ownership /var/www/html/admin/modules/webrtc/ari/theme/webrtc.css
An error occurred while changing group /var/www/html/admin/modules/webrtc/ari/theme/webrtc.css
An error occurred while changing ownership /var/www/html/admin/modules/webrtc/ari/theme/webrtcimages
An error occurred while changing group /var/www/html/admin/modules/webrtc/ari/theme/webrtcimages
An error occurred while changing ownership /var/www/html/admin/modules/webrtc/ari/theme/webrtcsounds
An error occurred while changing group /var/www/html/admin/modules/webrtc/ari/theme/webrtcsounds
An error occurred while changing ownership /var/www/html/admin/modules/sipstation/bin/freepbx_sipstation_check
An error occurred while changing group /var/www/html/admin/modules/sipstation/bin/freepbx_sipstation_check
Removing dangling symlink /var/lib/asterisk/sounds/en/agent-login.sln which points to a file that no longer exists
Removing dangling symlink /var/lib/asterisk/sounds/en/agent-logoff.sln which points to a file that no longer exists
Removing dangling symlink /var/lib/asterisk/sounds/en/exited-vm-will-be-transfered.sln which points to a file that no longer exists
Removing dangling symlink /var/lib/asterisk/sounds/en/featurecode.sln which points to a file that no longer exists
Removing dangling symlink /var/lib/asterisk/sounds/en/incoming-call-1-accept-2-decline.sln which points to a file that no longer exists
Removing dangling symlink /var/lib/asterisk/sounds/en/incoming-call-no-longer-avail.sln which points to a file that no longer exists
Removing dangling symlink /var/lib/asterisk/sounds/en/line-busy-transfer-menu.sln which points to a file that no longer exists
Removing dangling symlink /var/lib/asterisk/sounds/en/please-enter-your-extension-then-press-pound.sln which points to a file that no longer exists
Removing dangling symlink /var/lib/asterisk/sounds/en/you-will-be-transfered-menu.sln which points to a file that no longer exists
Removing dangling symlink /var/www/html/admin/cxpanel which points to a file that no longer exists
Removing dangling symlink /var/www/html/admin/modules/ucp/htdocs/modules/Sms which points to a file that no longer exists
Removing dangling symlink /var/www/html/admin/modules/ucp/htdocs/modules/Webrtc which points to a file that no longer exists
Removing dangling symlink /var/www/html/cxpanel which points to a file that no longer exists
Removing dangling symlink /var/www/html/recordings/theme/js/adaptor.js which points to a file that no longer exists
Removing dangling symlink /var/www/html/recordings/theme/js/jssip-devel.js which points to a file that no longer exists
Removing dangling symlink /var/www/html/recordings/theme/js/phone.js which points to a file that no longer exists
Removing dangling symlink /var/www/html/recordings/theme/js/webrtc.js which points to a file that no longer exists
Removing dangling symlink /var/www/html/recordings/theme/webrtc.css which points to a file that no longer exists
Removing dangling symlink /var/www/html/recordings/theme/webrtcimages which points to a file that no longer exists
Removing dangling symlink /var/www/html/recordings/theme/webrtcsounds which points to a file that no longer exists
Removing dangling symlink /var/lib/asterisk/bin/freepbx_sipstation_check which points to a file that no longer exists

So my system is up and running still (calls are working), but something is now messed up with freepbx it seems.

Any help is appreciated!

Not sure what’s going on with your system.

I’ve run an internal version of version upgrader hundreds on times and never once ran into any of those issues.

Pretty sure all you need to do is logout and log back in. You have an invalid session/cookie on your hands. Maybe try a different browser to be safe

/bin/env missing is a major red flag. That’s a system wide problem.

Hi Andrew, thanks again for your help.

So this morning I was notified that there were 47 available updates online…logged into the gui and had access to the module admin page… “upgraded all” and processed.

Got the following errors in the upgrade:

FATAL ERROR
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'asterisk.userman_users' doesn't exist
Trace Back
/var/www/html/admin/modules/userman/install.php:76 die_freepbx()
  [0]: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'asterisk.userman_users' doesn't exist

/var/www/html/admin/libraries/modulefunctions.class.php:2369 include_once()
  [0]: /var/www/html/admin/modules/userman/install.php

/var/www/html/admin/libraries/modulefunctions.class.php:2321 module_functions-&gt;_doinclude()
  [0]: /var/www/html/admin/modules/userman/install.php
  [1]: userman

/var/www/html/admin/libraries/modulefunctions.class.php:1884 module_functions-&gt;_runscripts()
  [0]: userman
  [1]: install

/var/www/html/admin/page.modules.php:269 module_functions-&gt;install()
  [0]: userman
  [1]: 

/var/www/html/admin/config.php:350 include()
  [0]: /var/www/html/admin/page.modules.php

Then tried to apply the config and got this:

exit: 1
Exception: Unable to locate the FreePBX BMO Class 'Userman'A required module might be disabled or uninstalled. Recommended steps (run from the CLI): 1) fwconsole ma install userman 2) fwconsole ma enable userman in file /var/www/html/admin/libraries/BMO/Self_Helper.class.php on line 216
Stack trace:
  1. Exception->() /var/www/html/admin/libraries/BMO/Self_Helper.class.php:216
  2. FreePBX\Self_Helper->loadObject() /var/www/html/admin/libraries/BMO/Self_Helper.class.php:104
  3. FreePBX\Self_Helper->autoLoad() /var/www/html/admin/libraries/BMO/Self_Helper.class.php:37
  4. FreePBX\Self_Helper->__get() /var/www/html/admin/modules/fax/Fax.class.php:10
  5. Fax->__construct() /var/www/html/admin/libraries/BMO/Self_Helper.class.php:125
  6. FreePBX\Self_Helper->autoLoad() /var/www/html/admin/libraries/BMO/Self_Helper.class.php:37
  7. FreePBX\Self_Helper->__get() /var/www/html/admin/libraries/BMO/Hooks.class.php:199

Tried from the CLI:

fwconsole ma install userman

[FATAL] SQLSTATE[42S02]: Base table or view not found: 1146 Table 'asterisk.userman_users' doesn't exist 
    
Trace Back:

/var/www/html/admin/modules/userman/install.php:76 die_freepbx()
 [0]: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'asterisk.userman_users' doesn't exist

/var/www/html/admin/libraries/modulefunctions.class.php:2369 include_once()
 [0]: /var/www/html/admin/modules/userman/install.php

/var/www/html/admin/libraries/modulefunctions.class.php:2321 module_functions->_doinclude()
 [0]: /var/www/html/admin/modules/userman/install.php
 [1]: userman

/var/www/html/admin/libraries/modulefunctions.class.php:1884 module_functions->_runscripts()
 [0]: userman
 [1]: install

/var/www/html/admin/libraries/Console/Moduleadmin.class.php:196 module_functions->install()
 [0]: userman
 [1]: 

/var/www/html/admin/libraries/Console/Moduleadmin.class.php:866 FreePBX\Console\Command\Moduleadmin->doInstall()
 [0]: userman
 [1]: 

/var/www/html/admin/libraries/Console/Moduleadmin.class.php:87 FreePBX\Console\Command\Moduleadmin->handleArgs()

/var/www/html/admin/libraries/Composer/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:257 FreePBX\Console\Command\Moduleadmin->execute()

/var/www/html/admin/libraries/Composer/vendor/symfony/console/Symfony/Component/Console/Application.php:874 Symfony\Component\Console\Command\Command->run()

/var/www/html/admin/libraries/Composer/vendor/symfony/console/Symfony/Component/Console/Application.php:195 Symfony\Component\Console\Application->doRunCommand()

/var/www/html/admin/libraries/Composer/vendor/symfony/console/Symfony/Component/Console/Application.php:126 Symfony\Component\Console\Application->doRun()

/var/lib/asterisk/bin/fwconsole:119 Symfony\Component\Console\Application->run()

It doesn’t seem like fwconsole stop is working right yet either… still getting the “/bin/env” not found error… (which is true, the path is /usr/bin/env).

Any ideas now? Thanks Andrew!

Uninstall userman and reinstall it.

You need to fix your path for env manually

Thanks. I have created the symlink for env and now the fwconsole start/stop/etc functions are working.

I have deleted the userman module and tried to redownload and install it, I keep getting the same error that the [FATAL] SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘asterisk.userman_users’ doesn’t exist… does the userman module create that table, or is there another module that does that?

It is a “quirk” of centos that the linux standard env location (/usr/bin/env) is a symlink to /bin/env , perhaps Sangoma might consider fixing that for deployments not redhat based, /usr/bin/env would be fine for all

also I was just looking at the install.php for userman. Neither freepbx_users or userman_users tables exist in the asterisk database…

@braden not everything is in install.php something is very wrong with your system. please revert back to 12.

Since you looked at install.php you can see where it sets the tables up.

Ok I’ve gone through and updated numerous issues so make this process more seamless. Including fixing env placement.

The only one I can’t replicate is the userman issues. I have tried numerous things. It seems your database doesn’t want to allow creation of tables. Or there is db corruption.