]> BizTalk Server 2020 - CU4 installation error: -2147217873 🌐:aligrant.com

BizTalk Server 2020 - CU4 installation error: -2147217873

Alastair Grant | Tuesday 14 March 2023

I was updating a local copy of Microsoft BizTalk Server 2020 with cumulative update 4, when error struck and it failed to complete.  Fortunately for me, the log file the installer created was pretty useful, and I found this error sat near the end of the file:

[03/14/23 15:39:51] ExecuteCommand HRESULT=0x80040e2f
[03/14/23 15:39:51] The statement has been terminated. HRESULT=0x80040e2f
[03/14/23 15:39:51] SQL error: 01000 Native error code:  HRESULT=0x80040e2f
[03/14/23 15:39:51] Violation of UNIQUE KEY constraint 'UQ__JobData__F1AC1A950529D150'. Cannot insert duplicate key in object 'dbo.JobData'. The duplicate key value is (MessageBox_Message_Cleanup_BizTalkMsgBoxDb). HRESULT=0x80040e2f
[03/14/23 15:39:51] SQL error: 23000 Native error code:  HRESULT=0x80040e2f
[03/14/23 15:39:51] file.Close HRESULT=0
[03/14/23 15:39:51] session.Close HRESULT=0
[03/14/23 15:39:51] dataSource.Close HRESULT=0
[03/14/23 15:39:51] Failed to apply patch. HRESULT=0x80040e2f
[03/14/23 15:39:51] Abort distributed transaction.
[03/14/23 15:39:51] Failed to patch one or more BizTalk databases. See log for details. (HRESULT=0x80040e2f)
[03/14/23 15:39:51] The custom action returned -2147217873.

The table it's referring to is the BizTalkMsgBoxDb.dbo.JobData table, which contains a fairly boring list of some BizTalk jobs, I assume related to this database.  And when checking, sure enough, there is the entry the log file has complained about.  So I took a punt and truncated the table and ran the installer again and it completed without a hitch.  On checking back after patching, the table had been repopulated with the entries I had truncated.

There is a monumentally long SQL script that get generated to patch the tables, all with transaction wrappers to roll back if it has failed - but I do not have the time or the patience to trawl through that to see exactly where it went wrong.

Breaking from the voyeuristic norms of the Internet, any comments can be made in private by contacting me.