Gossamer Forum
Home : Products : Gossamer Mail : Discussion :

MySQL Duplicate Entry Error

Quote Reply
MySQL Duplicate Entry Error
Hola Gossamer Fans,

Our server was rebooted today, and it appears our databases went out of sync. The error we receive when trying to send from inside GMail is:


GT::SQL::Driver::MYSQL (10856): Preparing query: INSERT INTO femail_msgsearch (msgsearch_body,msgsearch_header,msgsearch_mid,msgsearch_id) VALUES ('\n\n:\nThis message was sent using Sissify FeMail!\nGet your own at http://www.sissify.com\n','Return-Path: pookie@sissify.com\r\nDate: Sun, 15 Sep 2002 00:30:50 -0700\r\nFrom: "pookster" <pookie@sissify.com>\r\nSubject: 123\r\nTo: shanti@earthnow.org\r\nContent-Type: text/plain; charset="US-ASCII"\r\nContent-Transfer-Encoding: quoted-printable\r\nMime-Version: 1.0\r\nReply-To: pookie@sissify.com\r\n','835455',NULL) at /home/femail/public_html/admin/GT/SQL/Driver/MYSQL.pm line 35.

DBD::mysql::st execute failed: Duplicate entry '834705' for key 1 at /home/femail/public_html/admin/GT/SQL/Driver/MYSQL.pm line 113.


So I thought "I'll run /batch/tools/consistency.pl.. but it threw me this error:


GMail (11650): Unknown method 'export_to_level' called at /home/femail/public_html/admin/GMail.pm line 123.
BEGIN failed--compilation aborted at consistency.pl line 16.


How can I resync these databases to get our mail system back up? I have it turned off with about 14k people asking "When is it going to be up again?"

Thanks!

Diversity by Design
Post deleted by diversity In reply to
Quote Reply
What about those popbox.bak files? In reply to
Alex had written me back at about 2am in the morning (gosh!) and told us to run:

Quote:


It sounds like your mysql tables are corrupted. You should:


1. Shut down MySQL. 2. cd to the mysql database directory 3. Run as root: myisamchk -r *.MYI 4. Start up MySQL


and your indexes should be repaired and things back in shape.


That worked just dandy! Lesson being that I should have done it immediately after doing a large purge of users. Since we are on a fully managed server, it required Root.

But now I have a whole bunch of popbox.0000.bak files... about 300 of them that I need to run thru incoming.pl. How do you recommend we do this so we can get everyone their email when the system wasn't processing?

Thanks!

Diversity by Design
Quote Reply
Re: [diversity] What about those popbox.bak files? In reply to
How are you processing emails right now? Is it using mbox, or a shared pop account?

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] What about those popbox.bak files? In reply to
A shared mbox.. called "popbox". Guess I coulda called it something less confusing huh? Wink

Diversity by Design
Quote Reply
Re: [diversity] What about those popbox.bak files? In reply to
Hi,

I mean in the admin area, are you using Shared Mbox, or Shared POP?

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] What about those popbox.bak files? In reply to
A shared mbox.

Diversity by Design
Quote Reply
Re: [diversity] What about those popbox.bak files? In reply to
What you could do is:

1. Stop cron so that incoming.pl is not run.
2. Join all the .bak files into one new file (cat *.bak > import.mbox)
3. Stop sendmail so no new email is delivered (any incoming mail won't get lost, it will get delivered again once you start sendmail)
4. Move the existing mbox file to mbox.tmp
5. Move import.mbox to the name of your normal mbox file
6. Run incoming.pl
7. Move the mbox.tmp back to the normal mbox file.
8. Start sendmail
9. Start cron

Hope that makes sense. Let me know if you have any questions,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] What about those popbox.bak files? In reply to
Nice! It worked well.

If I may make a suggestion for future releases, a crontab'd script that processes the "popbox.bak" files automatically would be good. It appears they appear often... as a lock or something. If it could be cleaned by cron occasionally, it would become a better system for the users... and um.. less admin for me!

Thanks!

Diversity by Design