The problem I’m having
I’m using dbt-core==1.4.1 and dbt-snowflake==1.4.1
I’m running with dbt run --fail-fast
dbt run -x
13:26:08 Running with dbt=1.4.1
13:26:08 Found 2 models, 0 tests, 0 snapshots, 0 analyses, 304 macros, 0 operations, 0 seed files, 2 sources, 0 exposures, 0 metrics
13:26:08
13:26:10 Concurrency: 1 threads (target='dev')
13:26:10
13:26:10 1 of 2 START sql table model xxx.model1 [RUN]
13:26:11 1 of 2 ERROR creating sql table model xxx.model1 [ERROR in 0.80s]
13:26:11 2 of 2 START sql table model xxx.model2 ... [RUN]
13:26:11 CANCEL query model.myproject.model1 ......... [CANCEL]
step 1 fails (the model container a syntax error Snowflake adapter: Snowflake error: 001003 (42000): SQL compilation error: syntax error line 40
) ,
then it starts step 2 (model2) , which surprises me because I though that the --fail-fast meant that it won’t continue at all.
Then it gets stuck on CANCEL (or maybe it’s waiting for the model2 to complete, hard to tell)
Is there any way to make it fail fast for real? not starting model2 at all?
I waited and it’s not stuck forever. Instead of failing fast it just waits for the other model to complete
I reported it as as bug
opened 01:59PM - 03 Mar 23 UTC
bug
triage
### Is this a new bug in dbt-core?
- [X] I believe this is a new bug in dbt-cor… e
- [X] I have searched the existing issues, and I could not find an existing issue for this bug
### Current Behavior
When running with `dbt run -x ` or `dbt run --fail-fast` , if one of the models fails to build, it won't cancel the second one
With dbt==1.4.1 dbt-snowflake==1.4.1
It starts `model2` and then `CANCEL model1` (the one that already failed / ERRORed), then waits for completion of `model2`. I think it was supposed to cancel `model2` not wait for it to complete.
### Expected Behavior
From the documentation at https://docs.getdbt.com/reference/global-configs#failing-fast I would expected to
START model1
ERROR model1
START model2
CANCEL model2
ERROR model2
but in my case it does
START model1
ERROR model1
START model2
CANCEL **model1**
OK model2
I think it was supposed to CANCEL model2 since model1 failed. But no, it waits for completion of model2.
### Steps To Reproduce
1. create a new project
2. add 2 models that take 5 minutes to complete each
3. introduce a SQL syntax error in the one that executes first
4. run with `dbt run -x`
5. dbt should exit quickly since the syntax error, it detected quickly. but it instead waits for the second one to complete (which defeats the purpose of --fail-fast)
### Relevant log output
```shell
dbt run -x
13:26:08 Running with dbt=1.4.1
13:26:08 Found 2 models, 0 tests, 0 snapshots, 0 analyses, 304 macros, 0 operations, 0 seed files, 2 sources, 0 exposures, 0 metrics
13:26:08
13:26:10 Concurrency: 1 threads (target='dev')
13:26:10
13:26:10 1 of 2 START sql table model xxx.model1 [RUN]
13:26:11 1 of 2 ERROR creating sql table model xxx.model1 [ERROR in 0.80s]
13:26:11 2 of 2 START sql table model xxx.model2 ... [RUN]
13:26:11 CANCEL query model.myproject.model1 ......... [CANCEL]
```
```
### Environment
```markdown
- OS: macOS Monterey
- Python: 3.10.10
- dbt: 1.4.1
```
### Which database adapter are you using with dbt?
snowflake
### Additional Context
_No response_
Well, I realized that --fail-fast
is a global options so dbt run --fail-fast
is incorrect. The actual right syntax is
dbt --fail-fast run
or
dbt -x run
but still it’s remarkable that dbt run --fail-fast
does not produce any error. It should have errored with dbt: error: unrecognized arguments: --fail-fast
if it’s not supported there.
1 Like
@ecerulm Wow, I never noticed that!
Although the docs show the correct usage, I thought that it was dbt run --fail-fast
, it was automatic to think about the flags after run
.
Thanks for pointing that out.
system
Closed
March 11, 2023, 9:57pm
5
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.