Error(s) have occured, the following is the retrieve_conf output: exit: 255

Another employee here was making a few changes regarding extensions and this error came up when he tried to apply the changes. We have tried rebooting the server as well as trying to execute “amportal a r” which gives the below output:

-bash-4.1# amportal a r

Fetching FreePBX settings with gen_amp_conf.php..

Error(s) have occured, the following is the retrieve_conf output:
exit: 255
found language dir en_UK for broadcast, not installed on system, skipping
found language dir fr for directory, not installed on system, skipping
found language dir en_UK for pagingpro, not installed on system, skipping
Added to globals: VM_OPTS = s
Added to globals: VM_DDTYPE = u
Added to globals: VM_GAIN = 15
Added to globals: OPERATOR_XTN =
Added to globals: VMX_TIMEOUT = 5
Added to globals: VMX_REPEAT = 1
Added to globals: VMX_LOOPS = 1
Added to globals: VMX_OPTS_LOOP =
Added to globals: VMX_OPTS_DOVM =
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 = >>edited out
Added to globals: AMPDBENGINE = mysql
Added to globals: AMPDBHOST = localhost
Added to globals: AMPDBNAME = asterisk
Added to globals: AMPDBUSER = freepbxuser
Added to globals: AMPDBPASS = >>edited out
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 =
Added to globals: DIAL_OPTIONS = Ttr
Added to globals: TRUNK_OPTIONS = Tt
Added to globals: TRUNK_RING_TIMER = 300
Added to globals: MIXMON_FORMAT = gsm
Added to globals: REC_POLICY = caller
Added to globals: RINGTIMER_DEFAULT = 20
Added to globals: TRANSFER_CONTEXT = from-internal-xfer
PHP Fatal error:  Uncaught exception 'Exception' with message 'Endpoint  already exists.' in /var/www/html/admin/modules/core/functions.inc/PJSip.class.php:544
Stack trace:
#0 /var/www/html/admin/modules/core/functions.inc/PJSip.class.php(399): FreePBX\modules\Core\PJSip->generateEndpoint(Array, Array)
#1 /var/www/html/admin/modules/core/functions.inc/PJSip.class.php(86): FreePBX\modules\Core\PJSip->generateEndpoints(Array)
#2 /var/www/html/admin/libraries/BMO/FileHooks.class.php(92): FreePBX\modules\Core\PJSip->genConfig()
#3 /var/www/html/admin/libraries/BMO/FileHooks.class.php(25): FileHooks->processNewHooks()
#4 /var/lib/asterisk/bin/retrieve_conf(740): FileHooks->processFileHooks(Array)
#5 {main}
  thrown in /var/www/html/admin/modules/core/functions.inc/PJSip.class.php on line 544

Does anyone know how to solve this problem? Thanks!

That means that there’s an endpoint misconfiguration in Sip Settings -> PJSIP.

Have a look through there and make sure there aren’t any duplicates.

I just checked that page and all of the settings look normal. What is an endpoint? I have attached a screenshot of my below settings page for you to take a look at. Thanks man!

Hmm, looks good to me. Try clicking save on that page to reset all the settings, and then try a reload

Edit: Actually, as I look at the code, it might be more than that.

There actually should be a name there:

throw new \Exception("Endpoint $endpointname already exists.");

Which means it’s getting a BLANK endpoint name from somewhere. I’m impressed that you’ve managed to do that :sunglasses:

Have a look at Extensions, and make sure there’s not an empty one there, somehow.

It turns out what happened was one extension was changed from a PJSIP to a CHANSIP, which seemed to bug out the system. We ended up having to delete a bunch of extensions, and then we were able to Apply the changes without error. Then we put the extensions back, and everything works fine again.

1 Like