dbt run --fail-fast gets stuck on CANCEL (snowflake)

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:10  Concurrency: 1 threads (target='dev')
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

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


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.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.