Exchange toolbox, queue view error. Exchange 2016

Ilya Lubenets 0 Reputation points
2025-02-06T08:06:22.6466667+00:00

Hello. When attempting to open the message queue view in Exchange Toolbox, an error occurs: "Failed to enable constraints. At least one row contains a value that violates non-null, uniqueness, or foreign-key constraints."

All columns of this data table are: NextHopDomain DeliveryType Status MessageCount NextRetryTime LastRetryTime LastError Identity CanSuspend CanResume CanRemove CanForceRetry

System.Data.ConstraintException: Failed to enable constraints. At least one row contains a value that violates non-null, uniqueness, or foreign-key constraints.

All columns of this data table are: NextHopDomain DeliveryType Status MessageCount NextRetryTime LastRetryTime LastError Identity CanSuspend CanResume CanRemove CanForceRetry ---> System.Data.ConstraintException: Failed to enable constraints. At least one row contains a value that violates non-null, uniqueness, or foreign-key constraints.

at System.Data.DataTable.EnableConstraints() at System.Data.DataTable.set_EnforceConstraints(Boolean value) at System.Data.DataTable.EndLoadData() at Microsoft.Exchange.Management.SystemManager.DataTableLoader.MoveRows(DataTable sourceTable, DataTable destinationTable, Boolean forceUseMergeTable) --- End of inner exception stack trace --- at Microsoft.Exchange.Management.SystemManager.DataTableLoader.MoveRows(DataTable sourceTable, DataTable destinationTable, Boolean forceUseMergeTable) at Microsoft.Exchange.Management.SystemManager.DataTableLoader.OnDoRefreshWork(RefreshRequestEventArgs e) at Microsoft.Exchange.Management.SystemManager.RefreshableComponent.worker_DoWork(Object sender, DoWorkEventArgs e) at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e) at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)

When I check the message queues using the Management Shell with the Get-Queue command, everything is fine there are no stuck messages. Mail is being sent and received without any issues. But GUI queue doesn't work.

What could this be and how to fix it?

Exchange Server
Exchange Server
A family of Microsoft client/server messaging and collaboration software.
1,446 questions
Exchange Server Management
Exchange Server Management
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Management: The act or process of organizing, handling, directing or controlling something.
7,791 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Amit Singh 5,071 Reputation points
    2025-02-07T04:45:44.2366667+00:00

    As you said, when you check the queues using the PowerShell command Get-Queue, everything looks fine, and mail is flowing normally. There could be a corrupted message or queue data that’s not visible through Get-Queue. You might need to dig deeper into the logs or use a tool to check for corrupted messages.

    Additionally, you can verify your Exchange server is up to date with the latest Cumulative Update (CU), as these types of issues can sometimes be fixed in updates.

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    0 comments No comments

  2. Amit Singh 5,071 Reputation points
    2025-02-07T04:46:08.1066667+00:00

    As you said, when you check the queues using the PowerShell command Get-Queue, everything looks fine, and mail is flowing normally. There could be a corrupted message or queue data that’s not visible through Get-Queue. You might need to dig deeper into the logs or use a tool to check for corrupted messages.

    Additionally, you can verify your Exchange server is up to date with the latest Cumulative Update (CU), as these types of issues can sometimes be fixed in updates.

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    0 comments No comments

  3. Bruce Jing-MSFT 8,555 Reputation points Microsoft Vendor
    2025-02-07T07:50:56.13+00:00

    Hi,@Ilya Lubenets

    Thanks for posting your question in the Microsoft Q&A forum.

    This error doesn’t indicate that your queues are “broken” or that mail is not flowing—it’s really a problem with how the Exchange Toolbox’s queue viewer is assembling the data.

    What’s happening is that the queue viewer builds a DataTable whose columns have non‑null, uniqueness, or foreign-key constraints. For one (or more) of the rows returned, one of the values (often in a field like NextRetryTime, LastRetryTime, or LastError) isn’t what the table expects—for example, it might be null even though the designer of the table expected a value. (Sometimes the value might simply be a “duplicate” for a unique column.) The underlying Get-Queue cmdlet returns the proper data, but when the GUI code loads that data into its DataTable it runs into a row that violates one of the constraints, and you get that error.

    To resolve or work around the issue, you can use CU for Ex2016 (CU23) with latest Security Patch https://www.microsoft.com/download/details.aspx?familyID=f15bf797-0ac3-4bff-9483-d8afeef5bdfc

    If you’re in an environment where you cannot upgrade immediately, simply be aware that the error is cosmetic and does not affect message delivery or processing.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.