Debugging Failed Runs

When running dbt™ in production, it's crucial to quickly identify and resolve failed runs. This guide will walk you through the process of debugging failed dbt™ runs using Bolt's comprehensive logging and debugging tools.

Estimated completion time: 15 minutes

Prerequisites


1. Identifying Failed Runs

There are two main ways to identify failed runs:

Method 1: Notifications

Set up Slack or email notifications to receive immediate alerts when a run fails. This is the recommended approach for production environments.

See Setting Up Notifications for details on configuring alerts.

Method 2: Bolt UI

Navigate to the Bolt home screen and check the "Status" column in the Bolt Schedule List. Failed runs are marked with a "Error" status indicator.

See Viewing Run History and Analytics for more details on using the Bolt UI.


2. Access and interpret run logs

Once you've identified a failed run, access the logs through the Bolt Schedule Detail Views:

  1. Click on the failed Bolt Schedule (one marked with a "Error" status indicator)

  2. Navigate to the Run History section

  3. Select the failed run (one marked with a "Error" status indicator)

  4. Scroll to the Logs and Artifacts section

  5. Click on the executed command that failed (ex. dbt run)

Bolt Provides three types of logs:

Run Log Type
Description
Use Case

Summary Logs

DinoAI-generated overview of failures

Quick assessment of issues

Console Logs

Detailed execution record

Finding specific errors and compiled SQL

Debug Logs

System-level operations

Deep technical troubleshooting

Console logs are typically the most useful for debugging as they show errors, warnings, and the compiled SQL code that failed in production.


3. Debug and resolve common issues

Follow these steps to debug a failed run:

  1. Review Summary Logs

    • Check the AI-generated overview

    • Note any suggested fixes

Summary Logs Example
Command executed 6 models:
- 5 models passed
- 1 model failed
- Error in "fct_fantasy_point_leaders" model
- Invalid identifier 'TOTAL_FANTASY_POINTS_PP' on line 9
  1. Review Console Logs

    • Locate error messages and warnings using the "jump to" feature

    • Click on the link for compiled SQL code

    • Review the execution flow and timing

  1. Test and Fix

    • Copy the compiled SQL code from console logs

      • Test the SQL:

        • Directly in your data warehouse, or

        • In the Code IDE scratchpad

      • Fix common issues:

        • Invalid column names

        • Missing model references

        • SQL syntax errors

        • Data type mismatches

After testing the compiled SQL code against your data warehouse, you'll be better equipped to resolve common issues with failed scheduled runs.



Summary

You've learned how to identify failed dbt™ runs, access and interpret different types of logs, and systematically debug and resolve issues. This knowledge will help you maintain reliable data pipelines and quickly resolve any failures that occur.

Next, consider exploring the related documentation to handle more complex failure scenarios.

Last updated

Was this helpful?