[Bug] Database errors in microbatches are missing "node_info" in structured logs #10840
Labels
bug
Something isn't working
Impact: Exp
incremental
Incremental modeling with dbt
logging
microbatch
Issues related to the microbatch incremental strategy
pre-release
Bug not yet in a stable release
Is this a new bug in dbt-core?
Current Behavior
When using structured JSON logs, database errors in a node do not have
node_info
.Expected Behavior
I expected database error message to have node_info attached to the, like they do for regular models.
Example database error message for a table-materialized model. It contains the `data.node_info` key.
Steps To Reproduce
You can watch me perform these reproduction steps in this Zoom clip.
dbt-snowflake
>= 1.9.0File 1:
models/events/simulated_raw_events.sql
File 2:
models/events/stg_raw_events_inc.sql
(missing a comma, so it will cause a database error)Build the "simulated raw events" table:
dbt build -m simulated_raw_events
(no issues here)Build the incremental model, with JSON logging:
DBT_EXPERIMENTAL_MICROBATCH=True dbt --log-format=json build -m stg_raw_events_inc --log-path=logs/1
Inspect the log file.
a. Note that you can't find the compilation errors when looking at the node-specific logs:
cat ./logs/1/dbt.log | jq 'select(.info.level == "error" and .data.node_info.unique_id != null)'
b. But you can see them when looking at "system logs" (logs not associated with a node):
cat ./logs/1/dbt.log | jq 'select(.info.level == "error" and .data.node_info.unique_id == null)'
I've included the output from "logs/1/dbt.log" from my steps above in the "relevant log output" section.
Relevant log output
No response
Environment
Which database adapter are you using with dbt?
No response
Additional Context
dbt.log
The text was updated successfully, but these errors were encountered: