Unable to add attachment on Resource " Cannot insert duplicate key row"
search cancel

Unable to add attachment on Resource " Cannot insert duplicate key row"

book

Article ID: 426695

calendar_today

Updated On:

Products

Clarity PPM On Premise Clarity PPM SaaS

Issue/Introduction

Unable to add an attachment on Resource object, error in UI is thrown “Could not upload <filename>”

In app-ca we can see the error:

ERROR 2026-01-07 13:29:28,629 [http-nio-80-exec-104] object.ODFAbstractObjectImpl (clarity:admin:76116172__3C136EC2-98E1-4B09-9AAF-142F38F0AFAB:PPM_REST_API) (cd051890-7e78-4d50-9800-a1a6580049d1) Unable to create attribute attachment folder
com.niku.union.persistence.PersistenceException:
SQL error code: 2601
Error message: Cannot insert duplicate key row in object 'niku. CLB_DMS_FOLDERS' with unique index 'CLB_DMS_FOLDERS_UK3'. The duplicate key value is (5002021, Resources).

Environment

All Supported Clarity Releases with SQL Server

Cause

Resource ID mismatch due to manual SQL updates / migration from other systems

Resolution

  1. Run the query to identify the mismatched Resource ID records:
      SELECT 
            fo.id, 
            sr.unique_name
        FROM CLB_DMS_FOLDERS AS fo
        JOIN srm_resources AS sr 
            ON fo.assoc_obj_id = sr.id
        WHERE fo.ASSOC_OBJ_TYPE = 'Resources'
          AND fo.name <> sr.unique_name
  2. Fix the resource ID records in CLB_DMS_FOLDERS table after carefully examining the root cause of the issue and the values in all other resource tables