I'm getting the following error when doing a 'dbt run'

000606 (57P03): No active warehouse selected in the current session. Select an active warehouse with the 'use warehouse' command.

My profile has the following entry: role: transform_role schema: dbt threads: 1 type: snowflake user: transform_user warehouse: transform_wh

I have also run the following in snowflake to set the user's default warehouse to transform_wh: alter user transform_user set DEFAULT_WAREHOUSE = 'TRANSFORM_WH';

But I'm still getting the following error when doing 'dbt run':

05:24:41 Database Error in model my_first_dbt_model (models\example\my_first_dbt_model.sql)
05:24:41 000606 (57P03): No active warehouse selected in the current session. Select an active warehouse with the 'use warehouse' command. 05:24:41 05:24:41 compiled SQL at target\run\learn_dbt\models\example\my_first_dbt_model.sql 05:24:41

I have seen similar questions but they don't seem to resolve my issues. I would appreciate any insight and/or help. Thanks.

2

There are 2 answers

1
Josh D. On

It's hard to know without more information, but the most likely cause is that your user's role doesn't have permissions to use the warehouse.

0
Roland On

Try to mitigate the error, you need to create a virtual warehouse using the below command:

CREATE [ OR REPLACE ] WAREHOUSE [ IF NOT EXISTS ] <name>
   [ [ WITH ] objectProperties ]
   [ [ WITH ] TAG ( <tag_name> = '<tag_value>' [ , <tag_name> = '<tag_value>' , ... ] ) ]
   [ objectParams ]

Reference: https://docs.snowflake.com/en/sql-reference/sql/create-warehouse