dbt-core Python model issue - SSL certificates

The problem I’m having

I’m unable to use Python models with dbt-core. I run into a a SSL certificate verify failure when communicating with my Databricks instance. SQL models work fine.

What I’ve already tried

  • Creating simple Python models (doesn’t work)
  • Creating SQL models (does work)
  • Disabling ssl_verify on my conda configuration file

Some example code or error messages

HTTPSConnectionPool(host=‘<databricks_domain>’, port=443): Max retries exceeded with url: /api/1.2/contexts/create (Caused by SSLError(SSLCertVerificationError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1129)’)))

This is interesting @jeremym9! I don’t think dbt debug has been updated to validate Python connectivity, but maybe it needs to…

Does this article from the databricks site help? How to import a custom CA certificate - Databricks

So I had to import CA certificates onto my machine, then reference them in my pip.ini file - this allowed me to install python-certifi-win32 which removed the SSL error from my python models.

While this isn’t necessarily a dbt issue, it is interesting that SQL models do not encounter this issue (maybe they are using a different API?) I do think dbt debug needs to be updated to reflect this kind of issue.

1 Like

Glad you worked it out! I’ve created SSL certificate verification errors when trying to run Python models · Issue #305 · databricks/dbt-databricks · GitHub on the Databricks repo which will hopefully get an improvement to this.

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