Reload failed because retrieve_conf encountered an error: 9

Hello,
Clean Install from source freepbx-2.10.0 , asterisk 1.8.20.1. CentOS release 6.4 x86_64 (VPS).
It seems everything is working on GUI , except “applay config”.
After clicking it, GUI freezes and 3 processes are created:

20395 ? S 0:00 sh -c /var/lib/asterisk/bin/retrieve_conf 2>&1
20396 ? Ss 0:00 /usr/bin/php -q /var/lib/asterisk/bin/retrieve_conf
20398 ? S 0:00 /usr/bin/php -q /var/lib/asterisk/bin/retrieve_conf

and after some time I get popup window with error:

Error: Did not receive valid response from server

XHR response code: 0 XHR responseText: undefined jQuery status: timeout

I’ve to manually kill those 3 processes to go back live GUI.

I’ve tried reinstalling freepbx-2.9.0 and freepbx-2.11.0.
I’ve tried lighthttpd also , but same error.

running manualy script throws no errors.

sudo -u asterisk /var/lib/asterisk/bin/retrieve_conf

Added to globals: ASTETCDIR = /etc/asterisk
Added to globals: ASTMODDIR = /usr/lib/asterisk/modules
Added to globals: ASTVARLIBDIR = /var/lib/asterisk
Added to globals: ASTAGIDIR = /var/lib/asterisk/agi-bin
Added to globals: ASTSPOOLDIR = /var/spool/asterisk
Added to globals: ASTRUNDIR = /var/run/asterisk
Added to globals: ASTLOGDIR = /var/log/asterisk
Added to globals: CWINUSEBUSY = true
Added to globals: AMPMGRUSER = admin
Added to globals: AMPMGRPASS = amp111
Added to globals: AMPDBENGINE = mysql
Added to globals: AMPDBHOST = localhost
Added to globals: AMPDBNAME = asterisk
Added to globals: AMPDBUSER = xxxxxxxxxxxx
Added to globals: AMPDBPASS = xxxxxxxx
Added to globals: VMX_CONTEXT = from-internal
Added to globals: VMX_PRI = 1
Added to globals: VMX_TIMEDEST_CONTEXT =
Added to globals: VMX_TIMEDEST_EXT = dovm
Added to globals: VMX_TIMEDEST_PRI = 1
Added to globals: VMX_LOOPDEST_CONTEXT =
Added to globals: VMX_LOOPDEST_EXT = dovm
Added to globals: VMX_LOOPDEST_PRI = 1
Added to globals: MIXMON_DIR =
Added to globals: MIXMON_POST =
Please update your modules and reload Asterisk by browsing to your server.

any help would be appreciated.

Solved.

In /var/www/html/admin/functions.inc.php file , there is line:

$retrieve = $setting_ampbin . ‘/retrieve_conf 2>&1’;

I’ve replaced it with this one , and my issue is now solved.

$retrieve = $setting_ampbin . '/retrieve_conf > /dev/null 2> /dev/null < /dev/null ';

Seriously,

Thanks for the resolution to the problem. I was getting the same error and I scoured the Internet for a solution. Yours is the only working one I could find.

THis is a terrible idea. You need to fix your configuration problem (enable debug and find out why Asterisk is not returning from a reload).

I highly recommend not to make this change and you can count on not receiving support for a system with this change.