After installing the arimanager module fwconsole reload does not work

Hello everyone! Faced the other day with a problem, the description of which I did not find on the forum. I install FreePBX 15 from source. Everything worked fine until I needed to install the arimanager and asteriskinfo modules. The problem is in the arimanager module. After installing it, I do the

fwconsole chown && fwconsole reload

As a result, I get a 495 error from php-asmanager.php

[[email protected] asterisk]# fwconsole reload -vvvvvvvvv
Reload Started

In php-asmanager.php line 495:

[Whoops\Exception\ErrorException (2)]
fclose() expects parameter 1 to be resource, boolean given

Exception trace:
() at /var/www/html/admin/libraries/php-asmanager.php:495
Whoops\Run->handleError() at n/a:n/a
fclose() at /var/www/html/admin/libraries/php-asmanager.php:495
AGI_AsteriskManager->disconnect() at /var/www/html/admin/libraries/php-asmanager.php:257
AGI_AsteriskManager->send_request() at /var/www/html/admin/libraries/php-asmanager.php:597
AGI_AsteriskManager->Command() at /var/www/html/admin/modules/arimanager/Arimanager.class.php:155
Arimanager->genPassword() at /var/www/html/admin/modules/arimanager/Arimanager.class.php:353
Arimanager->genConfig() at /var/www/html/admin/libraries/BMO/FileHooks.class.php:97
FreePBX\FileHooks->processNewHooks() at /var/www/html/admin/libraries/BMO/FileHooks.class.php:26
FreePBX\FileHooks->processFileHooks() at /var/www/html/admin/libraries/Console/Reload.class.php:331
FreePBX\Console\Command\Reload->reload() at /var/www/html/admin/libraries/Console/Reload.class.php:90
FreePBX\Console\Command\Reload->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

reload [–json] [–dry-run] [–skip-registry-checks] [–dont-reload-asterisk]

If you use the --json option, the output will be like this:

[[email protected] asterisk]# fwconsole reload -vvvvvvvvv --json
{“message”:“Reload Started”}
Unable to connect to remote asterisk (does /var/run/asterisk/asterisk.ctl exist?)
{“message”:“Reload Complete”}

If you demolish the arimanager module, then everything starts working again.

This is not the end of my analysis of the problem. I found that in the case when the module is installed, and I do fwconsole reload, the following happens in the full Asterisk log:

  1. On the last line of this piece, the process freezes, Asterisk restarts.

[2020-06-09 17:21:32] VERBOSE[15757] asterisk.c: Remote UNIX connection
[2020-06-09 17:21:32] VERBOSE[15757] asterisk.c: Remote UNIX connection
[2020-06-09 17:21:32] VERBOSE[15886] asterisk.c: Remote UNIX connection disconnected
[2020-06-09 17:21:32] VERBOSE[15886] asterisk.c: Remote UNIX connection disconnected
[2020-06-09 17:21:32] VERBOSE[15757] asterisk.c: Remote UNIX connection
[2020-06-09 17:21:32] VERBOSE[15757] asterisk.c: Remote UNIX connection
[2020-06-09 17:21:32] VERBOSE[15892] asterisk.c: Remote UNIX connection disconnected
[2020-06-09 17:21:32] VERBOSE[15892] asterisk.c: Remote UNIX connection disconnected
[2020-06-09 17:21:32] VERBOSE[15757] asterisk.c: Remote UNIX connection
[2020-06-09 17:21:32] VERBOSE[15757] asterisk.c: Remote UNIX connection
[2020-06-09 17:21:32] VERBOSE[15894] asterisk.c: Remote UNIX connection disconnected
[2020-06-09 17:21:32] VERBOSE[15894] asterisk.c: Remote UNIX connection disconnected
[2020-06-09 17:21:32] VERBOSE[15757] asterisk.c: Remote UNIX connection
[2020-06-09 17:21:32] VERBOSE[15757] asterisk.c: Remote UNIX connection
[2020-06-09 17:21:32] VERBOSE[15896] asterisk.c: Remote UNIX connection disconnected
[2020-06-09 17:21:32] VERBOSE[15896] asterisk.c: Remote UNIX connection disconnected

  1. After freezing, it is clear that Asterisk restarts and the log continues on, eventually Asterisk gets up, but the problem is not solved. The full log is quite voluminous, so I won’t upload all of it here.

[2020-06-09 17:21:39] Asterisk 16.9.0 built by root @ headstack on a x86_64 running Linux on 2020-06-08 11:11:46 UTC
[2020-06-09 17:21:39] Asterisk 16.9.0 built by root @ headstack on a x86_64 running Linux on 2020-06-08 11:11:46 UTC
[2020-06-09 17:21:39] VERBOSE[15942] message.c: Message handler ‘dialplan’ registered.
[2020-06-09 17:21:39] VERBOSE[15942] message.c: Message handler ‘dialplan’ registered.
[2020-06-09 17:21:39] VERBOSE[15942] pbx_functions.c: Registered custom function ‘MESSAGE’
[2020-06-09 17:21:39] VERBOSE[15942] pbx_functions.c: Registered custom function ‘MESSAGE’
[2020-06-09 17:21:39] VERBOSE[15942] pbx_functions.c: Registered custom function ‘MESSAGE_DATA’
[2020-06-09 17:21:39] VERBOSE[15942] pbx_functions.c: Registered custom function ‘MESSAGE_DATA’
[2020-06-09 17:21:39] VERBOSE[15942] pbx_app.c: Registered application ‘MessageSend’
[2020-06-09 17:21:39] VERBOSE[15942] pbx_app.c: Registered application ‘MessageSend’
[2020-06-09 17:21:39] VERBOSE[15942] manager.c: Manager registered action MessageSend
[2020-06-09 17:21:39] VERBOSE[15942] manager.c: Manager registered action MessageSend
[2020-06-09 17:21:39] VERBOSE[15942] channel.c: Registered channel type ‘Surrogate’ (Surrogate channel used to pull channel from an application)
[2020-06-09 17:21:39] VERBOSE[15942] channel.c: Registered channel type ‘Surrogate’ (Surrogate channel used to pull channel from an application)
[2020-06-09 17:21:39] VERBOSE[15942] manager.c: Manager registered action BridgeTechnologyList
[2020-06-09 17:21:39] VERBOSE[15942] manager.c: Manager registered action BridgeTechnologyList
[2020-06-09 17:21:39] VERBOSE[15942] manager.c: Manager registered action BridgeTechnologySuspend
[2020-06-09 17:21:39] VERBOSE[15942] manager.c: Manager registered action BridgeTechnologySuspend
[2020-06-09 17:21:39] VERBOSE[15942] manager.c: Manager registered action BridgeTechnologyUnsuspend
[2020-06-09 17:21:39] VERBOSE[15942] manager.c: Manager registered action BridgeTechnologyUnsuspend
[2020-06-09 17:21:39] VERBOSE[15942] dns_core.c: Registered DNS resolver ‘system’ with priority ‘2147483647’
[2020-06-09 17:21:39] VERBOSE[15942] dns_core.c: Registered DNS resolver ‘system’ with priority ‘2147483647’

Colleagues, I ask for help in Troubleshoot.

Today I fixed this problem. The bottom line is that FreePBX does not notify the administrator that it lacks any Asterisk modules for the correct operation of FreePBX modules, and this, I think, is a big omission.

The problem was that FreePBX was missing some Asterisk modules, such as res_ari_mailboxes, res_mwi_external, res_mwi_external_ami. This did not allow the arimanager module to work correctly and caused an error. It is worth noting that recompiling Asterisk to hot with reinstalling the arimanager module did not give a result. The full reinstallation of Asterisk with the preliminary installation of the necessary modules and the complete reinstallation of FreePBX 15 helped.

I ask developers to consider in the future the possibility of checking the dependencies of FreePBX modules not only on other FreePBX modules, but also on Asterisk modules. As a last resort, it was possible to update the Wiki, to expand the documentation, because, for example, the arimanager module is very poorly documented, plus the documentation describes the old version of the module.

That’s interesting. Feel free to submit a bug issue here if you think implementing such a feature will help someone else out in the future: https://issues.freepbx.org

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