exception caught: DB: update insert: : 1062: Duplicate entry

Hi, I'm using gps 1.004, with the following configuration:


on Fedora Core 3.

I keep getting the exception:

exception caught: DB: update insert: : 1062: Duplicate entry 'email@domain.net-bounce-928-51309@rennlist.org-64-145-15-200' for key 1 INSERT INTO triplet VALUES ('rennlist.com','bounce-928-51309@rennlist.org','email@domain.net',64,145,15,2
00,0,1142264306), continuing with 'dunno'

This is because the reverse lookup of the client address randomly gives one of these names:

[~] phl| host is an alias for 200.192-
200.192- domain name pointer rennlist.rennlist.com.
200.192- domain name pointer rennlist.rennlist.org.
200.192- domain name pointer www.rennlist.com.
200.192- domain name pointer www.rennlist.org.
200.192- domain name pointer news.rennlist.org.
200.192- domain name pointer rennlist.com.

and I already have an entry in the triplet table for "rennlist.org".


Hi greg,
with phpmyadmin you can repair your table.
Operations --> repair table


I don't think it's about repairing the table. The primary key which must be unique consists of "sender-recipient-client_IP_address".

I have also noticed these on our systems, even in the new upcoming slightly improved gps version. So far I only have a theory that an email is sent twice pretty much at the same time. When the first gps process checks with the db, there is no entry yet. Meanwhile, a second gps process receives the same message (same key at least). It checks with the db. Still no record. The first gps process inserts the record into the db. Now, the second gps process tries also to insert the same record and that's where mysql complains.

If this is what actually happens - I still have to trace it through the logs - it would be almost correct behaviour. Or, at least I don't know how/what the second process should do better unless it checked with the first gps process somehow.

Let me know what you think

Correction that was wrong. I just traced one case through the logs. What happens is that (sorry to publish this on a public site):

# host domain name pointer smtp3.uk.deuba.com. domain name pointer loninmrp6.uk.db.com.

I always thought reverse DNS entries had to unique...

I ended up changing the format of the DB for reverse operation to fix this problem.
If I could figure out how to attach the diffs I would. If someone wants them let me know.

I want to see this diffs. I found some mail servers with several reverse DNS entries. And the error is the same.

Thank you.