Messages stuck and wont be sent

Use this forum if you have installed hMailServer and want to ask a question related to a production release of hMailServer. Before posting, please read the troubleshooting guide. A large part of all reported issues are already described in detail here.
Post Reply
User avatar
maggiore81
Normal user
Normal user
Posts: 171
Joined: 2008-01-11 16:02
Location: near Ravenna (Italy)
Contact:

Messages stuck and wont be sent

Post by maggiore81 » 2009-04-15 11:05

Hello
I am in the real trouble

Hmail 5.0 B326 latest.

This morning all messages got stuck in the outgoing queue.

Dont know why. I select them and click SEND NOW and they are ignored.

How can I do?
The server, in the error logs says:

"ERROR" 163288 "2009-04-15 11:05:09.448" "Severity: 2 (High), Code: HM5047, Source: File::DeleteFile, Description: Could not delete the file C:\Program Files (x86)\hMailServer\Data\{CE98158B-341C-4C37-9CE6-E981DD582AB1}.eml. Tried 5 times without success. Windows error code: 32 (The process cannot access the file because it is being used by another process.)"
"ERROR" 48268 "2009-04-15 11:05:09.557" "Severity: 2 (High), Code: HM5047, Source: File::DeleteFile, Description: Could not delete the file C:\Program Files (x86)\hMailServer\Data\{1AF49731-582E-4949-96D1-F26D1E40A154}.eml. Tried 5 times without success. Windows error code: 32 (The process cannot access the file because it is being used by another process.)"
"ERROR" 29684 "2009-04-15 11:05:10.182" "Severity: 2 (High), Code: HM5047, Source: File::DeleteFile, Description: Could not delete the file C:\Program Files (x86)\hMailServer\Data\{2ED19B14-AA84-432A-A604-23A4CCFCCEBE}.eml. Tried 5 times without success. Windows error code: 32 (The process cannot access the file because it is being used by another process.)"
"ERROR" 164024 "2009-04-15 11:05:10.276" "Severity: 2 (High), Code: HM5047, Source: File::DeleteFile, Description: Could not delete the file C:\Program Files (x86)\hMailServer\Data\{48817384-693A-4229-9BF2-23C8A1F176D2}.eml. Tried 5 times without success. Windows error code: 32 (The process cannot access the file because it is being used by another process.)"
"ERROR" 125820 "2009-04-15 11:05:10.698" "Severity: 2 (High), Code: HM5047, Source: File::DeleteFile, Description: Could not delete the file C:\Program Files (x86)\hMailServer\Data\{0AA8000B-BCF4-41E1-BFCC-AEF3D429F4C8}.eml. Tried 5 times without success. Windows error code: 32 (The process cannot access the file because it is being used by another process.)"
"ERROR" 134712 "2009-04-15 11:06:12.057" "Severity: 3 (Medium), Code: HM5006, Source: SMTPDeliverer::DeliverMessage(), Description: Message 2814 could not be delivered since the data file does not exist."
"ERROR" 161908 "2009-04-15 11:06:12.057" "Severity: 3 (Medium), Code: HM5006, Source: SMTPDeliverer::DeliverMessage(), Description: Message 2815 could not be delivered since the data file does not exist."
"ERROR" 117352 "2009-04-15 11:06:12.057" "Severity: 3 (Medium), Code: HM5006, Source: SMTPDeliverer::DeliverMessage(), Description: Message 2816 could not be delivered since the data file does not exist."
"ERROR" 164252 "2009-04-15 11:06:12.073" "Severity: 3 (Medium), Code: HM5006, Source: SMTPDeliverer::DeliverMessage(), Description: Message 2817 could not be delivered since the data file does not exist."
"ERROR" 168604 "2009-04-15 11:06:12.073" "Severity: 3 (Medium), Code: HM5006, Source: SMTPDeliverer::DeliverMessage(), Description: Message 2818 could not be delivered since the data file does not exist."
"ERROR" 66520 "2009-04-15 11:06:12.073" "Severity: 3 (Medium), Code: HM5006, Source: SMTPDeliverer::DeliverMessage(), Description: Message 2820 could not be delivered since the data file does not exist."
"ERROR" 60024 "2009-04-15 11:06:12.073" "Severity: 3 (Medium), Code: HM5006, Source: SMTPDeliverer::DeliverMessage(), Description: Message 2847 could not be delivered since the data file does not exist."
"ERROR" 113844 "2009-04-15 11:06:12.073" "Severity: 3 (Medium), Code: HM5006, Source: SMTPDeliverer::DeliverMessage(), Description: Message 2848 could not be delivered since the data file does not exist."
"ERROR" 79696 "2009-04-15 11:06:12.073" "Severity: 3 (Medium), Code: HM5006, Source: SMTPDeliverer::DeliverMessage(), Description: Message 2849 could not be delivered since the data file does not exist."
"ERROR" 84332 "2009-04-15 11:06:12.073" "Severity: 3 (Medium), Code: HM5006, Source: SMTPDeliverer::DeliverMessage(), Description: Message 2850 could not be delivered since the data file does not exist."
"ERROR" 165996 "2009-04-15 11:06:12.073" "Severity: 3 (Medium), Code: HM5006, Source: SMTPDeliverer::DeliverMessage(), Description: Message 2851 could not be delivered since the data file does not exist."
"ERROR" 164252 "2009-04-15 11:06:12.510" "Severity: 3 (Medium), Code: HM5006, Source: SMTPDeliverer::DeliverMessage(), Description: Message 2852 could not be delivered since the data file does not exist."
"ERROR" 66520 "2009-04-15 11:06:12.510" "Severity: 3 (Medium), Code: HM5006, Source: SMTPDeliverer::DeliverMessage(), Description: Message 2853 could not be delivered since the data file does not exist."
"ERROR" 164252 "2009-04-15 11:06:12.713" "Severity: 3 (Medium), Code: HM5006, Source: SMTPDeliverer::DeliverMessage(), Description: Message 2854 could not be delivered since the data file does not exist."
"ERROR" 66520 "2009-04-15 11:06:12.713" "Severity: 3 (Medium), Code: HM5006, Source: SMTPDeliverer::DeliverMessage(), Description: Message 2855 could not be delivered since the data file does not exist."
"ERROR" 60024 "2009-04-15 11:06:12.713" "Severity: 3 (Medium), Code: HM5006, Source: SMTPDeliverer::DeliverMessage(), Description: Message 2856 could not be delivered since the data file does not exist."
"ERROR" 79696 "2009-04-15 11:06:12.729" "Severity: 3 (Medium), Code: HM5006, Source: SMTPDeliverer::DeliverMessage(), Description: Message 2857 could not be delivered since the data file does not exist."
"ERROR" 84332 "2009-04-15 11:06:12.729" "Severity: 3 (Medium), Code: HM5006, Source: SMTPDeliverer::DeliverMessage(), Description: Message 2858 could not be delivered since the data file does not exist."
"ERROR" 48768 "2009-04-15 11:06:12.729" "Severity: 3 (Medium), Code: HM5006, Source: SMTPDeliverer::DeliverMessage(), Description: Message 2859 could not be delivered since the data file does not exist."
"ERROR" 34792 "2009-04-15 11:06:12.729" "Severity: 3 (Medium), Code: HM5006, Source: SMTPDeliverer::DeliverMessage(), Description: Message 2860 could not be delivered since the data file does not exist."
"ERROR" 66828 "2009-04-15 11:06:12.729" "Severity: 3 (Medium), Code: HM5006, Source: SMTPDeliverer::DeliverMessage(), Description: Message 2861 could not be delivered since the data file does not exist."
"ERROR" 120872 "2009-04-15 11:06:12.729" "Severity: 3 (Medium), Code: HM5006, Source: SMTPDeliverer::DeliverMessage(), Description: Message 2862 could not be delivered since the data file does not exist."
"ERROR" 132660 "2009-04-15 11:06:12.744" "Severity: 3 (Medium), Code: HM5006, Source: SMTPDeliverer::DeliverMessage(), Description: Message 2863 could not be delivered since the data file does not exist."
"ERROR" 121596 "2009-04-15 11:06:12.744" "Severity: 3 (Medium), Code: HM5006, Source: SMTPDeliverer::DeliverMessage(), Description: Message 2864 could not be delivered since the data file does not exist."
"ERROR" 49624 "2009-04-15 11:06:12.744" "Severity: 3 (Medium), Code: HM5006, Source: SMTPDeliverer::DeliverMessage(), Description: Message 2865 could not be delivered since the data file does not exist."
"ERROR" 98776 "2009-04-15 11:06:12.744" "Severity: 3 (Medium), Code: HM5006, Source: SMTPDeliverer::DeliverMessage(), Description: Message 2866 could not be delivered since the data file does not exist."
"ERROR" 121596 "2009-04-15 11:06:12.869" "Severity: 3 (Medium), Code: HM5006, Source: SMTPDeliverer::DeliverMessage(), Description: Message 2867 could not be delivered since the data file does not exist."
"ERROR" 55792 "2009-04-15 11:06:12.869" "Severity: 3 (Medium), Code: HM5006, Source: SMTPDeliverer::DeliverMessage(), Description: Message 2868 could not be delivered since the data file does not exist."
"ERROR" 60336 "2009-04-15 11:06:12.869" "Severity: 3 (Medium), Code: HM5006, Source: SMTPDeliverer::DeliverMessage(), Description: Message 2869 could not be delivered since the data file does not exist."
"ERROR" 146828 "2009-04-15 11:06:12.994" "Severity: 3 (Medium), Code: HM5006, Source: SMTPDeliverer::DeliverMessage(), Description: Message 2870 could not be delivered since the data file does not exist."


The host server is Win 2003 Std X64 with 512mb RAM and 2xquad-core
It is a virtual machine created on virtuozzo software.

On the phisical worked great, but also here, very very fast. My worry is that the virtual disk may corrupt the db..

User avatar
maggiore81
Normal user
Normal user
Posts: 171
Joined: 2008-01-11 16:02
Location: near Ravenna (Italy)
Contact:

Re: Messages stuck and wont be sent

Post by maggiore81 » 2009-04-15 12:49

After reading some docs, I thinked that the db could become corrupt in some way.
Then I closed port 25 from external.
Backed up settings + domains + messages

uninstalled Hmail 5
deleted the folder on the disk
installed latest 4.4 hmail with mysql db
upgraded to the 5.0 B326
restored the backup of settings + messages.

I hope it will not corrupt anymore.
I also installed sqlyog to check the tables of the db.
Mr. Spadoni
Network Administrator
--
Spadhausen ISP
admin (at) spadhausen . com

User avatar
martin
Developer
Developer
Posts: 6834
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Re: Messages stuck and wont be sent

Post by martin » 2009-04-15 17:45

This looks more like a disk problem than a database problem to me. The error message says that it cannot delete files from disk because they are locked. I don't see how the database engine could cause that.

User avatar
maggiore81
Normal user
Normal user
Posts: 171
Joined: 2008-01-11 16:02
Location: near Ravenna (Italy)
Contact:

Re: Messages stuck and wont be sent

Post by maggiore81 » 2009-04-15 18:28

Hm.. After I reboot the guest OS, the problem disappeared, but all the messages on the send queue were lost.

I placed mysql because I have some maintenance tools, that on MS SQL CE I don't have.
Also on your documentation is written that if my messages are mission-critical, it is better to be on MYSQL or MSSQL (not CE)

User avatar
martin
Developer
Developer
Posts: 6834
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Re: Messages stuck and wont be sent

Post by martin » 2009-04-15 18:32

What do you mean "all the messages on the send queue were lost"? Are they still in the data directory, or?

As I said, I doubt it has anything to do with the database engine. :)

User avatar
maggiore81
Normal user
Normal user
Posts: 171
Joined: 2008-01-11 16:02
Location: near Ravenna (Italy)
Contact:

Re: Messages stuck and wont be sent

Post by maggiore81 » 2009-04-16 10:16

Hello Martin.
Before I rebooted the server, there were about 45 msg on queue to be sent.
At reboot there were 0.
Mr. Spadoni
Network Administrator
--
Spadhausen ISP
admin (at) spadhausen . com

^DooM^
Site Admin
Posts: 13861
Joined: 2005-07-29 16:18
Location: UK

Re: Messages stuck and wont be sent

Post by ^DooM^ » 2009-04-16 11:32

Perhaps by the time it had rebooted and you had gone to the queue hMail had delivered them. Only way to be sure is to check the logs if you had SMTP logging enabled at that time.
If at first you don't succeed, bomb disposal probably isn't for you! ヅ

User avatar
maggiore81
Normal user
Normal user
Posts: 171
Joined: 2008-01-11 16:02
Location: near Ravenna (Italy)
Contact:

Re: Messages stuck and wont be sent

Post by maggiore81 » 2009-04-16 11:38

Hello
I hoped that but the messages were lost . I have logging always enabled. I have checked it and they disappeared.
Mr. Spadoni
Network Administrator
--
Spadhausen ISP
admin (at) spadhausen . com

User avatar
maggiore81
Normal user
Normal user
Posts: 171
Joined: 2008-01-11 16:02
Location: near Ravenna (Italy)
Contact:

Re: Messages stuck and wont be sent

Post by maggiore81 » 2009-04-16 12:07

At the end, using MySQL should be better that using MSSQLCE, because on mysql I can run (if I need to) maintenance utilities on the tables.

Do you think that it has been a nice think to install the latest 4.4 (on mysql) then upgrade, so I kept mysql DB? It shouldn't have any limitation on the size.

^DooM^
Site Admin
Posts: 13861
Joined: 2005-07-29 16:18
Location: UK

Re: Messages stuck and wont be sent

Post by ^DooM^ » 2009-04-16 12:36

If hMail did delete them then it would be in the logs. If the database was corrupted there would be error messages and if the EML files were removed hMail would send out emails saying it couldn't find them. So having the emails become "lost" would seem a bit of a stretch to me at least. I'm not saying they weren't there I am just trying to find a logical explanation as to why they are "lost". Perhaps you can post the logs from after the reboot so we can see.
If at first you don't succeed, bomb disposal probably isn't for you! ヅ

User avatar
maggiore81
Normal user
Normal user
Posts: 171
Joined: 2008-01-11 16:02
Location: near Ravenna (Italy)
Contact:

Re: Messages stuck and wont be sent

Post by maggiore81 » 2009-04-21 20:22

I have found the problem. I think that the bad guy is clamAV.

I have found this morning my outgoing queue stuck with 1500 msg and my customers just screamed at me!!

I have stopped hmail, then restarted it via the hmail administrator interface. Immediately all the outgoing messages has been sent.
I have disabled the clamAV service, then the problem disappeared.
I am in a virtual server with drwebAV checking everything on top of me, and I think that the two AV could have conflict with each other.
currently the problem seem solved.
Mr. Spadoni
Network Administrator
--
Spadhausen ISP
admin (at) spadhausen . com

User avatar
martin
Developer
Developer
Posts: 6834
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Re: Messages stuck and wont be sent

Post by martin » 2009-04-21 20:28

Did you see the same errors reported to the log today?
(Files being locked?)

User avatar
maggiore81
Normal user
Normal user
Posts: 171
Joined: 2008-01-11 16:02
Location: near Ravenna (Italy)
Contact:

Re: Messages stuck and wont be sent

Post by maggiore81 » 2009-04-21 20:32

Yes. and also i noticed a lot of clamdscan.exe processes.

I think that the ClamAV conflicts with the drwebAV.
I disabled the clamAV and now it seem running fine.

I would like to ask you if it is possibile to downgrade the installation.
from 5.0 to latest 4.4
Mr. Spadoni
Network Administrator
--
Spadhausen ISP
admin (at) spadhausen . com

User avatar
martin
Developer
Developer
Posts: 6834
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Re: Messages stuck and wont be sent

Post by martin » 2009-04-21 20:34

What is "drwebAV"?

No, there are no built-in methods to downgrade. What would be the reason for that?

User avatar
maggiore81
Normal user
Normal user
Posts: 171
Joined: 2008-01-11 16:02
Location: near Ravenna (Italy)
Contact:

Re: Messages stuck and wont be sent

Post by maggiore81 » 2009-04-21 20:39

DrWeb AV is an anti-virus program.

I have never experienced problems on 4.4 latest.. Also 4.4 is integrated in the plesk software, the 5.0 doesn't work.
I wanted just to know if it is possible restoring the backup with settings + domains, just to ask :)
Mr. Spadoni
Network Administrator
--
Spadhausen ISP
admin (at) spadhausen . com

User avatar
martin
Developer
Developer
Posts: 6834
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Re: Messages stuck and wont be sent

Post by martin » 2009-04-21 20:41

I doubt that the file locking problems are related to hMailServer 5.0 though. hMailServer 4 would have the exact same problem as v5 here if the files are locked. If you continue to experience problems you can try disabling non-critical features in hMailServer to see if you can detect what causes it. Maybe you've enabled some anti spam functionality which you do not need. But again, if files are locked hMailServer will give this problem. If the files are locked, and disabling Clam solves it, it sounds like the problem is outside of hMailServer. And if it is, downgrading won't have any effect.

The plesk argument I can agree with though. :-\

The only way to downgrade is to do it manually by reverting the database structure. Which is a lot of work and needs to be done manually.

User avatar
maggiore81
Normal user
Normal user
Posts: 171
Joined: 2008-01-11 16:02
Location: near Ravenna (Italy)
Contact:

Re: Messages stuck and wont be sent

Post by maggiore81 » 2009-04-23 12:38

Hello. I think I figured it out.

At the time of the problems, I have hmailserver configured as the following:

All files that were marked with a spam point between 5 and 10 will be delivered.
50 command threads
-----

I have a lot of messages coming in and that were scanned. For some reasons, the antivirus stuck when it had to scan a lot of messages at the same time.

Now I have set that every msg that appears on any DNSBL are deleted, so the volume of messages that ClamAV have to scan is a lot lower. No problems from that moment. I also left the command thread to 15 so hmail has a smaller queue of commands available and the clamAV doesnt stuck any more on the messages.

Now it runs very very smoothly. 15 command thread, 50 delivery thread.
Mr. Spadoni
Network Administrator
--
Spadhausen ISP
admin (at) spadhausen . com

User avatar
maggiore81
Normal user
Normal user
Posts: 171
Joined: 2008-01-11 16:02
Location: near Ravenna (Italy)
Contact:

Re: Messages stuck and wont be sent

Post by maggiore81 » 2009-05-01 15:05

The problem was in the clamd.conf
max threads
I set them to 8 since the box was a dual quad-core

in my original installation (on a P3 800) the max threads were 2

I set it to two, and never encountered any issues.
Mr. Spadoni
Network Administrator
--
Spadhausen ISP
admin (at) spadhausen . com

Magnus W
Normal user
Normal user
Posts: 162
Joined: 2007-04-17 15:30

Re: Messages stuck and wont be sent

Post by Magnus W » 2009-05-03 21:40

drwebAV checking everything -- this is on-access scanning, right? You should never use an "all-seeing" antivirus system on mailservers, as removing/changing files without the mail server involved can lead to undesirable results. The hMailServer directories, especially the data directory, should be added to the exclusion list of said anti virus. Then you can add its command-line scanner to the list of scanners inside hMS, if you so wish (and have the CPU capacity).

I understand that you may have no access to these settings if you are running in a VM someone else controls, but for me that would be a priority to fix.

User avatar
maggiore81
Normal user
Normal user
Posts: 171
Joined: 2008-01-11 16:02
Location: near Ravenna (Italy)
Contact:

Re: Messages stuck and wont be sent

Post by maggiore81 » 2009-05-03 21:57

Hello
It was a test account on a VM with Win2003.

I could easily stop the drweb AV by disabling the service :D

However the problem was causated by the 8 thread of the clamAV, that opened a lot of clamdscan.exe processes that hang the system.

with 2 AV threads now it works perfectly.

Best regards.
Mr. Spadoni
Network Administrator
--
Spadhausen ISP
admin (at) spadhausen . com

Magnus W
Normal user
Normal user
Posts: 162
Joined: 2007-04-17 15:30

Re: Messages stuck and wont be sent

Post by Magnus W » 2009-05-03 22:57

Absolutely, I'm happy for you, my message was to point out that this is not (in my opinion) a good configuration and it may harm your setup in the future.

User avatar
maggiore81
Normal user
Normal user
Posts: 171
Joined: 2008-01-11 16:02
Location: near Ravenna (Italy)
Contact:

Re: Messages stuck and wont be sent

Post by maggiore81 » 2009-05-03 23:03

I really know that an AV shouldnt check every kind of file on a machine, but it was just a test account on a remote VM provider to test its service.

That provider had drwebAV active by default... it was not my fault :)
Mr. Spadoni
Network Administrator
--
Spadhausen ISP
admin (at) spadhausen . com

Post Reply