Failed to copy from module agi-bin - retrieve.conf problem

The symptom of this in my case was failure of all extensions to ring…calls to sip extensions went straight to voicemail*. The problem was experienced with a new installation on a debian based OS (xandros) having used apt-get to install asterisk (via root) and then manual installation of a svn version of freepbx (also via root):
svn co freepbx-2.5

The fix was as simple as:
chown -R asterisk:asterisk /usr/share/asterisk

(although in alek’s case it would have been:
chown -R asterisk:asterisk /var/lib/asterisk )

Must remember to watch the freepbx notification panel!
*Edit: a message on the CLI which I think is related was:
"Returned from dialparties with no extensions to call and "DIALSTATUS: “) in new stack”

I was searching the forum for the error and found this. anyway the console displays chmod issues. as I am a complete noob I am lost at the root of the issue. the issue came after i changed amp admin pass to match with asterisk admin pass. I am using the asterisk now iso that istalls with cent 5.2 as for the rest a fail to have it at this time. I am supposing it has something to do with the recent change in passwords meaning i failed to change one somewhere. help?

I found this thread after researching similar issue. I am running Fedora 15 with FreePBX.

After using audit daemon I determined that asterisk was running with the root user and group id. Further look into /etc.init.d/asterisk found a bug:

 97         if [ $AST_USER ] ; then
 98                 AST_ARGS="$AST_ARGS -U $AST_USER"
 99         fi
100         if [ $AST_GROUP ] ; then
101                 AST_ARGS="$AST_ARGS -G $AST_GROUP"
102         fi
103         if [ $AST_CONFIG ]; then
104                 ASTARGS="$ASTARGS -C $AST_CONFIG"
105         elif [ $ALTCONF ]; then
106                 ASTARGS="$ASTARGS -C $ALTCONF"
107         fi

Above, set user/group id was setting variable AST_ARGS, but later ASTARGS was
used to set other arguments and start the asterisk.

Changing AST_ARGS into ASTARGS solved the problem.