Freepbx does not write asterisk conf files

Hello,

I have an AsteriskNow box running FreePBX 2.9.0.7 and Asterisk 1.6.2.18. Some time in the last month or two, Freepbx stopped writing my conf files. I’ve removed any recently added modules but that made no difference. I can run retrieve_conf --debug with no errors reported (though it does report missing modules – queues, parkinglot, etc). On the main page, I do get an error about FOP server not being reloaded, but I expect that because I removed FOP in favor of FOP2.

I have confirmed that I can access the database using the username and password in amportal.conf, and the Asterisk Manager password matches that stored in the asterisk db. Also, in the asterisk db, the new incoming route that I added in Freepbx is present. However, this route is not being written to the extensions_additional.conf file.

So, the system seems to think it’s working, no errors being written out, but it’s not. Does anyone have idea what the issue might be, or even which direction to go in to fix this? I can’t think of anything more to check.

Thanks,

Just a wild stab in the dark but perhaps
amportal chown
amportal restart

Sorry, forgot to mention that I ran amportal chown as well, and checked all permissions. It’s been a couple of days digging so I didn’t remember all the details of what I’ve done.

Any ideas how to fix this would be appreciated. Anyone?

Recently upgraded frm 2.8 to 2.9 and no updates have check all even followed some questionable logic. Now I need help how does Freepbx write the info from Dahdi to Asterisk? Or how does it go frm my gui to Asterisk. Anyone?

Ed

Current Config:
CentOS 5.6
FreePBX 2.9.0.7
Aster 1.6.2.18
DAHDI 2.4.1.2
MySQL 14.12

Springerguy, DONT hijack a thread with a different issue than the thread contains.
DONT reply to this thread.

leehoewonek, have you tried to run retrieve_conf as user asterisk (or whatever user AsteriskNOW use)?

The files in /etc/asterisk, what users and group are assigned to them?

Hi Mikael,

All the files in /etc/asterisk are owned by asterisk:asterisk. When I run the retrieve_conf as asterisk, there are no errors, and the output ends with this.

processing DAYNIGHTTCHOOK =>
Table does not exist: queues_config
Table does not exist: meetme
Table does not exist: parkinglot
Notice: no iax trunks defined
Notice: no AMP Users defined
Table does not exist: custom
Table does not exist: custom
Table does not exist: custom
Table does not exist: custom
Please update your modules and reload Asterisk by browsing to your server.

Note, by default AsteriskNow sets the login for asterisk as /sbin/nologin, but that shouldn’t play a role in this problem. I had to change that to login, and while it was changed tried to apply the changes in Freepbx and still no results.

Very strange that no errors are reported anywhere.

I’ve begun hacking retrieve_op_conf_from_mysql.php to eliminate the ‘Table does not exist’ warnings shown above. I’m not sure if this will help, but we’ll see.

Does anyone have any other ideas I can at least look into? I’m stuck on this, as I’ve tried just about everything ever mentioned in association with this error.

Thanks,

Check your apache logs to see if you get anything abnormal warnings/errors when running from gui.

Try and move one of the files out from /etc/asterisk and see if it recreated.
Check your memory usage with the free command. You need at least 512 MB of memory with no memory in swap.

Hi Mikael,

There are no errors in the logs, memory usage is fine. Interesting thing, when I move extensions_additional.conf out of /etc/asterisk and hit the ‘reload’ button, the file is created but it is empty. This makes me think the data retrieval is failing, though I can login to the database and see the data manually. Have you seen this behavior before?

Thanks,

In Advanced Settings set the following:
Disable FreePBX dbug Logging = false
Check that Log Verbose Messages = true
Then Apply Changes.
Look in /tmp (or /var/log/asterisk) for the file freepbx.log and see if you can spot anything there.

Hi Mikael,

I found these in /tmp/freepbx_debug.log:

2011-Jul-03 18:01:49 /var/www/html/admin/libraries/php-asmanager.php:37
[NOTICE]: Undefined index: astspooldir

2011-Jul-03 18:01:57 /var/www/html/admin/libraries/php-asmanager.php:37
[NOTICE]: Undefined index: astspooldir

2011-Jul-03 18:02:02 /var/www/html/admin/libraries/php-asmanager.php:37
[NOTICE]: Undefined index: astspooldir

2011-Jul-03 18:02:03 /var/www/html/admin/modules/core/functions.inc.php:3915
[NOTICE]: Undefined variable: ringing

2011-Jul-03 18:02:03 /var/www/html/admin/libraries/php-asmanager.php:37
[NOTICE]: Undefined index: astspooldir

2011-Jul-03 18:02:06 /var/www/html/admin/libraries/php-asmanager.php:37
[NOTICE]: Undefined index: astspooldir

2011-Jul-03 18:02:06 /var/www/html/admin/libraries/php-asmanager.php:37
[NOTICE]: Undefined index: astspooldir

2011-Jul-03 18:02:06 /var/www/html/admin/modules/dahdiconfig/functions.inc.php:768
[NOTICE]: Undefined index: description

2011-Jul-03 18:02:07 /var/lib/asterisk/bin/retrieve_conf:712
[NOTICE]: Undefined index: astetcdir

2011-Jul-03 18:02:07 /var/lib/asterisk/bin/retrieve_conf:712
[WARNING]: fopen(/extensions_additional.conf): failed to open stream: Permission denied

I checked and amportal.conf has this:
ASTMANAGERHOST=localhost
ASTMANAGERPORT=5038
ASTMANAGERPROXYPORT=
ASTSTOPPOLLINT=2
ASTSTOPTIMEOUT=120
ASTAGIDIR=/var/lib/asterisk/agi-bin
ASTVARLIBDIR=/var/lib/asterisk
ASTETCDIR=/etc/asterisk
ASTLOGDIR=/var/log/asterisk
ASTMODDIR=/usr/lib/asterisk/modules
ASTRUNDIR=/var/run/asterisk
ASTSPOOLDIR=/var/spool/asterisk
QUEUES_SHARED_LASTCALL=TRUE
FORCED_ASTVERSION=
AMPASTERISKGROUP=asterisk
AMPASTERISKUSER=asterisk
AMPASTERISKWEBGROUP=asterisk
AMPASTERISKWEBUSER=asterisk

and the listing is:
-rw-r----- 1 asterisk asterisk 13221 Jul 3 18:02 /etc/amportal.conf

So it looks like these strings aren’t being sent to the retrieve_conf script, perhaps?

Thanks for the help with this - I’d really like to be able to configure with freepbx again.

I saw your suggestion in another post to add a print_r($asterisk_conf) to retrieve_conf, and the output shows a series of empty arrays:

Added to globals: MIXMON_POST =
Array
(
)
Array
(
)
Array
(
)
Array
(
)
Array
(
)

So something isn’t being set corretly. Any idea where I should look next?

Thanks,

I downloaded the latest tarball of freepbx, and re-ran amp_install, and now everything works. I’m not sure what had been buggered up, but I’ve confirmed that changes in incoming routes are now reflected in the appropriate conf files.

Thanks for the help on this - much appreciated.