microsoft/msphpsql

Issue connecting to SQL server from Openshift

zkhan21 opened this issue · 2 comments

FROM python:3.9
RUN apt-get update && apt-get install -y --no-install-recommends \
    gnupg \
    unixodbc \
    unixodbc-dev \
    && curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \
    && curl https://packages.microsoft.com/config/debian/10/prod.list > /etc/apt/sources.list.d/mssql-release.list \
    && apt-get update \
    && ACCEPT_EULA=Y apt-get install -y msodbcsql17 \
    && apt-get clean && rm -rf /var/lib/apt/lists/*

WORKDIR /app
COPY . /app
RUN pip install --no-cache-dir -r requirements.txt

EXPOSE 8080
CMD ["python", "app.py"]

I am getting an error in the logs saying login timeout when connecting to the SQL server "return pyodbc.connect(
pyodbc.OperationalError: ('HYT00', '[HYT00] [Microsoft][ODBC Driver 17 for SQL Server]Login timeout expired (0) (SQLDriverConnect)')"

I have ODBC 17 specified in my other file too and when I run my project locally there are no issues and it is able to connect.

I am testing it out on Redhat developer Openshift sandbox

Hi @zkhan21, seems the login info somehow not accepted and login process failed. Can you share your connection string or connection info with the sensitives information masked off? So we have a bit more information to investigate with. Also, you mentioned that you work from a OpenShift sandbox. I am not too familiarize with it, but is there a OS or platform this sandbox is operating based on? Or this is not the case a OpenShift sandbox?

Closed due to inactivity