Gossamer Forum
Home : Products : Gossamer Mail : Discussion :

Cron Error - Could not DELE 1316

Quote Reply
Cron Error - Could not DELE 1316
Hi Guys

Getting the following error via cron...


Could not DELE 1316. Server said: Nothing sent back at /path/to/gmail/batch/incoming.pl line 805.


Any ideas what that means?

Thanks,

Regan
Quote Reply
Re: [ryel01] Cron Error - Could not DELE 1316 In reply to
It means that Gossamer Mail told the pop server to delete message 1316, but the pop server didn't return anything (possibly timed out). Usually a problem like that is a problem with the pop server (file system issues, server load, etc) and not with Gossamer Mail.

Adrian
Quote Reply
Re: [brewt] Cron Error - Could not DELE 1316 In reply to
Hi Adrian

Thanks for that.

Hey I've got about 12,000 duplicate messages in my webmail_msgs table that have the same msgs_message_id.

I've done a myisamchk -r *.MYI on the tables and run consistency but that hasn't deleted those duplicates.

Can you tell me how to get rid of them? My users mailboxes are full of duplicate messages.

Regan

Last edited by:

ryel01: Feb 12, 2008, 7:39 PM
Quote Reply
Re: [brewt] Cron Error - Could not DELE 1316 In reply to
Hi Adrian

Looking at it closer, it appears the duplicates are actually in the "webmail_msgtrack" table.

Here's the output of a select on a single message id which shows the same message id in the same folder multiple times.


+-------------+--------------+--------------+-----------------+-----------------+------------------+---------------+-------------------+--------------------+---------------------+
| msgtrack_id | msgtrack_mid | msgtrack_fid | msgtrack_userid | msgtrack_status | msgtrack_account | msgtrack_look | msgtrack_expanded | msgtrack_draft_ref | msgtrack_draft_html |
+-------------+--------------+--------------+-----------------+-----------------+------------------+---------------+-------------------+--------------------+---------------------+
| 2048054 | 1907494 | 1 | 1814 | New | 0 | clear | 0 | NULL | NULL |
| 2048383 | 1907494 | 1 | 1814 | New | 0 | clear | 0 | NULL | NULL |
| 2048712 | 1907494 | 1 | 1814 | New | 0 | clear | 0 | NULL | NULL |
| 2049044 | 1907494 | 1 | 1814 | New | 0 | clear | 0 | NULL | NULL |
| 2049406 | 1907494 | 1 | 1814 | Read | 0 | clear | 0 | NULL | NULL |
| 2049812 | 1907494 | 1 | 1814 | New | 0 | clear | 0 | NULL | NULL |
+-------------+--------------+--------------+-----------------+-----------------+------------------+---------------+-------------------+--------------------+---------------------+

Regan
Quote Reply
Re: [brewt] Cron Error - Could not DELE 1316 In reply to
Hi Adrian

I **think** this was caused by a corrupted mailbox which I've now fixed (I hope).

It appears the messages were being left in the mailbox file and re-processed again by incoming.pl.

The script must check for duplicates messages in the "msgs" folder, because there was only ever 1 copy of the actual message.

But it appears it inserts another row into the msgs_track table regardless, without checking for a duplicate first.

Perhaps this is a bug?

Are you able to provide a batch/maintenance scrip to run via the command line that deletes all duplicates from the msgs_track table for all users? I know the code to delete duplicates for a single users folder already exists so it would just be a matter of wrapping that into another function for all users.

?

Regan
Quote Reply
Re: [ryel01] Cron Error - Could not DELE 1316 In reply to
Sorry about the late reply, I've been really busy the past few weeks, so I haven't had as much time to check on the forums as usual.

hmm, try doing this select to check that it returns the correct rows:

SELECT m1.msgtrack_id, m2.msgtrack_id, m1.msgtrack_mid, m2.msgtrack_mid, m1.msgtrack_userid, m2.msgtrack_userid FROM webmail_msgtrack m1, webmail_msgtrack m2 WHERE m1.msgtrack_mid = m2.msgtrack_mid AND m1.msgtrack_userid = m2.msgtrack_userid AND m1.msgtrack_id > m2.msgtrack_id AND m1.msgtrack_mid = 1814

That should return 5 (total copies minus 1) rows.

Then if you're adventurous, you can do the delete:

DELETE FROM webmail_msgtrack m1, webmail_msgtrack m2 WHERE m1.msgtrack_mid = m2.msgtrack_mid AND m1.msgtrack_userid = m2.msgtrack_userid AND m1.msgtrack_id > m2.msgtrack_id

I'd backup your database before doing that one (it also might take a while to run if you've got a lot of mail).

There isn't a pre-written script to do the delete duplicates, but it probably wouldn't be too hard to write something to do it. Unfortunately, I'm really busy at the moment.

When I get a chance, I'll look into seeing if there's a problem with incoming.pl.

Adrian
Quote Reply
Re: [brewt] Cron Error - Could not DELE 1316 In reply to
Thanks Adrian I'll give that a try.

There actually is a delete duplicates function already!!

It controls the deleting of duplicate emails from within the folders section on the users side.

This just needs to loop through the unique user id's and folder ids and should work... but I'm not sure how to do it (my perl is crap).

Not sure if that would be a quick one to figure out?

Regan




Code:
$COMPILE{delete_folder_duplicates} = __LINE__ . <<'END_OF_SUB';
sub delete_folder_duplicates {
# -------------------------------------------------------------------
# Takes the folder ID from folders_fid as cgi input and delete any
# messages that are duplicates. The folder ID can also be passed in
# as the first argument. If it is it will ignore CGI input.
#
my ($self, $fid) = @_;

$fid ||= $IN->param('folders_fid');
$fid or return $self->error('FOLDERR_NOID', 'WARN');
$fid =~ /^\d+$/ or return $self->error('FOLDERR_ID', 'WARN', $fid);

my $sth = $DB->table('msgs', 'msgtrack')->select(
'msgs_checksum', 'msgtrack_id',
{
msgtrack_userid => $USER->{userid},
msgtrack_fid => $fid,
}
);
my (%cache, @delete);
while (my ($checksum, $id) = $sth->fetchrow()) {
if (exists($cache{$checksum})) {
push @delete, $id;
}
else {
$cache{$checksum} = 1;
}
}
my $cnt = $PLG->dispatch('GMail::Messages::delete', sub { $self->delete(@_) }, $fid, @delete);
return { message => 'MSG_DEL' }, $cnt;
}
END_OF_SUB