This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Database Maintenance wasn't able to complete. - Violation of PRIMARY KEY constraint

I'm getting the following error under "Deployment Health" and in my Database Maintenance log. Solarwinds support claims that this is a SQL issue and that I'm on my own.

---------------------------------------------------

Database Maintenance wasn't able to complete.

Following errors were detected: - 2019-01-30 11:32:34 : Error in thread: System.Data.SqlClient.SqlException (0x80131904): Violation of PRIMARY KEY constraint 'PK_ResponseTime_CS_Hourly_20181226'. Cannot insert duplicate key in object 'dbo.ResponseTime_CS_Hourly_20181226'. The duplicate key value is (2018-12-25 19:00:00.0000000, 309)....

---------------------------------------------------

I know enough SQL to understand that the primary key for the data that is attempting to be inserted into 'dbo.ResponseTime_CS_Hourly_20181226' is 'PK_ResponseTime_CS_Hourly_20181226' and consists of two fields, the datetime and the nodeid.

I believe this is a part of a summarization process that is failing. My retention policy for hourly data is set to 30 days so the data in question is stale but because the process is failing, I have records back to 12/17/2018 which is when I updated Solarwinds to the latest release.

Can anyone give me some advice for getting around this?

Traditionally I've been hesitant about upgrading to the latest release but since this version had some features we've been waiting for, I went ahead and bit the bullet. Now I'm regretting that decision. For any Solarwinds folks, the case # is 00246791.

Thanks!

  • I managed to fix this by following the technique posted here.

    I had to change the primaries key and the database object to match my error, obviously. I then ran the database maintenance, it barked about the primary key constraint being missing, I then ran the configuration wizard. After running the wizard, I reran the database maintenance and lo and behold made it past the error. Summarization completed and the old tables were removed.