Violation of UNIQUE KEY 'hm_message_metadata_unique'

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
snico
New user
New user
Posts: 27
Joined: 2010-01-04 12:18

Violation of UNIQUE KEY 'hm_message_metadata_unique'

Post by snico » 2011-08-16 09:32

Hello,
I have this error every day.

My server : windows 2008 r2, sql 2008, 1000 acounts

Code: Select all

"ERROR"	628	"2011-08-12 01:33:16.530"	"Severity: 2 (High), Code: HM5032, Source: DALConnection::Execute, Description: Source: ADOConnection::Execute(), Code: HM10044, Description: Error while executing SQL statement: 
INSERT INTO hm_message_metadata (metadata_accountid, metadata_folderid, metadata_messageid, metadata_dateutc, metadata_from, metadata_subject, metadata_to, metadata_cc) VALUES (2589, 12306, 11380402, N'2011-07-20 14:14:11', N'***** <*****@mail.com>', N'*****SUBJECT*******', N'*****@mail.com,  *****@mail.com,  *****@partners', N'')
Microsoft OLE DB Provider for SQL Server
Violation of UNIQUE KEY constraint 'hm_message_metadata_unique'. Cannot insert duplicate key in object 'dbo.hm_message_metadata'."

"ERROR"	628	"2011-08-12 02:25:50.637"	"Severity: 2 (High), Code: HM5032, Source: DALConnection::Execute, Description: Source: ADOConnection::Execute(), Code: HM10044, Description: Error while executing SQL statement: 
INSERT INTO hm_message_metadata (metadata_accountid, metadata_folderid, metadata_messageid, metadata_dateutc, metadata_from, metadata_subject, metadata_to, metadata_cc) VALUES (2228, 5516, 176793, N'2008-01-25 13:29:15', N'***** <*****@mail.com>', N'*****SUBJECT*******', N'***** <*****@bplc.fr>', N'')
Microsoft OLE DB Provider for SQL Server
Violation of UNIQUE KEY constraint 'hm_message_metadata_unique'. Cannot insert duplicate key in object 'dbo.hm_message_metadata'."

"ERROR"	4132	"2011-08-12 14:36:15.809"	"Severity: 2 (High), Code: HM5032, Source: DALConnection::Execute, Description: Source: ADOConnection::Execute(), Code: HM10044, Description: Error while executing SQL statement: 
INSERT INTO hm_message_metadata (metadata_accountid, metadata_folderid, metadata_messageid, metadata_dateutc, metadata_from, metadata_subject, metadata_to, metadata_cc) VALUES (2066, 2178, 54709, N'2009-11-10 16:33:41', N'***** <cm@ipsoft.fr>', N'*****SUBJECT*******', N'***** <*****@mail.pt>', N'***** <*****@mail.pt>')
Microsoft OLE DB Provider for SQL Server
Violation of UNIQUE KEY constraint 'hm_message_metadata_unique'. Cannot insert duplicate key in object 'dbo.hm_message_metadata'."

"ERROR"	4132	"2011-08-13 14:09:22.956"	"Severity: 2 (High), Code: HM5032, Source: DALConnection::Execute, Description: Source: ADOConnection::Execute(), Code: HM10044, Description: Error while executing SQL statement: 
INSERT INTO hm_message_metadata (metadata_accountid, metadata_folderid, metadata_messageid, metadata_dateutc, metadata_from, metadata_subject, metadata_to, metadata_cc) VALUES (2190, 9943, 1167561, N'2008-08-01 13:26:52', N'***** <*****@mail.com>', N'*****SUBJECT*******', N'***** <*****@mail.pt>', N'*****@mail.com')
Microsoft OLE DB Provider for SQL Server
Violation of UNIQUE KEY constraint 'hm_message_metadata_unique'. Cannot insert duplicate key in object 'dbo.hm_message_metadata'."

"ERROR"	4132	"2011-08-14 21:36:17.057"	"Severity: 2 (High), Code: HM5032, Source: DALConnection::Execute, Description: Source: ADOConnection::Execute(), Code: HM10044, Description: Error while executing SQL statement: 
INSERT INTO hm_message_metadata (metadata_accountid, metadata_folderid, metadata_messageid, metadata_dateutc, metadata_from, metadata_subject, metadata_to, metadata_cc) VALUES (2228, 5555, 176964, N'2009-07-06 12:39:27', N'***** <*****@mail.com>', N'*****SUBJECT*******', N'***** <*****@mail.com>', N'')
Microsoft OLE DB Provider for SQL Server
Violation of UNIQUE KEY constraint 'hm_message_metadata_unique'. Cannot insert duplicate key in object 'dbo.hm_message_metadata'."

"ERROR"	4132	"2011-08-15 09:23:39.982"	"Severity: 2 (High), Code: HM5032, Source: DALConnection::Execute, Description: Source: ADOConnection::Execute(), Code: HM10044, Description: Error while executing SQL statement: 
INSERT INTO hm_message_metadata (metadata_accountid, metadata_folderid, metadata_messageid, metadata_dateutc, metadata_from, metadata_subject, metadata_to, metadata_cc) VALUES (2450, 10661, 8394424, N'2011-03-03 09:30:21', N'***** <*****@mail.pt>', N'*****SUBJECT*******', N'*****@mail.com', N'*****@mail.com')
Microsoft OLE DB Provider for SQL Server
Violation of UNIQUE KEY constraint 'hm_message_metadata_unique'. Cannot insert duplicate key in object 'dbo.hm_message_metadata'."

"ERROR"	4132	"2011-08-16 03:28:58.599"	"Severity: 2 (High), Code: HM5032, Source: DALConnection::Execute, Description: Source: ADOConnection::Execute(), Code: HM10044, Description: Error while executing SQL statement: 
INSERT INTO hm_message_metadata (metadata_accountid, metadata_folderid, metadata_messageid, metadata_dateutc, metadata_from, metadata_subject, metadata_to, metadata_cc) VALUES (2330, 2442, 9460009, N'2011-04-18 15:52:47', N'***** <*****@sfr.fr>', N'*****SUBJECT*******', N'*****@mail.com', N'')
Microsoft OLE DB Provider for SQL Server
Violation of UNIQUE KEY constraint 'hm_message_metadata_unique'. Cannot insert duplicate key in object 'dbo.hm_message_metadata'."

Thank you.
Nicolas Cavaré
hMailServer 5.4.1 B1951 external MSSQL 2008 r2
Windows 2008 r2 | 2 x Intel Xeon E5-2650v2 | 64 Go DDR3 | 2 x Intel SSD 600go

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

Re: Violation of UNIQUE KEY 'hm_message_metadata_unique'

Post by ^DooM^ » 2011-08-16 11:33

What version of hMail?
Do you have message indexing enabled?
If at first you don't succeed, bomb disposal probably isn't for you! ヅ

snico
New user
New user
Posts: 27
Joined: 2010-01-04 12:18

Re: Violation of UNIQUE KEY 'hm_message_metadata_unique'

Post by snico » 2011-08-16 17:33

hMailServer 5.3.3 - Build 1879

Yes message indexing enabled : 841627 messages.

I have a 2nd error, every 5 days :

Code: Select all

"ERROR"	3628	"2011-08-06 03:01:03.292"	"Severity: 4 (Low), Code: HM5137, Source: TCPConnection::PostTimeout, Description: An error occured while sending a timeout message to the client. Remote IP: , Error code: 10009, Message: The file handle supplied is not valid"

"ERROR"	1944	"2011-08-11 12:51:16.800"	"Severity: 4 (Low), Code: HM5137, Source: TCPConnection::PostTimeout, Description: An error occured while sending a timeout message to the client. Remote IP: , Error code: 10009, Message: The file handle supplied is not valid"

"ERROR"	1400	"2011-08-16 16:19:35.255"	"Severity: 4 (Low), Code: HM5137, Source: TCPConnection::PostTimeout, Description: An error occured while sending a timeout message to the client. Remote IP: , Error code: 10009, Message: The file handle supplied is not valid"
Nicolas Cavaré
hMailServer 5.4.1 B1951 external MSSQL 2008 r2
Windows 2008 r2 | 2 x Intel Xeon E5-2650v2 | 64 Go DDR3 | 2 x Intel SSD 600go

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

Re: Violation of UNIQUE KEY 'hm_message_metadata_unique'

Post by ^DooM^ » 2011-08-16 18:49

I suggest stopping indexing if you are using the MSSQLCE database. the builtin mssql database does not handle indexing correctly. Upgrade to either a dedicated MSSQL or MySQL server if you need to use indexing. The builtin DB's are only meant for low use/easy install.

As for the second error I am not sure what the issue could be with that. Upgrading to 5.4 (which is alpha but considered stable by most including myself) to see if that fixes your issue.

As with any maintenance work, backup everything before you start.
If at first you don't succeed, bomb disposal probably isn't for you! ヅ

snico
New user
New user
Posts: 27
Joined: 2010-01-04 12:18

Re: Violation of UNIQUE KEY 'hm_message_metadata_unique'

Post by snico » 2011-10-11 22:01

Hello,
Sorry for the delay,
I just upgrading to 5.4 and I use MS SQL 2008 r2.
I activate "Message indexing" because i think this can improve performance.

I'll check if I still have errors and I'll let you know.
Nicolas Cavaré
hMailServer 5.4.1 B1951 external MSSQL 2008 r2
Windows 2008 r2 | 2 x Intel Xeon E5-2650v2 | 64 Go DDR3 | 2 x Intel SSD 600go

Post Reply