Skip to content

Failed model/snapshot name not surfaced when a driver-level error occurs during evaluation #6064

Description

@fresioAS

Description

When a snapshot evaluation fails due to an underlying driver or engine error, only the raw exception text is printed. The failing model or snapshot name is missing from the output.

Example

MSSQL via DDBC:

Error: Driver Error: Invalid character value for cast specification; DDBC Error: [Microsoft][SQL Server]Explicit conversion from data type bigint to datetime2 is not allowed.

Expected Behavior

The error output should include the failing model or snapshot name directly, without requiring verbose logging.

This is especially important in CI pipelines where many models may run concurrently.

Context / Suspected Cause

SQLMesh already wraps per-node execution failures in NodeExecutionFailedError. This exception stores the failing node and preserves the original exception through __cause__:

  • concurrency.py, lines 15-18
  • concurrency.py, lines 67-85

The scheduler collects these exceptions and passes them to console.log_failed_models(errors):

  • scheduler.py, lines 615-620

In the observed output, only the raw driver exception is shown, without a model or snapshot identifier. This suggests either:

  • The error follows a path that bypasses log_failed_models.
  • log_failed_models does not consistently include model context for driver-raised errors.

Suggested Fix

Ensure that every relevant output path, including the CLI, CI output, and log_failed_models in sqlmesh/core/console.py, includes the model or snapshot name from NodeExecutionFailedError.node.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions