Page 1 of 1

Error 7760 / HM4406 - Could not read the message header, since the file was not available

Posted: 2019-05-08 13:12
by Gordonh1970
Ladies and Gents,

First of all thank you for looking at this. I have seached through the forums for an answer and not found one that answers this specifically. I have also searched through the documentation and not found anything. If I've missed something obvious then please point me in the right direction

I'm looking for a little assistance in that I am getting the above error message on 7 files that aren't in my data folder

Ideally I just want a method of telling HMS that those files are permanently gone and not to generate error messages for them

I have tried the DataDirectorySynchronizer (I was pretty sure that was only desaigned to add files to the database but thought it worth a shot anyway) but I am getting this error message for the same 7 files repeatedly, filling up an error log


Backrground:

My server got infected with ransomeware over Easter, probably a vulverability in a WordPress plugin - JetPack

Thankfully I have daily backups of the database and data folders (along with much else) to a cloud based service so had all my data

I reinstalled my server from bare-bones but as things had moved on a little from my original setup of the server a few years back I took the opportunity of installing the latest software etc. I am now running:

1and1/Ionos cloud server
Windows 2019 OS
MYSQL v8
HMS latest v5.6.7
ClamwWin plus SaneSecurity
SpamAssassin

My problem came from not realising how embedded Windows Defender was with Microsoft's newer OS and it took a few days before I realised there was a well hidden file scan going on at 3:05am each day and Windows Defender was being a bit over zealous in removing some files (I had disabled the realtime protection from Windows Defender when I installed ClamWin and added in exceptions for .eml files and the location hosting the data folder). I have now found and removed the scheduled scan task for Windows Defender

In short, Windows Defender removed these 7 files and I can't get them back. Missing those 7 files from 177k is fine with me but I do want to stop HMS generating repeating error messages

Is these any way to stop this?

Thank you for any assistance

Re: Error 7760 / HM4406 - Could not read the message header, since the file was not available

Posted: 2019-05-08 13:14
by mattg
Do you get a file path with the error message?

Re: Error 7760 / HM4406 - Could not read the message header, since the file was not available

Posted: 2019-05-08 14:41
by Gordonh1970
mattg wrote:
2019-05-08 13:14
Do you get a file path with the error message?
Yes I do

The .eml files do not exist at that location, hence the error messages

Re: Error 7760 / HM4406 - Could not read the message header, since the file was not available

Posted: 2019-05-09 00:15
by mattg
Actually no, a different thing would occur if the message didn't exist - A new dummy message would be created

This error specifically say that the message exists, just that it is not available (presumably because it is quarantined by the AV)

Re: Error 7760 / HM4406 - Could not read the message header, since the file was not available

Posted: 2019-05-09 14:23
by Gordonh1970
Thanks for your assistance on this Matt, it is much appreciated

I've double checked and none of the 7 files exist in the Data folder

I've gone through each subfolder line by line to make sure they weren't just in an odd order and the referenced files are not threre at all

e.g.

"ERROR" 8876 "2019-05-09 07:59:08.160" "Severity: 3 (Medium), Code: HM4403, Source: Message::GetHeader, Description: Could not read the message header, since the file was not available. File: C:\.....\Data\.....\john\26\{26005202-1496-44BF-BA14-21C6FB4B9594}.eml"

I have gone through the \26 subfolder individiual line by line (search and indexing seem to get a little confused with these file names) and there is no match. I've repeated the exercise for all 7 files and there is no .eml file for any of them

Different times I get slightly different error messages. All say HM4403 and the line as above but the error message at the beginning of the string can be 7760, 8876, 5792 etc

Any thoughts?

Re: Error 7760 / HM4406 - Could not read the message header, since the file was not available

Posted: 2019-05-10 00:26
by mattg
Can you create an empty file named exactly that at each specific location, and the restart the machine, to see if that makes a difference

Re: Error 7760 / HM4406 - Could not read the message header, since the file was not available

Posted: 2019-05-10 07:00
by Dravion
You also can stop hMailServer, login into your DB and delete the orphaned DB Records yourself

For example like this:

DELETE FROM
'hmailserver'.'hm_messages'
WHERE
messagefilename like '{8F79335E-A0A3-4B0A-9099-6F802E6737D0}.eml'

After this, restart hMailServer, the Error should be gone.

Re: Error 7760 / HM4406 - Could not read the message header, since the file was not available

Posted: 2019-05-10 09:01
by RvdH
Dravion wrote:
2019-05-10 07:00
You also can stop hMailServer, login into your DB and delete the orphaned DB Records yourself

For example like this:

DELETE FROM
'hmailserver'.'hm_messages'
WHERE
messagefilename like '{8F79335E-A0A3-4B0A-9099-6F802E6737D0}.eml'

After this, restart hMailServer, the Error should be gone.
And what about references to such messages in 'hm_message_metadata'?

Re: Error 7760 / HM4406 - Could not read the message header, since the file was not available

Posted: 2019-05-10 09:13
by mattg
Remember that officially, we don't support direct database manipulation.

Re: Error 7760 / HM4406 - Could not read the message header, since the file was not available

Posted: 2019-05-10 09:59
by Dravion
RvdH wrote:
2019-05-10 09:01

And what about references to such messages in 'hm_message_metadata'?
Can be ignored in this case.
The Log Errors will only triggered by the Master Record.

Re: Error 7760 / HM4406 - Could not read the message header, since the file was not available

Posted: 2019-05-10 11:22
by RvdH
That leaves orphaned data, that really is not the best practice...but as Matt already pointed out, it is not recommended to alter database directly in the first place

Re: Error 7760 / HM4406 - Could not read the message header, since the file was not available

Posted: 2019-05-11 12:12
by Gordonh1970
Thanks for your advice Matt, this seems to have fixed the issue

I had thought about whether I would have to edit the database directly but am glad I asked on here before doing so

Thank you again, very much :)

Re: Error 7760 / HM4406 - Could not read the message header, since the file was not available

Posted: 2019-05-17 12:02
by Gordonh1970
Latest update is that the kind suggestions haven't quite solved the issue

I had followed MattG's suggestion of putting blank txt files in place but I had the following error message a couple of days later

ERROR" 2752 "2019-05-17 07:46:52.877" "Severity: 3 (Medium), Code: HM5042, Source: File::ReadTextFile, Description: An unknown error occurred while reading a text file from disk."
"ERROR" 2752 "2019-05-17 07:46:52.892" "Severity: 3 (Medium), Code: HM4218, Source: MessageData::LoadFromMessage, Description: An unknown error occurred while loading message. File: C:\OneDrive\....john\26\{26005202-1496-44BF-BA14-21C6FB4B9594}.eml. Backuped to: C:\OneDrive\.......\Logs\Problematic messages\{26005202-1496-44BF-BA14-21C6FB4B9594}.eml"

HMS created a folder in the logs folder "Problematic MEssages" and moved the zero size txt files there

I thought it might be a one-off process but I got lots of similar error messages this morning, so the check is not frequest but approx every 3 days

I'm loath the edit the database directly as I am very wary of any unexpected consequences

Everything else on the system is working great, just these errors

Any thoughts as to what to try next?

Re: Error 7760 / HM4406 - Could not read the message header, since the file was not available

Posted: 2019-05-17 13:16
by Dravion
Maybe you just shouldnt save your hMailServer Data files into a Clouddrive folder....

Re: Error 7760 / HM4406 - Could not read the message header, since the file was not available

Posted: 2019-05-17 14:45
by Gordonh1970
Dravion wrote:
2019-05-17 13:16
Maybe you just shouldnt save your hMailServer Data files into a Clouddrive folder....
That's never been a problem and it means if the system goes down I have all the messages not just the ones from the latest backup time

Benn running that way for a year plus so that bit I'm happy with. Also witht he logs going striaght to cloud, mysqlpump files going there, that all works

Re: Error 7760 / HM4406 - Could not read the message header, since the file was not available

Posted: 2019-05-17 17:29
by Dravion
Unknown Error at loading a EML Message file isnt verry detailed. Could be a Filesystem ord Harddisk issue, a faulty RAM Module or a interfering process like AV-Software.

Re: Error 7760 / HM4406 - Could not read the message header, since the file was not available

Posted: 2019-05-18 16:49
by Gordonh1970
Dravion,

Thank you for the response. As per the original post I know why the 7 e-mail files were deleted, and that's not a problem

What I am looking to do is stop HMS from flagging them up as missing as an error log, preferably without editing anything in the database

Re: Error 7760 / HM4406 - Could not read the message header, since the file was not available

Posted: 2019-05-19 02:47
by mattg
Perhaps next step is to copy a known message to each of the seven locations

Re: Error 7760 / HM4406 - Could not read the message header, since the file was not available

Posted: 2019-05-20 11:54
by nitro
Does the Data Directory Synchronizer application not work?
Maybe it is the best solution for this problem.
I have used it once and I have obtained good results.

Image
Image

Re: Error 7760 / HM4406 - Could not read the message header, since the file was not available

Posted: 2019-05-20 13:10
by mattg
Good thought...but OP has tried that without success
Gordonh1970 wrote:
2019-05-08 13:12
I have tried the DataDirectorySynchronizer (I was pretty sure that was only desaigned to add files to the database but thought it worth a shot anyway) but I am getting this error message for the same 7 files repeatedly, filling up an error log

Re: Error 7760 / HM4406 - Could not read the message header, since the file was not available

Posted: 2019-05-20 13:14
by nitro
Sorry, the problem of reading diagonally. :oops:

Re: Error 7760 / HM4406 - Could not read the message header, since the file was not available

Posted: 2019-05-20 13:15
by mattg
no stress

like I said, good thought.

Re: Error 7760 / HM4406 - Could not read the message header, since the file was not available

Posted: 2019-05-29 18:22
by Gordonh1970
mattg wrote:
2019-05-19 02:47
Perhaps next step is to copy a known message to each of the seven locations
Well its been 5 days since I tried this and no error messages so I suppsed I can count on that being fixed

Thank you all for your help and suggestions