Failed to copy from module agi-bin. retrieve_conf.CPAGIBIN

Hi everybody!
First of all, I am a complete newbie about FreePBX and Asterisk…
This said, I’ll explain my problem.

I have an Ubuntu 10.04 machine, Asterisk 1.8 installed from a PPA and FreePBX latest version (2.8) installed from tarball.
To install FreePBX I followed these instructions:, modifying little details here or there…for example my webroot is /var/www/html and not /var/www/freepbx; also, in the howto talks about modifying panel.php, but i didn’t do it because it was already fixed.

My problem is that, in the FreePBX System Status page I have an error and I tried the whole afternoon to fix it, without success.

The error is:
"Failed to copy from module agi-bin.
Retrieve conf failed to copy file(s) from a module’s agi-bin dir:


I already read this other post:
and most of the checks that are said there are ok!
/var/lib/asterisk/bin/retrieve_conf returns, for asterisk user AND for www-data user the same output, which is the following:

PHP Deprecated: Comments starting with ‘#’ are deprecated in /etc/php5/cli/conf.d/mcrypt.ini on line 1 in Unknown on line 0
Checking for PEAR DB…OK
Checking for PEAR Console::Getopt…OK
Checking for /etc/amportal.conf …OK
Bootstrapping /etc/amportal.conf …OK
Parsing /etc/amportal.conf …OK
Parsing /etc/asterisk/asterisk.conf …OK
Connecting to database…OK
Connecting to Asterisk manager interface…OK
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 = /usr/share/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 = xxxxxxx
Added to globals: AMPDBENGINE = mysql
Added to globals: AMPDBHOST = localhost
Added to globals: AMPDBNAME = asterisk
Added to globals: AMPDBUSER = asteriskuser
Added to globals: AMPDBPASS = xxxxxxx
Notice: no Devices defined
Notice: no Queues defined
Notice: no Conferences defined
Notice: no Parking Lots defined
Notice: no sip trunks defined
Notice: no iax trunks defined
Notice: no AMP Users defined
Please update your modules and reload Asterisk by visiting

Also, the “amportal chown” script return “Permissions are OK”

Additionally, the command $ ls -l /usr/share | grep asterisk returns:
drwxr-xr-x 10 755 asterisk 4096 2011-01-21 12:58 asterisk

the same permissions are set for the whole /var/www/html directory and subdirs…

I am a little lost…can anybody help me? What am I doing wrong?
Thank you very much!


the place to report such things is in a trac ticket also as they often get missed in the forums.

There is a bug in the error reporting in retrieve_conf that prevents it from displaying the actual error and cause of this problem.

Change $cp_errors to $this->cp_errors on line 119 (in function cp_check_errors) and the error message should be much more informative.

One addition to the situation explained in the previous post.

I noticed that, if I run /var/lib/asterisk/retrieve_conf from root user and/or, I think, from asterisk user then, after 30 seconds more or less, the error in the FreePBX Notices desappear…but if I reload the page or click again FreePBX System Status, the error will reappear…
Still, I can’t understand WHICH permissions are used by WHICH user and WHEN!

The error says: Retrieve conf failed to copy file(s) from a module’s agi-bin dir

Is there a way at least to know WHAT is the files that it couldn’t copy? A log file somewhere?

Thank you very much.