CMS Snapshot Analysis - Generate Modules
Purpose (problem description)
This page provides approach to troubleshoot the problems related to Generate Modules feature under CMS Snapshot Analysis.
Modules are used to configure analysis results into meaningful groups or sets for display purposes.Objects cannot be seen in the CAST Dashboard if they are not part of a Module.

For more information, refer to:
- Offical 8.3 Documentation - Run and validate the analysis
Information Guides > Information Guides by CAST AIP Component > CMS Snapshot Analysis
Error Free Logs - CMS Snapshot Analysis - Generate Modules - Error Free Logs - CAST AIP 83
Observed in CAST AIP
| Release | Yes/No |
|---|---|
| 8.3.x | ✅ |
| 8.2.x | ✅ |
| 8.1.x | ✅ |
| 8.0.x | ✅ |
| 7.3.x | ✅ |
| 7.2.x | ✅ |
| 7.0.x | ❌ |
Observed on RDBMS
| RDBMS | Yes/No |
|---|---|
| Oracle Server | ✅ |
| Microsoft SQL Server | ✅ |
| CSS3 | ✅ |
| CSS2 | ✅ |
| CSS1 | ❌ |
Action Plan
- If the number of objects in modules is not as expected:
Run the following queries to check the number of objects in Modules :
The below query is based on the result of Analysis :
SELECT km.idkey AS “Module ID”,
km.keynam AS “Module Name”,
kp.idkey AS “Project ID”,
kp.keynam AS “Project name”,
tm.typnam AS “Type of Project”,
tob.idtyp AS “Type ID of objects”,
tob.typdsc AS “Type of Objects”,
Count(DISTINCT k1.idkey) AS “Number Of Objects”
FROM

2. The below query is based on Result of Analysis AND the Generate Module Step :
```sql
-- Number of objects, per module, per type
SELECT cpf.object_name AS "Module Name",
k.objtyp AS "Type ID",
t.typnam AS "Type Name",
Count(pso.object_id) AS "Objects Count"
FROM <mngt>.cms_portf_module cpf
JOIN <mngt>.cms_dynamicfields cdf
ON cdf.object_id = cpf.object_id
AND cdf.field_guid = 'entry'
JOIN <local>.pmc_subsets ps
ON ps.subset_name = 'CMS_MOD__' || cdf.field_value || '_Preparation2'
JOIN <local>.pmc_subset_objects pso
ON pso.subset_id = ps.subset_id
JOIN <local>.keys k
ON k.idkey = pso.object_id
JOIN <local>.typ t
ON t.idtyp = k.objtyp
GROUP BY cpf.object_name,
k.objtyp,
t.typnam
ORDER BY cpf.object_name,
t.typnam;

3. The result of both the queries must be consistent.
4. If the results are not consistent :
1. Check if there are external objects involved in the second query by running the below query :
```sql
SELECT cpf.object_name AS “Module Name”,
k.objtyp AS “Type ID”,
t.typnam AS “Type Name”,
k.idkey AS “Object ID”,
k.keynam AS “Object Name”,
CASE
WHEN op.prop = 1 THEN ‘External object’
WHEN op.prop = 0 THEN ‘Internal object’
END
FROM
2. This query must not return rows. If it does, that means that the objects that are displayed are external objects:
1. In CAST Management Studio check if there are tools after analysis and tools after module generation that change the properties of the object, turning it from Internal to External object.
5. If the results of both queries are not as expected :
1. Check and clean any ghost objects by running the queries described in the page [SQL Queries - CAST Knowledge Base - Queries on objects - Identify and clean up all the ghost objects and ghost projects in your knowledge base](/export-v2/tg/sql-queries/sql-queries-cast-knowledge-base/sql-queries-cast-knowledge-base-queries-on-objects/sql-queries-cast-knowledge-base-queries-on-objects-identify-and-clean-up-all-the-ghost-objects-and-ghost-projects-in-your-knowledge-base/)
2. If you are not facing issues related to incorrect number of objects, select the type of issue you are facing:
3. If you do not find the information you are looking for or solution for your problem, in this page, contact [CAST Technical Support](https://help.castsoftware.com/hc/en-us/requests/new) with the below [relevant input](#CMSSnapshotAnalysisGenerateModules-RelevantInput) to help CAST Support team investigate your problem or procure the required information.
#### **Relevant Input**
- **[CAST Support Tool (CST) - alias Sherlock](https://help.castsoftware.com/hc/en-us/articles/203751708-CAST-Support-Tool-CST-alias-Sherlock)** : Option to select are **Export Cast Dabatase, Export logs, Export Configuration files, Export source code**. (Source code is required if we need to test corruptions that have been fixed)
- Screenshot describing the error/warning
**Notes/comments**
**Related Pages**