PNP server process ended

Good day,

I am experiencing an issue with the sangoma-pnp-service not loading correctly, see spam from /var/log/messages:

Blockquote
Jan 30 18:25:26 phone sangoma_pnp: Starting Sangoma pnp_server
Jan 30 18:26:20 phone sangoma_pnp: Traceback (most recent call last):
Jan 30 18:26:20 phone sangoma_pnp: File “/usr/local/bin/pnp_server”, line 218, in
Jan 30 18:26:20 phone sangoma_pnp: sysadmin = get_sysadmin_settings()
Jan 30 18:26:20 phone sangoma_pnp: File “/usr/local/bin/pnp_server”, line 98, in get_sysadmin_settings
Jan 30 18:26:20 phone sangoma_pnp: dbh = get_db_handle()
Jan 30 18:26:20 phone sangoma_pnp: File “/usr/local/bin/pnp_server”, line 56, in get_db_handle
Jan 30 18:26:20 phone sangoma_pnp: db = MySQLdb.connect(host=fpbx[‘AMPDBHOST’], user=fpbx[‘AMPDBUSER’], passwd=fpbx[‘AMPDBPASS’], db=fpbx[‘AMPDBNAME’])
Jan 30 18:26:20 phone sangoma_pnp: KeyError: ‘AMPDBHOST’
Jan 30 18:26:20 phone init: sangoma-pnp-service main process ended, respawning

Blockquote

This process repeats every 30 seconds or so, generating quite a lot of data!

For reference, I am using PBX Firmware:10.13.66-22, FreePBX 13.0.193.

Steps I’ve taken to (unsuccessfully) resolve the issue:
Scan/repair mysq db
disable PnP service from FreePBX gui

Ideas? Any other data that would help in diagnosing this?

Log into the console as root and run ‘grep AMPDBHOST /etc/asterisk/*’ and see what pops up.

[root@phone log]# grep AMPDBHOST /etc/asterisk/*
/etc/asterisk/extensions_additional.conf:AMPDBHOST = localhost
[root@phone log]#

OK - that’s good. Most of the AMPDBHOST settings are also managed out of another config file. Do the same grep, but with just “AMPDB” instead of “AMPDBHOST”.

I’m wondering if there’s a problem with your DNS resolution or if the AMPDBHOST setting is getting messed up in some way. The error message indicates that something’s wrong with your AMBDHOST setting, and I’m just trying to get more information about your settings and config files.

[root@phone log]# grep AMPDB /etc/asterisk/*
/etc/asterisk/extensions_additional.conf:AMPDBENGINE = mysql
/etc/asterisk/extensions_additional.conf:AMPDBHOST = localhost
/etc/asterisk/extensions_additional.conf:AMPDBNAME = asterisk
/etc/asterisk/extensions_additional.conf:AMPDBUSER = freepbxuser
/etc/asterisk/extensions_additional.conf:AMPDBPASS =

btw, AMPDBPASS isn’t blank, but was redacted for forum purposes!

For the sake of forum completeness, I am reporting that my issue appears to be resolved, however I’m not 100% sure what I did to fix it!

Summarizing what I did:
Manually changed /etc/postfix/main.cf and master.cf to reflect some updates to our mail server (gui wasn’t cutting it)
Restarted postfix, forced the queue to process
Uninstalled module “Outbound Call Limit”

Not sure at which point it resolved, but it has been!

I am having the same issue on a brand new Sangoma Phone Systems 60 unit. Everything seems to work well but the PNP service is giving me the same errors and not showing on any of the Sangoma handsets. I have another FreePBX machine on my network with the same exact version (12.7.5-1807-1.sng7 ) which works perfectly fine and shows up on all the phones.

I can work around the issue with DHCP options etc… and things work fine but I don’t like having these errors on the system.
Any other ideas on where I can poke around to resolve this issue?

Dec 14 21:53:11 voip pnp_server: Starting Sangoma pnp_server
Dec 14 21:53:11 voip pnp_server: Traceback (most recent call last):
Dec 14 21:53:11 voip pnp_server: File “/usr/local/bin/pnp_server”, line 242, in
Dec 14 21:53:11 voip pnp_server: sysadmin = get_sysadmin_settings()
Dec 14 21:53:11 voip pnp_server: File “/usr/local/bin/pnp_server”, line 98, in get_sysadmin_settings
Dec 14 21:53:11 voip pnp_server: dbh = get_db_handle()
Dec 14 21:53:11 voip pnp_server: File “/usr/local/bin/pnp_server”, line 57, in get_db_handle
Dec 14 21:53:11 voip pnp_server: db = MySQLdb.connect(host=fpbx[‘AMPDBHOST’], user=fpbx[‘AMPDBUSER’], passwd=fpbx[‘AMPDBPASS’], db=fpbx[‘AMPDBNAME’])
Dec 14 21:53:11 voip pnp_server: KeyError: ‘AMPDBHOST’
Dec 14 21:53:11 voip systemd: sangoma-pnpd.service: main process exited, code=exited, status=1/FAILURE
Dec 14 21:53:11 voip systemd: Unit sangoma-pnpd.service entered failed state.

I am able to make the PnP service work by editing the /usr/local/bin/php_server file and making some changes to line 57.
I changed the line from
db = MySQLdb.connect(host=fpbx[‘AMPDBHOST’], user=fpbx[‘AMPDBUSER’], passwd=fpbx[‘AMPDBPASS’], db=fpbx[‘AMPDBNAME’])

to this.
db = MySQLdb.connect(host=‘192.168.1.50’, user=‘freepbxuser’, passwd=‘mypassword’, db=‘asterisk’)

then I restarted the service via
systemctl restart samgoma-pnpd

and now it works and provisions via PnP.

I know this is not smart because this file will probably get overwritten by an update at some point and I have no way of knowing if modifying this file will break something else in the system. For these reasons, I recommend backing up the original file.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.