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

Hello,
I followed this tutorial to install Asterisk and FreePBX https://wiki.freepbx.org/display/FOP/Installing+FreePBX+14+on+CentOS+7

Right after FreePBX was installed successful (with ./install -n) I can go to web browser and access FreePBX interface where ask me to create default admin account.
Then if with or without creating admin account I reboot machine or do fwconsole restart. I’m getting:


Done. All modules installed.
Updating Hooks...Done
Done installing modules
Taking too long? Customize the chown command, See http://wiki.freepbx.org/display/FOP/FreePBX+Chown+Conf
Setting Permissions...
Setting base permissions...Done
Setting specific permissions...
 15410 [============================]
Finished setting permissions
Generating default configurations...
Finished generating default configurations
You have successfully installed FreePBX
[[email protected] freepbx]# fwconsole restart
Running FreePBX shutdown...

Stopping UCP Node Server
[>---------------------------] 1 sec
Stopped UCP Node Server
Shutting down Asterisk Gracefully. Will forcefully kill after 30 seconds.
Press C to Cancel
Press N to shut down NOW
[============================] < 1 sec
Running FreePBX startup...
Starting Asterisk...
[--------------->------------] 11 secs

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


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

I have CentOS 7.4, Asterisk 14.6.2, FreePBX 14.0.1.9, MariaDB 10.2.8

When I want to start asterisk -vvvvvc I’m getting:


Sorcery registered wizard 'bucket'
Sorcery registered wizard 'bucket_file'
Unable to load config file 'stasis.conf'
Could not load Stasis configuration; using defaults
  == Parsing '/etc/asterisk/logger.conf': Found
  == Parsing '/etc/asterisk/logger_general_additional.conf': Found
  == Parsing '/etc/asterisk/logger_general_custom.conf': Found
  == Parsing '/etc/asterisk/logger_logfiles_additional.conf': Found
  == Parsing '/etc/asterisk/logger_logfiles_custom.conf': Found
  == Message handler 'dialplan' registered.
  == Registered custom function 'MESSAGE'
  == Registered custom function 'MESSAGE_DATA'
  == Registered application 'MessageSend'
  == Manager registered action MessageSend
  == Manager registered action DataGet
  == Registered channel type 'Surrogate' (Surrogate channel used to pull channel from an application)
  == Manager registered action BridgeTechnologyList
  == Manager registered action BridgeTechnologySuspend
  == Manager registered action BridgeTechnologyUnsuspend
  == Registered DNS resolver 'system' with priority '2147483647'
 Asterisk Dynamic Loader Starting:
  == Parsing '/etc/asterisk/modules.conf': Found
[2017-09-27 13:51:01] NOTICE[6990]: loader.c:1367 load_modules: 6 modules will be loaded.
[2017-09-27 13:51:01] WARNING[6990]: loader.c:526 load_dynamic_module: Error loading module 'chan_local.so': /usr/lib64/asterisk/modules/chan_local.so: cannot open shared object file: No such file or directory
 Loading res_odbc.so.
  == Parsing '/etc/asterisk/res_odbc.conf': Found
  == Parsing '/etc/asterisk/res_odbc_custom.conf': Found
  == Parsing '/etc/asterisk/res_odbc_additional.conf': Found
[2017-09-27 13:51:01] NOTICE[6990]: res_odbc.c:617 load_odbc_config: Registered ODBC class 'asteriskcdrdb' dsn->[MySQL-asteriskcdrdb]
[2017-09-27 13:51:01] NOTICE[6990]: res_odbc.c:1093 load_module: res_odbc loaded.
  == res_odbc.so => (ODBC resource)
 Loading res_config_odbc.so.
  == res_config_odbc.so => (Realtime ODBC configuration)
 Loading cdr_adaptive_odbc.so.
  == Parsing '/etc/asterisk/cdr_adaptive_odbc.conf': Found
Floating point exception (core dumped)

and exiting from asterisk console.

from journal -xe I’m getting:


Sep 27 13:46:01 srvott012 systemd: Starting Session 6 of user asterisk.
Sep 27 13:46:01 srvott012 systemd: Removed slice User Slice of asterisk.
Sep 27 13:46:01 srvott012 systemd: Stopping User Slice of asterisk.
Sep 27 13:46:10 srvott012 mysqld: 2017-09-27 13:46:10 140702593267456 [Warning] Aborted connection 59 to db: 'asterisk' user: 'freepbxuser' host: 'localhost' (Got an error reading communication packets)
Sep 27 13:46:12 srvott012 kernel: traps: asterisk[6196] trap divide error ip:7f73dc6d761f sp:7ffee6c8a350 error:0 in libmyodbc5w.so[7f73dc6a9000+47000]
Sep 27 13:46:12 srvott012 abrt-hook-ccpp: Process 6196 (asterisk) of user 1000 killed by SIGFPE - dumping core
Sep 27 13:46:13 srvott012 mysqld: 2017-09-27 13:46:13 140702594176768 [Warning] Aborted connection 73 to db: 'asteriskcdrdb' user: 'freepbxuser' host: 'localhost' (Got an error reading communication packets)
Sep 27 13:46:14 srvott012 abrt-server: Executable '/usr/sbin/asterisk' doesn't belong to any package and ProcessUnpackaged is set to 'no'
Sep 27 13:46:14 srvott012 abrt-server: 'post-create' on '/var/spool/abrt/ccpp-2017-09-27-13:46:12-6196' exited with 1
Sep 27 13:46:14 srvott012 abrt-server: Deleting problem directory '/var/spool/abrt/ccpp-2017-09-27-13:46:12-6196'
Sep 27 13:46:17 srvott012 kernel: traps: asterisk[6274] trap divide error ip:7fdc0b76261f sp:7ffedaf8b730 error:0 in libmyodbc5w.so[7fdc0b734000+47000]
Sep 27 13:46:17 srvott012 abrt-hook-ccpp: Process 6274 (asterisk) of user 1000 killed by SIGFPE - ignoring (repeated crash)
Sep 27 13:46:17 srvott012 abrt-hook-ccpp: Saved core dump of pid 6274 to core.6274 at /tmp (36900864 bytes)
Sep 27 13:46:17 srvott012 mysqld: 2017-09-27 13:46:17 140702593570560 [Warning] Aborted connection 74 to db: 'asteriskcdrdb' user: 'freepbxuser' host: 'localhost' (Got an error reading communication packets)

Please help!

is asterisk running as root?

Thank you for fast answer.
When I do asterisk -vvvvvc and fwconsole restart I do from root account.

You have an Asterisk compile issue. Asterisk is crashing.

Asterisk running fine before I install FreePBX. I have a snapshot in this point. And it works even after I install freepbx but stop after fwconsole restart.

Ok but that doesn’t mean anything. Asterisk is running into a Floating point exception and crashing. Configuration files (even if corrupt) should never cause this. Hence why its an Asterisk “issue” and I say “issue” because really its your version of Asterisk that is corrupt on your system.

You can gather backtraces and look to see what the problem is but this isnt really a freepbx issue.

How I can isolate the problem? I return to snapshot and what I need to check that asterisk is well installed?

It seems to be a problem with new CentOS 7 kernel

We are using that in our distro as well and there are no issues.

I installed everything on Debian 8.9 and everything works fine. Don’t know where was the problem with CentOS7.