[Spce-user] Adding peer gives 'Duplicate entry error

Andrew Pogrebennyk apogrebennyk at sipwise.com
Fri Mar 7 07:05:19 EST 2014

Hi John,

On 03/06/2014 05:16 PM, John Murray wrote:
> We have 5 peers and there is no duplication. Looking at the database the
> gateway id go only to 7 so the entry of ‘113’ seems not to match.
> There is a trigger on the provisioning. voip_peer_hosts table that does
> an insert into provisioning.voip_peer_preferences which does have an id
> of 112 so maybe that is the problem.

That's right - there's an old issue where mysql triggers do not work for
cascaded delete. We fixed the trigger itself back in December in
ngcp-db-schema 3.1.5, but forgot to clean up the stale records from
kamailio DB. Will fix it today.

In the meantime, you can fix your DB by running:
mysql -e "use kamailio; select * from peer_preferences where uuid not in
(select flags from lcr_gw);"

Thanks for the report!

More information about the Spce-user mailing list