Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I run dbt deps behind a proxy?

Tags:

dbt

I have a reference to a dbt hub package in the packages.yml file in my project:

packages:
  - package: fishtown-analytics/dbt_utils
    version: 0.6.4

When I run dbt deps, this works fine on a machine outside our corporate network but when I run locally I get an error:

Encountered an error:
Unable to connect to registry hub

presumably because dbt isn't using the proxy. I have the HTTP_PROXY and HTTPS_PROXY environment variables set and these work fine for pip install and the like.

Does anyone have any ideas please? I'm running on Windows 7 from inside a git bash prompt (yes I know not ideal, but I have to work with the tools I'm given!)


2 Answers

I ran in to this problem as well. I was able to download the package from the repo and add it as a separate project in a 'libs' folder next to some other projects. Then in the packages.yml add a local reference.

packages:
    - local: '../libs/dbt-utils'
like image 66
TestInProd Avatar answered Dec 16 '25 21:12

TestInProd


I ran into a similar issue. If you have an SSL certificate for your proxy, you can:

  1. Install or upgrade the Python certifi module: pip install certifi or pip install --upgrade certifi

  2. Copy the certificate file to the Python certifi module: cat /<path to certificate>/<certificate file>.pem >> $(python -m certifi)

  3. Update the global pip cert config pip config set global.cert $(python -m certifi)

  4. Rerun dbt deps to install your packages: dbt deps

You can also download your packages manually and add them as local dependencies if that works in your case.

like image 35
Ismail Elouafiq Avatar answered Dec 16 '25 23:12

Ismail Elouafiq



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!