Error during Endpoint Protection Manager upgrade, "Violation of PRIMARY KEY constraint 'PK_NOTIFICATION'"
search cancel

Error during Endpoint Protection Manager upgrade, "Violation of PRIMARY KEY constraint 'PK_NOTIFICATION'"

book

Article ID: 263861

calendar_today

Updated On:

Products

Endpoint Protection

Issue/Introduction

When attempting to upgrade the Endpoint Protection Manager (SEPM) from 14.3 RU1 MP1 or earlier, you receive the following error: 

2021-06-29 09:02:07.516 THREAD 30 INFO:  INSERT INTO NOTIFICATION VALUES('248C07CFEE454089BD0657EC5B0B9E8E','CQ','AF3C39A10A320801000000DBF200C60A',420,'%','%','%','%','%','%','%','',10,1,'database',0,0,'','>= -1',3,1336737064232,0,0,0,0,'','Central Quarantine',1,0,'',0,NULL)
2021-06-29 09:02:07.532 THREAD 30 SEVERE: SQL Exception:
2021-06-29 09:02:07.532 THREAD 30 SEVERE: SQL Command:  INSERT INTO NOTIFICATION VALUES('248C07CFEE454089BD0657EC5B0B9E8E','CQ','AF3C39A10A320801000000DBF200C60A',420,'%','%','%','%','%','%','%','',10,1,'database',0,0,'','>= -1',3,1336737064232,0,0,0,0,'','Central Quarantine',1,0,'',0,NULL)2021-06-29 09:02:07.532 THREAD 30 SEVERE: SQLState:  23000
2021-06-29 09:02:07.532 THREAD 30 SEVERE: Message:  Violation of PRIMARY KEY constraint 'PK_NOTIFICATION'. Cannot insert duplicate key in object 'dbo.NOTIFICATION'. The duplicate key value is (248C07CFEE454089BD0657EC5B0B9E8E).
2021-06-29 09:02:07.532 THREAD 30 SEVERE: Vendor:  2627
2021-06-29 09:02:07.532 THREAD 30 SEVERE: com.microsoft.sqlserver.jdbc.SQLServerException: Violation of PRIMARY KEY constraint 'PK_NOTIFICATION'. Cannot insert duplicate key in object 'dbo.NOTIFICATION'. The duplicate key value is (248C07CFEE454089BD0657EC5B0B9E8E).
2021-06-29 09:02:07.532 THREAD 30 SEVERE:  at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:262)
2021-06-29 09:02:07.532 THREAD 30 SEVERE:  at com.microsoft.sqlserver.jdbc.TDSTokenHandler.onEOF(tdsparser.java:283)

Environment

Release : 14.3 RU1 MP1

Cause

The upgrade to 14.3 RU2 and later will add new values to the NOTIFICATION table within the SEPM database.  If a previous upgrade attempt failed after adding these values to the database, subsequent upgrade attempts will fail as the values are already inserted into the database. 

Resolution

There are two options to fix this. 

The first option is to restore the database to a version prior to any upgrade attempts and then attempt the upgrade again. 

The second option is to remove the values that were added to the database during the failed upgrade attempt by following these steps: 

1.  Backup the SEPM database. See the following documentation for steps on backing up the database. 

2.  Stop the SEPM services if they are running. 

3.  Open SQL Management Studio and run the following two queries on the SEPM database. 

Delete from NOTIFICATION
where NOTAG_IDX = '248C07CFEE454089BD0657EC5B0B9E8E'
Delete from GUIPARMS
where GUIPARMS_IDX IN (77, 78, 79, 80, 81, 82, 83, 84, 85)

4.  Upgrade the SEPM database schema by running upgrade.bat from \Program Files (x86)\Symantec\Symantec Endpoint Protection Manager\bin

Additional Information

CRE-7838