## TL;DR

A silent hang is either a warehouse query that never returns or a Jinja macro stuck in a loop. Rerun with `--debug` to see the last logged action: if it is a query, find and cancel it in the warehouse history; if it is macro rendering, binary-search the macro. Then fix the root cause and rerun.

## Error

```text
dbt run hangs on model compile with no error output
```

## Steps

1. Kill the hung run and rerun with `dbt run --debug --select [MODEL NAME]`, watching the last log line before it stalls. Expected: the last line names a query execution or a macro render.
2. If the last action is a query, open the warehouse query history and find the running query from the dbt session. Expected: you see the stuck query and its runtime.
3. Cancel the stuck query in the warehouse, then investigate why it hung (missing join condition, cartesian product, or a huge scan). Expected: you find the query defect.
4. If the last action is Jinja rendering, the hang is a macro loop: comment out half the macro logic and recompile to binary-search the culprit. Expected: you isolate the looping section.
5. Fix the query or macro, then rerun normally. Expected: the run completes.

## When to use

- `dbt run` hangs indefinitely with no error output.
- The hang is reproducible on the same model.

## When not to use

- The run fails with an error message (follow that error instead).
- The whole machine is unresponsive (a resource problem, not a dbt problem).

## Tool compatibility

- dbt Core 1.0 and later, all adapters. `--debug` logging is adapter-independent.

## Variant phrasings

### dbt compile hangs with no output

Same diagnosis without the run phase; the hang is in Jinja rendering.

### dbt run stalls on one model while others finish

The hang is model-specific; select just that model to reproduce faster.

## Why it happens

dbt logs each step as it goes, so a hang with no new output means the current step never finishes. Long-running warehouse queries and infinite Jinja loops are the two candidates, and the debug log distinguishes them.

## Edge cases

- A missing join condition creates a cartesian product that runs for hours; the query history shows explosive row counts.
- Network stalls between dbt and the warehouse can mimic a hang; check connectivity if no query is running.
- Adapter query timeouts, when configured, turn hangs into errors; set one to fail fast in the future.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_j8YrRprgPcOftJziyopc_w
