During Code Insight operations, the Library Refresh process may fail with the following error:
Duplicate entry '*********' for key 'PAS_USER_PREFERRED_LICENSE_MAPPING.UNIQ_USER_PREFERRED_LICENSE_MAPPING'
Here, ********* could be any value like: 258633077-389-GLOBAL.
Root Cause
The failure is caused by duplicate entries in the PAS_USER_PREFERRED_LICENSE_MAPPING table.
These duplicates often result from:
- Interrupted or failed electronic updates.
IMPORTANT: Back up the database before executing these queries. Ensure you enter the correct IDs when performing deletions.
#1: Check for Duplicate Entries
Run the following SQL query to identify duplicates:
SELECT PLM.ID_, PLM.VERSION_ID_, PLM.REPO_ITEM_ID_, CV.VERSION_NAME_, CVC.VERSION_NAME_, PLM.SCOPE_, RI.ITEM_TYPE_, CV.COMPONENT_ID_, CVC.COMPONENT_ID_, RI.COMPONENT_ID_, RI.COMPONENT_VERSION_ID_, CVC.ID_
FROM PAS_USER_PREFERRED_LICENSE_MAPPING AS PLM,
PDL_COMPONENT_VERSION AS CV,
PDL_COMPONENT_VERSION_CUSTOM AS CVC,
PAS_REPOSITORY_ITEM RI
WHERE RI.ITEM_TYPE_ = 'CVC'
AND RI.ID_ = PLM.REPO_ITEM_ID_
AND CV.COMPONENT_ID_ = CVC.COMPONENT_ID_
AND CV.VERSION_NAME_ = CVC.VERSION_NAME_
AND RI.COMPONENT_ID_ = CVC.COMPONENT_ID_
AND RI.COMPONENT_VERSION_ID_ = CVC.ID_
AND EXISTS (
SELECT 1
FROM PAS_USER_PREFERRED_LICENSE_MAPPING AS DUP
WHERE DUP.VERSION_ID_ = CV.ID_
AND DUP.LICENSE_ID_ = PLM.LICENSE_ID_
AND DUP.SCOPE_ = PLM.SCOPE_
);
If this query returns rows, it confirms the presence of duplicate entries.
#2: Delete Duplicate Entries
Extract the PLM.ID_ values from the first column of the result and run the following:
DELETE FROM PAS_USER_PREFERRED_LICENSE_MAPPING
WHERE ID_ IN (IDs collected from PLM.ID_ column from previous query);
IMPORTANT: Ensure the IDs are correct before executing the delete query.
#3: Update License Mapping
- Update
VERSION_ID_ in PAS_USER_PREFERRED_LICENSE_MAPPING:UPDATE PAS_USER_PREFERRED_LICENSE_MAPPING AS PLM, PDL_COMPONENT_VERSION AS CV, PDL_COMPONENT_VERSION_CUSTOM AS CVC, PAS_REPOSITORY_ITEM RI SET PLM.VERSION_ID_ = CV.ID_ WHERE RI.ID_ = PLM.REPO_ITEM_ID_ AND RI.ITEM_TYPE_ = 'CVC' AND CV.COMPONENT_ID_ = CVC.COMPONENT_ID_ AND CV.VERSION_NAME_ = CVC.VERSION_NAME_ AND RI.COMPONENT_ID_ = CVC.COMPONENT_ID_ AND RI.COMPONENT_VERSION_ID_ = CVC.ID_; - Update
COMPONENT_VERSION_ID_andITEM_TYPE_ in PAS_REPOSITORY_ITEM:UPDATE PAS_REPOSITORY_ITEM AS R, PDL_COMPONENT_VERSION AS CV, PDL_COMPONENT_VERSION_CUSTOM AS CVC SET R.COMPONENT_VERSION_ID_ = CV.ID_, R.ITEM_TYPE_ = 'CV' WHERE R.ITEM_TYPE_ = 'CVC' AND CV.COMPONENT_ID_ = CVC.COMPONENT_ID_ AND CV.VERSION_NAME_ = CVC.VERSION_NAME_ AND R.COMPONENT_ID_ = CVC.COMPONENT_ID_ AND R.COMPONENT_VERSION_ID_ = CVC.ID_; - Clean up unused custom versions:
DELETE FROM PDL_COMPONENT_VERSION_CUSTOM WHERE NOT EXISTS ( SELECT 1 FROM PAS_REPOSITORY_ITEM WHERE PAS_REPOSITORY_ITEM.ITEM_TYPE_ = 'CVC' AND PDL_COMPONENT_VERSION_CUSTOM.ID_ = PAS_REPOSITORY_ITEM.COMPONENT_VERSION_ID_ );
IMPORTANT: These queries may take time to execute. Please wait for completion before proceeding.
After these steps, the subsequent Library Refresh job should pass.
Related Articles
Compliance Service Errors due to assigned duplicate metrics - Problem 04356588 61Number of Views Import writers may fail at step "Create new AutoSynchronized licenses" due to duplicate SKU entries published in the SKU l… 5Number of Views Known Issue: Import writers may fail at step "Create new AutoSynchronized licenses" due to duplicate SKU entries published… 7Number of Views "Import ManageSoft application recognition library" scheduled task fails with 0x1 error code 5Number of Views Normalization job failed error: Please check your refresh token. And also try to check your [client_secret] in ServiceNow 29Number of Views
Hi, I am Reva - Ask me anything.
No new updates
Thanks for the feedback!
Your feedback has been saved.Rate this response:
Add Additional feedback ( Optional )
Are you sure you want to cancel
the case creation?
Are you sure you want to cancel the case creation?
Are you sure you want to close this case
| Products | Region | Phone Numbers |
|---|---|---|
| FlexNet Operations FlexNet Embedded FlexNet Publisher FlexNet Connect FlexNet Code Insight InstallAnywhere InstallShield |
North America * |
+1 630-332-2513 (toll) +1 877-279-2853 (toll-free in North America) |
| Europe * |
+44 1925 944367 (toll) +44 800 047 8642 (toll-free in Europe) |
|
| Japan * | +81 3-4540-5335 (select option 2) | |
| Australia * |
+61 3 9895 2177 +61 1800 560 603 (toll-free in Australia) |
|
|
Usage Intelligence (formerly
Revulytics) Compliance Intelligence |
Please use the Case Portal to submit your support ticket or reach out to your Revenera contact. | |
Case id: 00001065
Activity: Status change: 2 hours ago