6

I'm trying to connect to snowflake via dbt but connections fail with the error below:

Using profiles.yml file at /home/myname/.dbt/profiles.yml
Using dbt_project.yml file at /mnt/c/Users/Public/learn_dbt/rks-learn-dbt/learn_dbt/dbt_project.yml
Configuration:
  profiles.yml file [ERROR invalid]
  dbt_project.yml file [OK found and valid]
Profile loading failed for the following reason:
Runtime Error
  Could not find profile named 'learn_dbt'
Required dependencies:
 - git [OK found] 

Any advice please.

Note: I am learning to setup dbt connections looking at udemy videos.

Below is my profiles.yml file:

learn_dbt:
  target: dev
  outputs:
    dev:
      type: snowflake
      account: XXXXXX
      user: XXXX                
      password: XXXX                     
      role: transform_role
      database: analytics
      warehouse: transform_wh
      schema: dbt
      threads: 1
      client_session_keep_alive: False
Ravi
  • 203
  • 1
  • 3
  • 6

4 Answers4

7

My first guess is that you have a profiles.yml file in your dbt project folder and dbt is not actually using the one in /home/myname/.dbt/.

Could you try running the following?

dbt debug --profiles-dir /home/myname/.dbt

The flag --profiles-dir works on most dbt cli commands and lets you use a custom profiles.yml that's outside your project. I use this flag all the time.

Stephan
  • 451
  • 4
  • 5
  • Thanks for response Stephen . But still there is no luck , i tried .dbt folder copied into ~./learn_dbt folder . Now getting this error "250003: Failed to get the response. Hanging? method: post, url: https://se15650.us-east-2 . When i tried to search in our stack over flow about this error, there was a response in this link https://stackoverflow.com/questions/59471242/operationalerror-250003-failed-to-get-the-response-hanging-method-post , but the response in this link i tried but that still didn't help. Any other thoughts. – Ravi Jul 04 '20 at 13:00
  • I think figured out the issue i,e it was account_id which should be in the format of 'xe12345.us.-east-1.aws' (which should be in single quotes) – Ravi Jul 05 '20 at 13:34
5

I had to run pip install dbt-snowflake and then it worked.

It seems dbt has seperated it's modules to dbt-core and it's adapters dbt-snowflake, dbt-postgres etc

superjisan
  • 1,604
  • 14
  • 15
2

I think this is a similar issue to what i had when using the cloud environment.

If you are using a snowflake instance on the West coast the the account name looks like

If you are using a snowflake instance on the East coast the the account name looks like <xxx12345.us-east-1>

luther
  • 254
  • 1
  • 7
0

Overall this error mean it is unable to connect to yead your environment template to get your snowflake account details.

'env.pd.template.bat' or 'env.pd.template.sh' is the base file which has your Snowfalke account settings, so you have run this command to connect to snowflake from your editor.

You can use '.bat', or .sh commands based on Powershell or CMD editor.

In my scenario I ran 'env.pd..private.bat', you need to run this command everytime to connect to snowflake account with your credentials. I ran this in cmd window. It fixed my error.

Akbar
  • 51
  • 2