Fwconsole failes to start aserisk

Hi

I’m having an issue with fwconsole starting asterisk in that it won’t. I can start it with systemd
I’ve tried to make sure all my modules are good I’m using asterisk 16.18.0

[root@server1 ~]# fwconsole start --skipchown --verbose
Running NL startup…
Starting Asterisk…
[--------------->------------] 31 secs
In Start.class.php line 193:

[Exception]
Unable to connect to Asterisk. Did it start?

Exception trace:
() at /var/www/html/admin/libraries/Console/Start.class.php:193
FreePBX\Console\Command\Start->startAsterisk() at /var/www/html/admin/libraries/Console/Start.class.php:131
FreePBX\Console\Command\Start->execute() at /var/www/html/admin/libraries/Composer/vendor/symfony/console/Command/Command.php:255
Symfony\Component\Console\Command\Command->run() at /var/www/html/admin/libraries/Composer/vendor/symfony/console/Application.php:960
Symfony\Component\Console\Application->doRunCommand() at /var/www/html/admin/libraries/Composer/vendor/symfony/console/Application.php:255
Symfony\Component\Console\Application->doRun() at /var/www/html/admin/libraries/Composer/vendor/symfony/console/Application.php:148
Symfony\Component\Console\Application->run() at /var/lib/asterisk/bin/fwconsole:163

start [–pre] [–post] [–skipchown] [–] []…

Check that the AMI credentials in /etc/asterisk/manager.conf match the values reported by running

 fwconsole setting --list |grep MGR

I think your onto someting.

Fwconsole mgr is reporting 2 admin users with different passwords.

whwere would the admin with a defautl of amp11 be coming from? I don’t see it in a config file.

| AMPMGRPASS | hiddden | amp111 |
| AMPMGRUSER | admin | admin |
| ASTMGRWRITETIMEOUT | 5000 | 5000

Your manager.conf file should look like this, with the only difference being that your password will match what fwconsole is reporting. Ignore the default settings that fwconsole shows:

# cat /etc/asterisk/manager.conf
;
; AMI - Asterisk Manager interface - Generated at 2020-07-15T15:03:34+00:00
;
; FreePBX needs this to be enabled. Note that if you enable it on a different IP, you need
; to assure that this can't be reached from un-authorized hosts with the ACL settings (permit/deny).
; Also, remember to configure non-default port or IP-addresses in amportal.conf.
;
; The AMI connection is used both by the portal and the operator's panel in FreePBX.
;
; FreePBX assumes an AMI connection to localhost:5038 by default.
;
[general]
enabled = yes
port = 5038
bindaddr = 0.0.0.0
displayconnects=no ;only effects 1.6+

[admin]
secret = <redacted>
deny=0.0.0.0/0.0.0.0
permit=127.0.0.1/255.255.255.0
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

#include manager_additional.conf
#include manager_custom.conf

Thats what i have.

Any other ideas?

i ran into a very similar problem yesterday.

i believe i had to fix the AMP User manually in the sql…

THIS MAY BREAK YOUR SYSTEM, AND I DO NOT ACCEPT RESPONSIBILITY IF IT DOES SO.
but yeah. on one of my installs, the “config files” did not have the same password as the database itself did.

for me, it was the below in command line.
again, your mileage may vary, and Dont do this if you dont understand it. (replace REDACTED with what you think your admin password should be)

mysql
show databases;
connect asterisk;'
select * from ampusers;
update ampusers set password_sha1 = SHA1('REDACTED') where username='admin';

replace REDACTED with the sha1 hash of the password you think it was

echo 'yourPassw0rD'|sha1sum

why not just use the build in sql?
SHA1('password_goes_here') works just fine

1 Like

I created an admin user and set the password but still doesn’t work.

where would fwconsole use it?

I am having the same error with asterisk not starting. I have checked the suggesting in this thread so far and my config looks correct.

you created an admin user? or you reset the existing admin user’s password?

can you check a few things:

cat /etc/asterisk/manager.conf | grep secret

^^ does that password match with:

cat /etc/amportal.conf | grep DBMGRPASS

if those match, try piping that through the below as root…
put the password from above her in place of password_here

mysql asterisk
update ampusers set password_sha1 = SHA1('password_here') where username='admin';
exit

then try to check asterisk -r and see if you see more “failed to connect” messages.

There is no need to touch mysql to resolve astman credential mismatch, it’s all done with fwconsole.

[root@uc-33435257 ~]# fwconsole setting --list | grep AMPMGR
| AMPMGRPASS                           | YJkyeii3t7Zc                                   | amp111                                        |
| AMPMGRUSER                           | admin                                          | admin                                         |

[root@uc-33435257 ~]# fwconsole setting AMPMGRPASS new_password
Changing "AMPMGRPASS" from [YJkyeii3t7Zc] to [new_password]

[root@uc-33435257 ~]# fwconsole setting --list | grep AMPMGR
| AMPMGRPASS                           | new_password                                   | amp111                                        |
| AMPMGRUSER                           | admin                                          | admin                                         |
2 Likes

cat /etc/asterisk/manager.conf | grep secret | already matches the database.

cat /etc/amportal.conf | grep DBMGRPASS returns nothing on any of my installs.

asterisk -r
Unable to connect to remote asterisk (does /var/run/asterisk/asterisk.ctl exist?)

are you not logged in with the root user? use sudo if not.

yes as root

What is the output of

fwconsole setting --list | grep ASTMANAGER

and the output of

asterisk -x "manager show settings"

[root@sip ~]# asterisk -x “manager show settings”
Unable to connect to remote asterisk (does /var/run/asterisk/asterisk.ctl exist?)
[root@sip ~]# fwconsole setting --list | grep ASTMANAGER
[root@sip ~]#