Purpose (problem description)

This page will help in troubleshooting the issue with duplicate versions of Delivery seen in Cast-MS.


Duplicate deliveries can come up in the delivery tab of an application for which a delivered version with a snapshot already exists due to various scenarios similar such as this specific one mentioned below:

  • Open Cast-MS and in parallel open a command prompt and execute a CAST-MS-CLI.exe AutomateDelivery with all the appropriate parameters creating a new delivery from the same application. Once this finishes successfully, refresh your view in Cast-MS which will show you the new delivery.
    Now if you exit CMS, saving all. When you reopen CMS you will have your duplicate delivery
     



This may also result in an error when trying to add a version as shown in the screenshot below:


Observed in CAST AIP


Release
Yes/No
8.3.x(tick)
Observed on RDBMS
RDBMS
Yes/No
CSS (tick)

Step by Step scenario

Since the issue is linked to concurent connection to CAST Management Studio, the step by step scenario can be as follows (other scenarios are possible as well):

1)Deliver V1 through DMT. 
2)In CMS,accept V1 and set it as current version. 
3)Run snapshot for V1. 
4)Leave CMS open. 
5)Open command prompt and run the following: 

CAST-MS-cli.exe AutomateDelivery -connectionProfile "!Name of the profile" -appli "Your Application Name" -version "V2" -fromVersion "V1" -date 20150718 

6)After completion of process, refresh the CMS and check V1 and V2 in delivery tab of CMS 
7)Click Save and close CMS 
8)Again open the CMS and check for duplicate deliveries of V2

Relevant input

  1. Provide us with the CAST Support Tool (CST) - alias Sherlock
     
  2. Screenshot showing the duplicated versions in Cast-MS

Action 1

Remove the duplicate version with respect to their duplicated object_id from the Management base

Solution

Workaround:

Run the following query on management base

DELETE FROM CMS_PORTF_Version v
WHERE v.Object_ID IN 
(
SELECT d1.Object_ID
--.*
FROM 
(
SELECT v1.* FROM cms_portf_version v1 JOIN cms_portf_version v2 
ON (v1.previousVersion = v2.previousVersion) AND (v1.Object_ID != v2.Object_ID)
) d1
JOIN 
(
SELECT v2.* 
FROM cms_portf_version v1 JOIN cms_portf_version v2 
ON (v1.previousVersion = v2.previousVersion) AND (v1.Object_ID != v2.Object_ID)
) d2
ON (d1.previousVersion = d2.previousVersion) AND (d1.Application_ID=d2.Application_ID) AND (d1.Object_ID < d2.Object_ID)
)


Action 2

Remove the duplicate version with respect o the duplicated version names

If the query in Action 1 does not resolve the issue, the duplication would be in the delivery name and not the object_id.

Workaround

Query 1:

delete from CMS_PORTF_Version where object_id not in
(select max(object_id) from CMS_PORTF_Version
group by object_name, application_id);

Query 2:

delete
from CMS_DynamicFields
where Entity_GUID = 'pmcdeliveryunit.ApplicationVersion'
and Object_ID not in (select Object_ID from CMS_PORTF_Version);


Action 3

In some cases, there may also be duplication in the applications index.xml file. Check if there is duplication in the name field and then remove it with the steps below. The following TKB page can assist you with finding and understanding the delivery folder structure and the application index.xml file: Delivery Manager Tool - Information - DELIVERY Folder Structure and Contents

  • Stop all DMT and CMS activites for the application
  • Backup the application's delivery folder contents
  • Edit the index.xml file and remove all of the entries for one of the duplicates that exists in the application's index.xml file.
    • For example in the below screenshot of the <uuid>_name <>_Remediation, the file should be edited to remove all entries that start with the key="ela4859e-b529-43d5-afb4-a2b7f04033f...


Permanent Fix:

In CAST 8.2.6 a locking mechanism has been introduced to prevent this behavior. You have to enable the lock on the session in your Management DB by running the following function:

select <<MNGT>>.sys_set_option('Enable CMS Lock Management', 'yes')

To remove the lock, run the following function:

select <<MNGT>>.sys_remove_option('Enable CMS Lock Management')


 


Notes/comments

Ticket # 4693, 10180, 14642

Related Pages