Purpose (problem description)

This page will help you troubleshoot the crash in snapshot with HD consolidation error received while running the a snapshot.
While running a snapshot (with option "Upload result to Measurement" set to true), we might run into the below error with the the snapshot crashing.

The program HD Consolidation Tool has not ended correctly.

While you will see this issue on the GUI, looking into the Cast-MS log file you can see that you will have the detailed error as to why the consolidation failed.
The error you will see on the log will be detailed:

2014-06-24 16:46:33 CEST [12116]: [5-1] ERROR: more than one row returned by a subquery used as an expression
2014-06-24 16:46:33 CEST [12116]: [6-1] CONTEXT: SQL statement "Update ADG_DELTA_SNAPSHOTS
set LAST_SNAPSHOT_ID = (select s.SNAPSHOT_ID from ADG_DELTA_SNAPSHOTS s where s.APPLICATION_ID = ADG_DELTA_SNAPSHOTS.APPLICATION_ID and s.LATEST = 1),
LAST_TEXT_DATE = (select s.TEXT_DATE from ADG_DELTA_SNAPSHOTS s where s.APPLICATION_ID = ADG_DELTA_SNAPSHOTS.APPLICATION_ID and s.LATEST = 1)
where exists (select 1 from ADG_DELTA_SNAPSHOTS s where s.APPLICATION_ID = ADG_DELTA_SNAPSHOTS.APPLICATION_ID and s.LATEST = 1)"
PL/pgSQL function adg_compute_delta_snapshots(integer) line 111 at SQL statement
SQL statement "select ADG_COMPUTE_DELTA_SNAPSHOTS (37)"
PL/pgSQL function dss_execute_named_side_process(integer,character varying,integer) line 64 at EXECUTE statement
SQL statement "select DSS_EXECUTE_NAMED_SIDE_PROCESS(I_SNAPSHOT_ID, 'ALL', I_SIDE)"
PL/pgSQL function dss_execute_side_process(integer,integer) line 5 at SQL statement
PL/pgSQL function dss_cleanup_compute_metric(integer) line 6 at assignment

This error is raised during the consolidation phase of the snapshot in the measurementbase where the functional date of at least two snapshots are same.
During the consolidation phase the snapshot results are uploaded onto the measurement, so in case there exists any snapshot with the same date as being uploaded we will get this error.

Observed in CAST AIP
Release
Yes/No
8.3.x(tick)
8.2.x(tick)
8.1.x(tick)
8.0.x(tick)
7.3.x(tick)
7.2.x(tick)
7.0.x(error)
Observed on RDBMS
RDBMS
Yes/No
Oracle Server(error)
Microsoft SQL Server(error)
CSS3(tick)
CSS2(tick)
CSS1(error)
Step by Step scenario
  1. Launch HDConsolidation-GUI.exe
  2. Fill the Central and the measurement database names and other fields
  3. Click Run Application
  4. Observe that the Consolidation fails with error - more than one row returned by a subquery used as an expression
Action Plan
  1. Get the customer CAST-MS log file.
  2. If you see the same error as mentioned proceed to the solution.
Relevant customer's input


Action Plan

You need to check the functional dates of all your snapshots on your central base to make sure that no two snapshots have the same functional date.
If you have any then please make sure you change the dates to be unique by following the below steps:

1 - In CMS, at the central database service (snapshots tab), check that all functional dates are in the correct order, change the snapshot dates if needed (if they are duplicated)
2 - In CMS, 'Consolidate' each snapshots of the Central Service.
3 - In CMS, 'Upload Snapshot to Measurement Service' for each snapshots of the Central Service
4 - Run a new snapshot again.

 If you still receive the same error then we have a snapshot with duplicate functional date already existing on the measurement base.
In this scenario the only solution is to do a full reset of the measurement base which will clear the base of the duplicate results and then you can follow the steps 1-4 to upload the snapshot results again..

How to do a full reset of the measure database:
To do a full reset(delete all results) of the measure database follow the documentation mentioned below:

Refer to the documentation: Go To : CAST AIP 7.2 Documentation > Cookbooks > Platform Administration > Portal Administration > CAST Application Analytics Dashboard > Using the HD GUI and CLI tools
Go To : CAST AIP 7.2 Documentation > Cookbooks > Platform Administration > Portal Administration > CAST Application Analytics Dashboard > Using the HD GUI and CLI tools.

Notes/comments

This issue occurs due to a bug in CMS which does not do a synchronization between the measurement base and the central base when any changes are made to the existing snapshot.
For Example: If you delete a snapshot from the central base just before taking a new one and the new snapshot has the same functional date that of the deleted one, the consolidation is going to fail as a snapshot with the same date would already exist.
This has been reported to R&D and is planned to be improved in some SP of 7.2.