PBX unable to connect to Asterisk

I am conducting an upgrade to FreePBX 16 from 13 in the process of moving from one host to another. I restored the most recent FreePBX full backup on the new host. When I connect to the web console for FreePBX I see a red banner stating that: Cannot Connect to Asterisk.

I have checked that the secret in /etc/asterisk/manager.conf matches that returned by mysql -e 'select keyword,value from asterisk.freepbx_settings where keyword = "ampmgrpass";'. I have verified that asterisk is running as the asterisk user. I have reloaded asterisk using asterisk -x "core reload" .

When I open Advanced Settings that page is blank other than the header boilerplate and the navigation menu and buttons.

How is this fixed?

That typically means that asterisk is not running. You should be able to connect to the CLI and try and restart asterisk using fwconsole restart. If asterisk is failing to start look at /var/log/asterisk/full for any errors that may be preventing asterisk from starting.

You are right. Asterisk is not running.

Running Asterisk pre from Vega module
Running Vega Hooks
Starting Asterisk...
[--------------->------------] 1 min
In Start.class.php line 193:
  Unable to connect to Asterisk. Did it start?  
restart [-i|--immediate] [--] [<args>]...

# ll /var/log/asterisk/full
-rw-r----- 1 asterisk asterisk 0 Jul 19 03:44 /var/log/asterisk/full

The file full is empty. The last log file is /var/log/asterisk/full-20230718 and it was closed at 03:330 on the 18th.

. . .
[2023-07-18 03:33:02] VERBOSE[10423] asterisk.c: Remote UNIX connection
[2023-07-18 03:33:02] Asterisk 16.25.0 built by mockbuild @ jenkins7 on a x86_64 running Linux on 2022-04-04 06:59:31 UTC
[2023-07-18 03:33:02] VERBOSE[17228] logger.c: Asterisk Queue Logger restarted
[2023-07-18 03:33:02] VERBOSE[17228] asterisk.c: Remote UNIX connection disconnected
[2023-07-18 03:33:02] VERBOSE[10423] asterisk.c: Remote UNIX connection

Huh, that’s is weird.

What happens if you try to fully update the system?

yum update -y && fwconsole ma upgradeall

A long long recompile:

# yum update -y && fwconsole ma upgradeall
Loaded plugins: fastestmirror, versionlock
Loading mirror speeds from cached hostfile
sng-base                                                 | 3.6 kB     00:00     
sng-epel                                                 | 2.9 kB     00:00     
sng-extras                                               | 2.9 kB     00:00     
sng-pkgs                                                 | 3.4 kB     00:00     
sng-sng7php74                                            | 3.4 kB     00:00     
sng-updates                                              | 2.9 kB     00:00     
No packages marked for update
No repos specified, using: [standard,commercial,unsupported] from last GUI settings

Module(s) requiring upgrades: zulu
Upgrading module 'zulu' from 16.0.19 to 16.0.19
Downloading module 'zulu'
Processing zulu
Verifying local module download...Verified
Download completed in 5 seconds
Updating tables zulu_interactions_interaction_states, zulu_softphones, zulu_tokens, zulu_interactions_contacts, zulu_interactions_interactions, zulu_interactions_owners, zulu_interactions_members, zulu_interactions_streams, zulu_interactions_stream_bodies, zulu_interactions_stream_links, zulu_interactions_stream_actions, zulu_login_tokens, zulu_mobile_tokens...Done
Installing/Updating Required Libraries. This may take a while...The following messages are ONLY FOR DEBUGGING. Ignore anything that says 'WARN' or is just a warning
npm WARN deprecated [email protected]: Package no longer supported. Contact [email protected] for more info.
npm WARN deprecated [email protected]: This version of 'is-buffer' is out-of-date. You must update to v1.1.6 or newer
Installed npm-cache v0.7.0
Running installation..
. . .
added 401 packages from 335 contributors and audited 405 packages in 884.566s
found 54 vulnerabilities (2 low, 19 moderate, 23 high, 10 critical)
  run `npm audit fix` to fix them, or `npm audit` for details
[npm-cache] [INFO] [npm] installed npm dependencies, now archiving
[npm-cache] [INFO] [npm] archiving dependencies from /var/www/html/admin/modules/zulu/node/node_modules
[npm-cache] [INFO] [bower] Dependency config file /var/www/html/admin/modules/zulu/node/bower.json does not exist. Skipping install
[npm-cache] [INFO] [npm] installed and archived dependencies
[npm-cache] [INFO] successfully installed all dependencies

Finished updating libraries!
Stopping old running processes...Zulu Server is not running
Migrating Let's Chat Data to Zulu...

> [email protected] migrate /var/www/html/admin/modules/zulu/node
> node ./scripts/etl_xmpp_zulu.js

Total of rooms:  0
Migration from XMPP to Zulu done succesfully
Generating CSS...Done
Module zulu version 16.0.19 successfully installed
Updating Hooks...Done
Chowning directories...Done
All upgrades completed successfully!
Updating Hooks...Done
Chowning directories...Done

And fwconsole restart still not working?

Running Asterisk pre from Vega module
Running Vega Hooks
Starting Asterisk...
[--------------->------------] 2 mins
In Start.class.php line 193:
  Unable to connect to Asterisk. Did it start?  

restart [-i|--immediate] [--] [<args>]...

# ll /var/log/asterisk/full
-rw-r----- 1 asterisk asterisk 0 Jul 19 03:44 /var/log/asterisk/full

No. Asterisk does not restart and there are no log entries.


Jul 20 15:47:24 freepbx php: Unable to see safemode in services.. Sleeping 5 seconds and retrying

What do you get when you try to launch asterisk directly?

asterisk -c

asterisk -c
Asterisk already running on /var/run/asterisk/asterisk.ctl. Use ‘asterisk -r’ to connect.

asterisk -r
Asterisk 16.30.0, Copyright (C) 1999 - 2021, Sangoma Technologies Corporation 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 16.30.0 currently running on inet29 (pid = 14724)
[Jul 20 12:03:04] NOTICE[22446]: manager.c:3520 authenticate: tried to authenticate with nonexistent user 'administrator'
[Jul 20 12:03:04] NOTICE[22446]: manager.c:3557 authenticate: failed to authenticate as 'administrator'

Is this running Sangoma OS or a custom install on another OS? It looks like it’s already running/trying to start but running into some sort of auth issues.

To be honest I am not sure how it got to this point just from restoring from backup.

I do not know either. But the problem did not arise until after the restore. But it was some time after as I did not work at 03:33.

The question is, where is the administrator user name and password set?

Honestly, I am not sure what administrator user account it’s asking for there.

This is a new host which has only had the FreePBX 16 distro installed with all defaults.

I seem to have solved this by adding the following entries into /etc/asterisk/manager.conf:

. . .
secret = xxxxxxxxxxxxxx
read = system,call,log,verbose,command,agent,user,config,command,dtmf,reporting,cdr,dialplan,originate,message
write = system,call,log,verbose,command,agent,user,config,command,dtmf,reporting,cdr,dialplan,originate,message
writetimeout = 5000
. . .

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.