plaid/plaid-python

Plaid connection fails after Dockerization of the application

Closed this issue · 1 comments

I have built a flask API project that is consuming the following plaid endpoints inside the sandbox environment

Transactions - /transactions/get
Income - /income/get
Liabilities - /liabilities/get
Assets - /asset_report/get

I am able to access all endpoints when running the application locally but when I run the application inside of a docker container,I get the following error
HTTPSConnectionPool(host='dfc7cb9dc263990c106f4b66c41916%20.plaid.com', port=443): Max retries exceeded with url: /income/get (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f9dadd51438>: Failed to establish a new connection: [Errno -2] Name or service not known',))

This is my connection string to plaid.

import plaid
client = plaid.Client(os.getenv('PLAID_CLIENT_ID'),
                                   os.getenv('PLAID_SECRET'),
                                   os.getenv('PLAID_PUBLIC_KEY'),
                                   os.getenv('PLAID_ENV')
                                   )
income_response = client.Income.get(access_token)

I get the access token after creating an Item.

This is my docker file

FROM python:3.6.8   


ENV PYTHONDONTWRITEBYTECODE 1
ENV FLASK_APP "run.py"
ENV FLASK_ENV "development"
ENV FLASK_DEBUG True

COPY ./requirements.txt /app/requirements.txt

WORKDIR /app

RUN pip install --upgrade pip && \
    pip install pipenv && \
    pip install -r requirements.txt

CMD python3 manage.py db init && python3 manage.py db migrate && python3 manage.py db upgrade

COPY . /app

ADD . /app

EXPOSE 5000

CMD flask run --host=0.0.0.0

hi @Denniskamau this is likely a configuration issue inside of Docker/Flask and not supported by Plaid. If you feel this is in error, please open a support ticket here.