Umh... I'm not migrating anything. Dbmail-util just trashed the message base
in it's standard lifecycle....

-----Messaggio originale-----
Da: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Per conto
di [EMAIL PROTECTED]
Inviato: lunedì 27 febbraio 2006 20.48
A: DBMail mailinglist
Oggetto: [Dbmail] help! :) --> dbmysql.c,db_query: mysql_real_query failed:
Cannot add or update achild row: aforeign key constraint fails

It looks like you have been systematically destroying your database.
Do you have a recent mysqldump or tarball of your database. It looks like 
that is what is needed.

dbmail-util does some good checks. Have you also tried the "Database 
Cleanup" function in DbMailAdministrator 
(http://library.mobrien.com/dbmailadministrator/) It has a couple extra 
relationship checks.

If you read about mysql replication you will also run into what the MySQL 
experts suggest as the best way to migrate databases. 
http://dev.mysql.com/doc/refman/5.0/en/replication.html

Perhaps you should now restore your database to its backed-up position and 
then do the above referenced more sane procedure for migration.

Regards
Fred


----- Original Message ----- 
From: <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Monday, February 27, 2006 4:12 AM
Subject: [Dbmail] help! :) --> dbmysql.c,db_query: mysql_real_query failed: 
Cannot add or update achild row: a foreign key constraint fails


> Hello everybody!
>
>
>
> I need serious help with this issue that suddenly came out:
>
>
>
> Feb 27 09:58:14 reddevil dbmail/smtp[93568]: dbmysql.c,db_query: executing
> query [SELECT 1=1 FROM dbmail_physmessage LIMIT 1 OFFSET 0]
>
> Feb 27 09:58:14 reddevil dbmail/smtp[93568]: header.c,consume_header_line:
> end of header found
>
> Feb 27 09:58:14 reddevil dbmail/smtp[93568]: header.c,get_rfc_size:
> remaining_len = zd
>
> Feb 27 09:58:14 reddevil dbmail/smtp[93568]: mime_readheader(): entering
> mime loop
>
> Feb 27 09:58:14 reddevil dbmail/smtp[93568]: mime_readheader(): found 
> double
> newline; header size: 28 lines
>
> Feb 27 09:58:14 reddevil dbmail/smtp[93568]: mail_adr_list(): mimelist
> currently has [17] nodes
>
> Feb 27 09:58:14 reddevil dbmail/smtp[93568]: mail_adr_list(): mail address
> parser starting
>
> Feb 27 09:58:14 reddevil dbmail/smtp[93568]: mail_adr_list(): total fields
> in header 17
>
> Feb 27 09:58:14 reddevil dbmail/smtp[93568]: mail_adr_list(): scanning for
> Return-Path
>
> Feb 27 09:58:14 reddevil dbmail/smtp[93568]: mail_adr_list(): found
> [EMAIL PROTECTED], next in list is <null>
>
> Feb 27 09:58:14 reddevil dbmail/smtp[93568]: mail_adr_list(): found 1
> emailaddresses
>
> Feb 27 09:58:14 reddevil dbmail/smtp[93568]: mail_adr_list(): mail address
> parser finished
>
> Feb 27 09:58:14 reddevil dbmail/smtp[93568]: 
> authsql.c,auth_check_user_ext:
> checking user [EMAIL PROTECTED] in alias table
>
> Feb 27 09:58:14 reddevil dbmail/smtp[93568]: dbmysql.c,db_query: executing
> query [SELECT deliver_to FROM dbmail_aliases WHERE lower(alias) =
> lower('[EMAIL PROTECTED]') AND lower(alias) <> lower(deliver_to)]
>
> Feb 27 09:58:14 reddevil dbmail/smtp[93568]: 
> authsql.c,auth_check_user_ext:
> into checking loop
>
> Feb 27 09:58:14 reddevil dbmail/smtp[93568]: 
> authsql.c,auth_check_user_ext:
> checking user [EMAIL PROTECTED] to 44
>
> Feb 27 09:58:14 reddevil dbmail/smtp[93568]: 
> authsql.c,auth_check_user_ext:
> checking user [44] in alias table
>
> Feb 27 09:58:14 reddevil dbmail/smtp[93568]: dbmysql.c,db_query: executing
> query [SELECT deliver_to FROM dbmail_aliases WHERE lower(alias) =
> lower('44') AND lower(alias) <> lower(deliver_to)]
>
> Feb 27 09:58:14 reddevil dbmail/smtp[93568]: 
> authsql.c,auth_check_user_ext:
> adding [44] to deliver_to address
>
> Feb 27 09:58:14 reddevil dbmail/smtp[93568]: dsn.c, dsnuser_resolve: user
> [EMAIL PROTECTED] found total of [1] aliases
>
> Feb 27 09:58:14 reddevil dbmail/smtp[93568]: dbmysql.c,db_query: executing
> query [BEGIN]
>
> Feb 27 09:58:14 reddevil dbmail/smtp[93568]: dbmysql.c,db_query: executing
> query [SELECT user_idnr FROM dbmail_users WHERE
> userid='[EMAIL PROTECTED]@__']
>
> Feb 27 09:58:14 reddevil dbmail/smtp[93568]: misc.c,create_unique_id:
> created: 2c4721ebc49d32a22d71b434920e59ed
>
> Feb 27 09:58:14 reddevil dbmail/smtp[93568]: dbmysql.c,db_query: executing
> query [SELECT mailbox_idnr FROM dbmail_mailboxes WHERE name='INBOX' AND
> owner_idnr='1']
>
> Feb 27 09:58:14 reddevil dbmail/smtp[93568]: db.c, db_find_create_mailbox:
> mailbox [INBOX] found
>
> Feb 27 09:58:14 reddevil dbmail/smtp[93568]: dbmysql.c,db_query: executing
> query [INSERT INTO dbmail_physmessage (messagesize, internal_date) VALUES
> ('0', CURRENT_TIMESTAMP)]
>
> Feb 27 09:58:14 reddevil dbmail/smtp[93568]: dbmysql.c,db_query: executing
> query [INSERT INTO dbmail_messages(mailbox_idnr, physmessage_id,
> unique_id,recent_flag, status) VALUES ('2', '423701',
> '2c4721ebc49d32a22d71b434920e59ed', '1', '5')]
>
> Feb 27 09:58:14 reddevil dbmail/smtp[93568]: dbmysql.c,db_query: query
> [INSERT INTO dbmail_messages(mailbox_idnr, physmessage_id,
> unique_id,recent_flag, status) VALUES ('2', '423701',
> '2c4721ebc49d32a22d71b434920e59ed', '1', '5')] failed
>
> Feb 27 09:58:14 reddevil dbmail/smtp[93568]: dbmysql.c,db_query:
> mysql_real_query failed: Cannot add or update a child row: a foreign key
> constraint fails
>
> Feb 27 09:58:14 reddevil dbmail/smtp[93568]: db.c,db_insert_message: query
> failed
>
>
>
> The message base "crashed" (i.e. the error came out) after running
> dbmail-util -a -y
>
>
>
> There's also a very strange symptom: I am moving a lot of mailboxes from
> this server to another one but my dbmail_messageblks won't get smaller. it
> used to be 140MB, and it's still 140MB, even if I am sure I pulled out at
> least 80Mb of mailboxes.
>
>
>
> I run dbmail-util -a every night. the removed mailboxes have all been
> deleted, but the one that are left show this error.
>
>
>
> I think that some garbage may be left in dbmail_messages and
> dbmail_messageblks that dbmail-util is not catching up.
>
>
>
> How to check the correctness of referentiality?
>
>
>
> Any hint?
>
>
>
> Help, help, help.
>
>
>
> Thanks
>
>
>
>


----------------------------------------------------------------------------
----


> _______________________________________________
> Dbmail mailing list
> [email protected]
> https://mailman.fastxs.nl/mailman/listinfo/dbmail
> 

_______________________________________________
Dbmail mailing list
[email protected]
https://mailman.fastxs.nl/mailman/listinfo/dbmail

Reply via email to