Unable to get into the asterisk CLI

Hey guys,

I just installed Centos7, FreePBX 13 and asterisk 13 for the first time, everything installed good. I followed this guide: https://www.powerpbx.org/content/asterisk-freepbx-install-guide-centos-v7-asterisk-v13-freepbx-v13

But I cannot access the CLI, Sometimes I get this error “Unable to connect to remote asterisk (does /var/run/asterisk/asterisk.ctl exist?)” when I run asterisk -r, but I keep trying then I am able to log in to the console. Once logged in it immediately disconnects. The file does exist and I have checked most files and they are all under asterisk.asterisk. What did I miss in the config?

My guess is that asterisk is crashing /var/log/messages might give a clue, as might /var/log/asterisk/full

kernel: asterisk[19783]: segfault at 48 ip 00007f5f6a67433e sp 00007ffc4fd5a730 error 4 in res_ari.so[7f5f6a66f000+d000] Jun 29 15:50:09 DC1-ESPBX abrt-hook-ccpp: Process 19783 (asterisk) of user 1000 killed by SIGSEGV - ignoring (repeated crash) Jun 29 15:50:09 DC1-ESPBX kernel: asterisk[19786]: segfault at 48 ip 00007fb5df3d033e sp 00007ffd8d708260 error 4 in res_ari.so[7fb5df3cb000+d000] Jun 29 15:50:09 DC1-ESPBX abrt-hook-ccpp: Process 19786 (asterisk) of user 1000 killed by SIGSEGV - ignoring (repeated crash) Jun 29 15:50:09 DC1-ESPBX abrt-hook-ccpp: Saved core dump of pid 19783 to core.19783 at /tmp (104316928 bytes) Jun 29 15:50:09 DC1-ESPBX dbus[619]: [system] Activating service name='org.freedesktop.problems' (using servicehelper) Jun 29 15:50:09 DC1-ESPBX dbus-daemon: dbus[619]: [system] Activating service name='org.freedesktop.problems' (using servicehelper) Jun 29 15:50:09 DC1-ESPBX dbus[619]: [system] Successfully activated service 'org.freedesktop.problems' Jun 29 15:50:09 DC1-ESPBX dbus-daemon: dbus[619]: [system] Successfully activated service 'org.freedesktop.problems' Jun 29 15:50:10 DC1-ESPBX abrt-hook-ccpp: Saved core dump of pid 19786 to core.19786 at /tmp (103460864 bytes) Jun 29 15:50:11 DC1-ESPBX kernel: asterisk[19972]: segfault at 48 ip 00007fafb77df33e sp 00007ffc7157ef50 error 4 in res_ari.so[7fafb77da000+d000] Jun 29 15:50:11 DC1-ESPBX abrt-hook-ccpp: Process 19972 (asterisk) of user 1000 killed by SIGSEGV - ignoring (repeated crash) Jun 29 15:50:12 DC1-ESPBX abrt-hook-ccpp: Saved core dump of pid 19972 to core.19972 at /tmp (103120896 bytes) Jun 29 15:50:13 DC1-ESPBX kernel: asterisk[20044]: segfault at 48 ip 00007feaeb7df33e sp 00007fff93e993f0 error 4 in res_ari.so[7feaeb7da000+d000] Jun 29 15:50:13 DC1-ESPBX abrt-hook-ccpp: Process 20044 (asterisk) of user 1000 killed by SIGSEGV - ignoring (repeated crash) Jun 29 15:50:13 DC1-ESPBX abrt-hook-ccpp: Saved core dump of pid 20044 to core.20044 at /tmp (103833600 bytes) Jun 29 15:50:15 DC1-ESPBX kernel: asterisk[20115]: segfault at 48 ip 00007f69207c333e sp 00007fffbb1addc0 error 4 in res_ari.so[7f69207be000+d000] Jun 29 15:50:15 DC1-ESPBX abrt-hook-ccpp: Process 20115 (asterisk) of user 1000 killed by SIGSEGV - ignoring (repeated crash) Jun 29 15:50:15 DC1-ESPBX kernel: asterisk[20118]: segfault at 48 ip 00007feb4242e33e sp 00007ffef4464bc0 error 4 in res_ari.so[7feb42429000+d000] Jun 29 15:50:15 DC1-ESPBX abrt-hook-ccpp: Saved core dump of pid 20115 to core.20115 at /tmp (104357888 bytes) Jun 29 15:50:15 DC1-ESPBX abrt-hook-ccpp: Process 20118 (asterisk) of user 1000 killed by SIGSEGV - ignoring (repeated crash) Jun 29 15:50:15 DC1-ESPBX abrt-hook-ccpp: Saved core dump of pid 20118 to core.20118 at /tmp (103190528 bytes) Jun 29 15:50:17 DC1-ESPBX kernel: asterisk[20258]: segfault at 48 ip 00007faadde7533e sp 00007fff9e89b820 error 4 in res_ari.so[7faadde70000+d000] Jun 29 15:50:17 DC1-ESPBX abrt-hook-ccpp: Process 20258 (asterisk) of user 1000 killed by SIGSEGV - dumping core Jun 29 15:50:17 DC1-ESPBX abrt-server: Executable '/usr/sbin/asterisk' doesn't belong to any package and ProcessUnpackaged is set to 'no' Jun 29 15:50:17 DC1-ESPBX abrt-server: 'post-create' on '/var/spool/abrt/ccpp-2017-06-29-15:50:17-20258' exited with 1 Jun 29 15:50:17 DC1-ESPBX abrt-server: Deleting problem directory '/var/spool/abrt/ccpp-2017-06-29-15:50:17-20258' Jun 29 15:50:18 DC1-ESPBX kernel: asterisk[20333]: segfault at 48 ip 00007fabdd41533e sp 00007fff6437a450 error 4 in res_ari.so[7fabdd410000+d000] Jun 29 15:50:18 DC1-ESPBX abrt-hook-ccpp: Process 20333 (asterisk) of user 1000 killed by SIGSEGV - ignoring (repeated crash) Jun 29 15:50:19 DC1-ESPBX abrt-hook-ccpp: Saved core dump of pid 20333 to core.20333 at /tmp (103993344 bytes)

This is what I saw on messages, I dont have a var/log/asterisk/full, When I do asterisk -r i get SIP channel loading… then it just disconnects. BTW i skipped the PJSIP part, I do not want PJSIP. Can this be the issue?

Here seems to be the cause of your issue:

kernel: asterisk[19783]: segfault at 48 ip 00007f5f6a67433e sp 00007ffc4fd5a730 error 4 in res_ari.so[7f5f6a66f000+d000]

It is a known bug in FreePBX paired with Asterisk 13.16.
It should be resolved if you take file “ari.conf” from here and place it to /etc/asterisk.
Do not forget to change its owner to Asterisk user (usually “asterisk”).

Awesome, thank you Oleg, this resolved the issue.