Skip to content

prefect-dbt hangs indefinitely when dbt models contain docs blocks with lines exceeding 40 characters #20748

@masonmenges

Description

@masonmenges

Description

prefect-dbt >= 0.7.9 hangs indefinitely when executing a dbt build run that includes dbt models with docs blocks whose individual line lengths exceed 40 characters. dbt continues executing in the background (e.g., queries run successfully in the data warehouse), but Prefect never receives completion signals and the flow/tasks remain stuck in a Running state indefinitely.

The hang does not occur with prefect-dbt == 0.7.8, indicating a regression introduced in 0.7.9.

Steps to Reproduce

  1. Create a dbt model that includes a docs block with at least one line longer than 40 characters, e.g.:
    -- models/my_model.sql
    {% docs my_model %}
    This is a description that exceeds forty characters in length.
    {% enddocs %}
  2. Run a dbt build via prefect-dbt >= 0.7.9
  3. Observe that Prefect hangs indefinitely at the affected model(s)

Expected Behavior

The flow and tasks complete normally, reflecting dbt's actual execution state.

Actual Behavior

Prefect hangs indefinitely. dbt continues running in the background but Prefect never receives or processes the completion event. The flow must be manually cancelled.

Workarounds

  • Downgrade to prefect-dbt == 0.7.8
  • Remove or shorten lines in dbt docs blocks to stay under 40 lines (2500 Characters)

Version Information

  • prefect-dbt: >= 0.7.9 (regression; 0.7.8 is unaffected)
  • Prefect: 3.x

Additional Context

This appears to be related to how prefect-dbt >= 0.7.9 reads or parses dbt artifact/node metadata. The 40-character line threshold suggests a possible buffer or parsing limit introduced in that version.

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