Getting error after upgrading : [FATAL] Unable to connect to Asterisk Manager

Hi guys,

I just performed a manual upgrade using version upgrade scripts found here:
http://wiki.freepbx.org/display/PPS/FreePBX-Distro-5.211.65

My FreePBX version was 5.211.65-13 before the upgrade.

The script went smoothly, not reporting any error.

I rebooted the server and when I accessed the GUI, it was reporting the following error:

Error!
Reload failed because retrieve_conf encountered an error: 1
exit: 1
[FATAL] Unable to connect to Asterisk Manager from /var/lib/asterisk/bin/retrieve_conf, aborting
1 error(s) occurred, you should view the notification log on the dashboard or main screen to check for more details.

In the notification log of the dashboard it says this:

retrieve_conf failed, config not applied
Reload failed because retrieve_conf encountered an error: 1

Also the dashboard is reporting that Asterisk is not running.

Any idea what’s up?

What happens when you run fwconsole start. Also have to tried rebooting the server

Might be a good idea to set permissions

I think it’s fwconsole chown

I did a full reboot, that’s the first thing I tried.

Then I did a few commands just to make sure :slight_smile:

amportal chown
amportal restart
mysqlcheck --auto-repair -c -o --all-databases 

No changes at all.

FWCONSOLE doesn’t work at all, it is not recognized in console.

I tired to find any file called fwconsole and there’s no result…

Dammmmnnnnnn I just realized that the upgrade did NOT work…

[[email protected] UpgradeScripts]# cat /etc/schmooze/pbx-version
5.211.65-13

So I don’t know what happened… here’s a full dump of the script “log”

[[email protected] UpgradeScripts]# wget http://upgrades.freepbxdistro.org/stable/5.211.65/upgrade-5.211.65-13.sh
--2017-01-20 13:25:31--  http://upgrades.freepbxdistro.org/stable/5.211.65/upgrade-5.211.65-13.sh
Résolution de upgrades.freepbxdistro.org... 199.102.239.49
Connexion vers upgrades.freepbxdistro.org|199.102.239.49|:80...connecté.
requête HTTP transmise, en attente de la réponse...200 OK
Longueur: 14728 (14K) [application/x-sh]
Sauvegarde en : «upgrade-5.211.65-13.sh»

100%[==========================================================================================================================================================================>] 14 728      --.-K/s   ds 0s      

2017-01-20 13:25:32 (765 MB/s) - «upgrade-5.211.65-13.sh» sauvegardé [14728/14728]

[[email protected] UpgradeScripts]# chmod +x upgrade-5.211.65-13.sh 
[[email protected] UpgradeScripts]# ./upgrade-5.211.65-13.sh 
Check to make sure this is a FreePBX Distro system before executing
This appears to be a FreePBX Distro system as it has a Distro Version of 5.211.65-13

Your FreePBX Distro System is being upgraded to 5.211.65-13. Please standby...

mkdir: impossible de créer le répertoire « /usr/tmp/5.211.65-13 »: Le fichier existe
mkdir: impossible de créer le répertoire « /etc/schmooze »: Le fichier existe

STAGE 1 STARTING - GUI Modules


 Upgrade All FreePBX GUI Modules

no repos specified, using: [extended,standard,commercial] from last GUI settings

Up to date.
[FATAL] Unable to connect to Asterisk Manager from /var/lib/asterisk/bin/retrieve_conf, aborting
Error(s) have occured, the following is the retrieve_conf output:
exit: 1
[FATAL] Unable to connect to Asterisk Manager from /var/lib/asterisk/bin/retrieve_conf, aborting
no repos specified, using: [extended,standard,commercial] from last GUI settings

Up to date.
hostname: Unknown host
hostname: Unknown host
found language dir en_UK for pagingpro, not installed on system, skipping
found language dir es for pbdirectory, not installed on system, skipping
found language dir it for pbdirectory, not installed on system, skipping
found language dir ja for pbdirectory, not installed on system, skipping
found language dir en_GB for pbdirectory, not installed on system, skipping
found language dir es for speeddial, not installed on system, skipping
found language dir it for speeddial, not installed on system, skipping
found language dir en_GB for speeddial, not installed on system, skipping
[FATAL] retreive_conf failed to get engine information and cannot configure up a softwitch with out it. Error: ERROR-UNABLE-TO-PARSE
Error(s) have occured, the following is the retrieve_conf output:
exit: 1
[FATAL] Unable to connect to Asterisk Manager from /var/lib/asterisk/bin/retrieve_conf, aborting

Fetching FreePBX settings with gen_amp_conf.php..

SETTING FILE PERMISSIONS...................Done
Removing any dangling symlinks
Dangling symlinks removed

STAGE 1 COMPLETED - GUI Modules - Moving to Stage 2






















STAGE 2 STARTING - RPM's


 Replace repos with only FreePBX Distro since some people have added other repos which can break updates


Clean Yum just to make sure we have a fresh list

Loaded plugins: fastestmirror, kmod
Cleaning repos: base extras pbx schmooze-commercial updates
Cleaning up Everything
Cleaning up list of fastest mirrors

Moving to Next Step


 Checking to see if we need to update fail2ban-0.8.8-106
 updating fail2ban-0.8.8-106
Loaded plugins: fastestmirror, kmod
Determining fastest mirrors
base                                                                                                                                                                                         | 2.0 kB     00:00     
base/primary                                                                                                                                                                                 | 2.5 MB     00:06     
base                                                                                                                                                                                                      6402/6402
extras                                                                                                                                                                                       | 1.3 kB     00:00     
extras/primary                                                                                                                                                                               | 6.8 kB     00:00     
extras                                                                                                                                                                                                        15/15
pbx                                                                                                                                                                                          | 1.3 kB     00:00     
pbx/primary                                                                                                                                                                                  | 407 kB     00:01     
pbx                                                                                                                                                                                                       1647/1647
schmooze-commercial                                                                                                                                                                          | 1.3 kB     00:00     
schmooze-commercial/primary                                                                                                                                                                  |  26 kB     00:00     
schmooze-commercial                                                                                                                                                                                         172/172
updates                                                                                                                                                                                      | 1.3 kB     00:00     
updates/primary                                                                                                                                                                              | 644 kB     00:02     
updates                                                                                                                                                                                                   1456/1456
Setting up Install Process
Package matching fail2ban-0.8.8-108.shmz65.1.121.noarch already installed. Checking for update.
Nothing to do

 SCRIPT---FAILED ON STAGE 2--Failed to verify fail2ban-0.8.8-106 RPM was installed

Moving to Next Step

 Update all misc 6.5 RPM's
Loaded plugins: fastestmirror, kmod
Loading mirror speeds from cached hostfile
Setting up Update Process
No Packages marked for Update

Moving to Next Step


STAGE 2 COMPLETED - RPM's - Moving to Stage 3





















STAGE 3 STARTING - Misc Items


Moving to Next Step


Moving to Next Step


STAGE 3 COMPLETED - Misc Items - Moving to Stage 4






















STAGE 4 STARTING - Clean Up

 updatedb for locate command

 Restart incron to be safe


STAGE 4 COMPLETED - Clean Up - Moving to Stage 5






















STAGE 5 STARTING - Final Verifications


STAGE 5 COMPLETED - Final Verifications - Moving to Stage 6





















Fetching FreePBX settings with gen_amp_conf.php..

SETTING FILE PERMISSIONS...................Done
Removing any dangling symlinks
Dangling symlinks removed

Bonjour! (Hi!)

This didn’t start well since those two folders already existed when the system tried to create them…

I didn’t know you could set the distro to another locale like you did (it is set to French) but I am not sure it’s such a great thing since it makes it harder for other people to help you (with actually little gain to yourself) since not everyone here speaks French.

(I do and it’s actually my mother tongue…)

I would be tempted to remove that /usr/tmp/5.211.65-13 folder since it seems it should not be there but I am not sure about /etc/schmooze (and I don’t currently have access to my system to check what is in there…).

Good luck and have a nice day!

Nick

Damnit I just figured out I was trying to upgrade FROM 5.211.65-13 and TO 5.211.65-13…
I read the upgrade script page wrong, I thought you needed to select the version you were updating FROM… I’m retarded.
So I guess the script messed up my installation.

Now I’ve tried again with the appropriate script to be on latest version:
https://upgrades.freepbxdistro.org/stable/10.13.66/upgrade-10.13.66-1.sh

Now all hell broke loose.

My SQL tables are corrupt… everything is messed up.

Thank god this was a VM and I cloned it before upgrading.

Will revert back to the pre-war clone for now and will let go of running the newest version for a while.

You missed the important part:

All upgrades need to be installed in numeric ascending order. Do not skip any upgrade step. Upgrade scripts are not cumulative. Each upgrade script should be run in ascending order to get to the desired final version.

To upgrade from 5.211.65-13, you first need to run -14 and then -15 etc. up to -21. Then do the same thing again for the 6.12 branch, and then again for the 10.13 branch. You have dozens of scripts to run in sequence to get from where you are now.

Oh my GOD… man this seems like a gigantic task!

Wouldn’t it be quicker to somehow export all config and start over with a fresh install??

Possibly, you can migrate to a current system with this:
http://wiki.freepbx.org/display/PPS/Elastix+and+PBXinaFlash+to+FreePBX+Distro+Conversion+Tool

Ok so I just cloned my VM again and started with the very first script to upgrade from 5.211.65-13 to 5.211.65-14

Right off the bat I have the same problem, it whines that Asterisk is not running.

If I have to troubleshoot a few dozen of upgrades, I’ll kill myself.

I would like to do a clean install of the most recent version of FreePBX using the distro install.

What would be a best method to import all my settings from my actual FreePBX installation ?