Monitor and troubleshoot DCM Projects¶
This topic describes how to monitor DCM deployments and troubleshoot failing DCM plans.
Troubleshoot a DCM project¶
If you are unfamiliar with the DCM project, you might run into errors from misconfigurations or other common pitfalls. This section describes those errors and how to resolve them.
Common causes for errors¶
The following table lists common causes for errors in a DCM project execution:
| Error category | Common causes |
|---|---|
| Secondary roles | - Users encounter inconsistent behavior due to unknowingly leveraging secondary role privileges when running DCM commands. |
| Insufficient role privileges |
|
| Jinja rendering issues |
|
| Project issues |
|
Recommended troubleshooting steps¶
Follow these steps to troubleshoot and debug a DCM project.
| Step | Details |
|---|---|
| Set secondary roles to none |
|
| Use error messages from PLAN |
|
| Narrow down |
|
| Change the client |
|
| Use Cortex Code for AI-assisted debugging |
|
Observe and audit DCM project deployments¶
DCM Projects are designed to provide full transparency and audit trails for all changes to your account infrastructure. This requires you to follow a few software development best practices for setting up infrastructure deployment processes. For more information, see Automate a DCM project deployment.
Use the following sources to review previous deployments:
- Deployment artifacts stored inside the DCM project
- Deployment history
- Event logs from a DCM project (depending on log-level settings)
Deployment artifacts¶
For every executed deployment, an immutable snapshot of the deployment artifacts is stored inside the DCM project, with the following information:
- The manifest file (
manifest.yml) - All object definition and macro files (
.sqlfiles) inside thesourcesfolder - The output of the PLAN operation (
plan_result.json) and the DEPLOY operation (deploy_result.json), including:- The templating variables used for this deployment
- Deployment metadata, including timestamp, object name, and query ID
- The changeset
This complete set makes all deployment actions reproducible for debugging, auditing, or redeploying the defined state. Deployment artifacts remain inside the DCM project for as long as the project object exists, which makes them the canonical audit trail for a DCM project. The Deployment history function is a faster, higher-level way to query this information.
The following commands are available for observing and auditing a DCM project:
-
With the MONITOR privilege, you can:
- List all deployments stored inside the DCM project.
- List all files inside a specified deployment.
- Read, copy, or download specific files inside that deployment.
-
With the OWNERSHIP privilege, you can manually drop a deployment if it contains sensitive data.
-
With the READ privilege, you can run the DESCRIBE command to see the most recent deployment name, alias, and timestamp for a selected DCM project.
Example commands:
Deployment history¶
The DCM_DEPLOYMENT_HISTORY Information Schema table function provides role-based access and low-latency ways to see successful and failed deployments for a selected DCM project.
For the full syntax, arguments, output columns, and examples, see the DCM_DEPLOYMENT_HISTORY reference.
Note
The DCM_DEPLOYMENT_HISTORY function returns deployments from the past 12 months only. There is no ACCOUNT_USAGE view equivalent. Older deployments remain available as deployment artifacts inside the DCM project for as long as the project object exists, so the artifacts (not this function) are the canonical long-term audit trail.
To see your deployment history in Snowsight:
-
In the navigation menu, select Catalog » Database Explorer.
-
Navigate to the schema that contains the DCM project.
-
Select the DCM project object to see its details.
-
Select the Deployment History tab to see a list of all deployments from this project object.
-
Select a deployment from the table to see:
- Deployment metadata, such as the timestamp and the templating configuration values applied for the deployment.
- A list of every entity that was created, altered, or dropped during the deployment.
-
Expand the card of any created or altered entity to see more details about the change.
Event logs¶
You can set the preferred LOG_LEVEL on the DCM project object or inherit the defined LOG_LEVEL from the parent schema, database, or account.
If the LOG_LEVEL for the DCM project is set, failed PLAN and DEPLOY executions are logged with the corresponding error messages as an event, and you can see them by querying the defined event table. For more information about setting up event tables and log levels, see Event table overview.
For example:
- In the navigation menu, select Monitoring » Traces & logs.
- Select the Logs tab.
- Select the appropriate event table.
- Filter by the project’s parent database or schema.