Can't install FreePBX 13

Re: [FREEPBX-11503] FreePBX 13 "Can Not Connect to Asterisk" using Asterisk version 13.7.2 - Sangoma Issue Tracker

Works fine on the distro. This is a user misconfiguration. Please bring this up in the forums.

Did you actually try to build a FreePBX 13 + Asterisk 13 system on Debian?

I’ve made no changes to my install scripts/procedure in many weeks, but a recent update to FreePBX 13 or Debian has resulted in FreePBX 13 reporting “Can Not Connect to Asterisk”. During FreePBX 13 installation, the following is reported, even though Asterisk was successfully installed and is running:

STARTING ASTERISK
Asterisk Started
Assuming you are Database Root
Checking if SELinux is enabled…Its not (good)!
No /etc/asterisk/asterisk.conf file detected. Installing…Writing /etc/asterisk/asterisk.conf…Done
Checking if Asterisk is running and we can talk to it as the ‘asterisk’ user…Done
Preliminary checks done. Starting FreePBX Installation
Checking if this is a new install…Yes (No /etc/amportal.conf file detected)
Database Root installation checking credentials and permissions…Connected!
Empty asterisk Database going to populate it
Empty asteriskcdrdb Database going to populate it
Initializing FreePBX Settings
.
.
.
Installing framework…
No directory /var/www/html/admin/modules/framework/amp_conf/htdocs, install script not needed
Generating CSS…Done
Module framework successfully installed
Updating Hooks…Done
Done
Generating default configurations…
Exception: Unable to connect to Asterisk Manager from /var/lib/asterisk/bin/retrieve_conf, aborting in file /var/lib/asterisk/bin/retrieve_conf on line 13
Stack trace:

  1. Exception->() /var/lib/asterisk/bin/retrieve_conf:13
    Finished generating default configurations
    Trusting FreePBX…Trusted
    Taking too long? Customize the chown command, See Sangoma Documentation
    Setting Permissions…
    .
    .
    .
    Module voicemail successfully installed
    Updating Hooks…Done
    Reloading FreePBX
    Error(s) have occured, the following is the retrieve_conf output:
    exit: 1
    Exception: Unable to connect to Asterisk Manager from /var/lib/asterisk/bin/retrieve_conf, aborting in file /var/lib/asterisk/bin/retrieve_conf on line 13
    Stack trace:
  2. Exception->() /var/lib/asterisk/bin/retrieve_conf:13
    Taking too long? Customize the chown command, See Sangoma Documentation
    Setting Permissions…

No other errors are reported during the FreePBX 13 / Asterisk 13 installation.

Asterisk is definitely running:

root@freepbx:~# asterisk -rvvvvv
Asterisk 13.7.2, Copyright (C) 1999 - 2014, Digium, Inc. and others.
Created by Mark Spencer [email protected]
Asterisk comes with ABSOLUTELY NO WARRANTY; type ‘core show warranty’ for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type ‘core show license’ for details.

Connected to Asterisk 13.7.2 currently running on freepbx (pid = 1602)
freepbx*CLI> core show sysinfo

System Statistics

System Uptime: 0 hours
Total RAM: 948140 KiB
Free RAM: 669576 KiB
Buffer RAM: 23844 KiB
Total Swap Space: 102396 KiB
Free Swap Space: 102396 KiB

Number of Processes: 159

and

root@freepbx:~# fwconsole restart
Running FreePBX shutdown…

Checking Asterisk Status…
Run Pre-Asterisk Shutdown Hooks

Shutting down Asterisk Gracefully…
Press C to Cancel
Press N to shut down NOW
Stopping Asterisk…
120/120 [============================] 100%
Asterisk Stopped Successfuly

Running Post-Asterisk Stop Scripts
Running FreePBX startup…
Taking too long? Customize the chown command, See Sangoma Documentation
Setting Permissions…
18319/18319 [============================] 100%
Finished setting permissions

Checking Asterisk Status…
Run Pre-Asterisk Hooks

Starting Asterisk…
100/100 [============================] 100%
Asterisk Started on 1798

Running Post-Asterisk Scripts

Your ticket specifically states this “FreePBX 13 “Can Not Connect to Asterisk” using Asterisk version 13.7.2”. Of which I verified is incorrect. You later go on to say “Problem did not exist with Asterisk 13.7.0”. So you are saying it’s an Asterisk change. Now you are saying it’s a FreePBX change. The ticket was closed because FreePBX 13 CAN connect to Asterisk 13.7.2 just fine.

Any chance you can give me a little help determining why the FreePBX 13 installer is:

Unable to connect to Asterisk Manager from /var/lib/asterisk/bin/retrieve_conf, aborting in file /var/lib/asterisk/bin/retrieve_conf on line 13

when Asterisk is definitely running and was verified as such at the beginning of the FreePBX installer:

STARTING ASTERISK
Asterisk Started
Assuming you are Database Root
Checking if SELinux is enabled…Its not (good)!
No /etc/asterisk/asterisk.conf file detected. Installing…Writing /etc/asterisk/asterisk.conf…Done
Checking if Asterisk is running and we can talk to it as the ‘asterisk’ user…Done
Preliminary checks done. Starting FreePBX Installation

So what you are saying now is that during an install freepbx can’t connect to ANY version of asterisk. That is not what the ticket says (specifically can’t connect to 13.7.2 but 13.7.0 is fine)

A couple of FreePBX 13 updates back, there was no problem with 13.7.0. When I tried to generate a new system using 13.7.2 and it failed as documented, I first assumed the problem was related to the Asterisk update. After opening a ticket, I discovered the problem also occurs with the current FreePBX 13 installer and 13.7.0 as well. You immediately closed the ticket, so I was unable to update it. Without knowing what your installer is doing differently between its initial check which is successful and its later check which is not, I’m at a loss as to where to look since there is no interruption of the FreePBX installer between the two checks. Asterisk was running when the FreePBX installer started and is still running after it fails.

When you say Asterisk 13 is fine with FreePBX 13, is that on an up-to-date Debian o/s?

I specifically said it works fine on the distro. We don’t activily test all other variants since they are not supported. Your ticket was closed after two developers were able to successfully connect to asterisk from freepbx

Rather than repeatedly stating that it works fine on your distro, would you please give me some assistance in order to determine why the FreePBX 13 installer is able to communicate with Asterisk when the installer starts up but later reports that it cannot on line 13 of /var/lib/asterisk/bin/retrieve_conf as documented above? There is no interruption of the installer between those checks and Asterisk appears to be fully operational before and after the FreePBX installer is run. Upon completion (ignoring the two exceptions during installation), FreePBX appears to be mostly normal except that it says it “Can Not Connect to Asterisk”. I could really use your help to direct me to where and what to look for as the cause of those exceptions.

It’s stating two different things. One is being able to talk to Asterisk through the binary. The other is being able to talk to it over the Manager connection.

You asked me “When you say Asterisk 13 is fine with FreePBX 13, is that on an up-to-date Debian o/s?”. I only answered what you asked.

What is required for the installer to be able to talk to Asterisk over the Manager connection? I’ve made no changes to my installation scripts (which follow the Debian instructions on your Wiki) in several months which built a working FreePBX 13/Asterisk 13 until a week or so ago, but there have been many updates to FreePBX 13 and Debian packages, I would appreciate some assistance with determining where a previously working Manager connection apparently has broken down.

/etc/asterisk/manager.conf or one of its includes must have an admin-level manager user configured with the same credentials as those listed in the AMPMGRUSER and AMPMGRPASS variables set in /etc/amportal.conf.

You probably just hosed up the manager.conf at some point and had wrong permissions on it so the installer couldn’t update it.

billsimon,

Thank you very much for your input. You were obviously on the right track.

When I did another install moments ago, I discovered the problem was, in fact, a FreePBX bug which was fixed just an hour ago in Framework 13.0.59:

Tarball install of FreePBX 13 broken due to Manager access

http://issues.freepbx.org/browse/FREEPBX-11523

No changes on my end and all is well again.

1 Like

Yes. That’s because that ticket provided useful details and did not blank state that FreePBX 13 could not connect to Asterisk 13.7.2 which was not the issue. It was not because of “manager access” but because manager won’t reload without having included files present.