I am facing the below error while executing Sql se...
# ask-community
m
I am facing the below error while executing Sql server connection : sqlalchemy.exc.DBAPIError: (pyodbc.Error) ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib 'SQL Server Native Client 11.0' : file not found (0) (SQLDriverConnect)") (Background on this error at: https://sqlalche.me/e/14/dbapi) Below is my Docker code for USERCODE Deployment FROM docker-images.artifactory.danskenet.net/db/python:3.7-slim-buster ARG DAGSTER_VERSION=0.15.5 ARG DAGSTER_UID=50000 ARG DAGSTER_HOME=/opt/dagster/dagster_home # Install curl and gnupg2 RUN apt-get update \ && apt-get install -y --no-install-recommends \ curl \ gnupg2 \ build-essential \ unixodbc-dev \ && apt-get -y install unixodbc unixodbc-dev \ && apt-get autoremove -yqq --purge \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* RUN curl https://artifactory.danskenet.net/artifactory/remote-debian-microsoft/keys/microsoft.asc | apt-key add - RUN apt-get -yqq purge curl RUN echo 'deb [arch=amd64] https://artifactory.danskenet.net/artifactory/remote-debian-microsoft/debian/10/prod buster main' > /etc/apt/sources.list.d/mssql-release.list RUN apt-get update -yqq RUN apt-get upgrade -yqq RUN ACCEPT_EULA=Y apt-get -yqq install -y --no-install-recommends msodbcsql17 mssql-tools unixodbc-dev RUN rm -rf /var/lib/apt/lists/* RUN apt-get autoremove -yqq --purge RUN apt-get clean && rm -rf /var/lib/apt/lists/* ENV PATH=${PATH}:/opt/mssql-tools/bin RUN pip install --upgrade pip \ dagster==${DAGSTER_VERSION} \ dagster-postgres==${DAGSTER_VERSION} \ dagster-aws==${DAGSTER_VERSION} \ dagster-k8s==${DAGSTER_VERSION} \ dagster-celery[flower,redis,kubernetes]==${DAGSTER_VERSION} \ dagster-celery-k8s==${DAGSTER_VERSION} \ dagster_pandas \ dagster_pandera \ importlib-metadata\<5.0 \ sqlalchemy\<2.0.0 \ pandas \ pandera \ pyodbc # Get example pipelines COPY examples/deploy_k8s/mydagster /mydagster RUN adduser --gecos "First Last,RoomNumber,WorkPhone,HomePhone" --disabled-password \ --quiet "dagster" --uid "${DAGSTER_UID}" --gid "0" --home "${DAGSTER_HOME}" \ # Make Airflow files belong to the root group and are accessible. This is to accommodate the guidelines from # OpenShift https://docs.openshift.com/enterprise/3.0/creating_images/guidelines.html && mkdir -pv "${DAGSTER_HOME}" \ && chown -R dagster:0 "${DAGSTER_HOME}" \ && chmod -R g+rw "${DAGSTER_HOME}" \ && find "${DAGSTER_HOME}" -executable -print0 | xargs --null chmod g+x \ && mkdir -pv "${DAGSTER_HOME}/storage" \ && chown -R dagster:0 "${DAGSTER_HOME}/storage" \ && chmod -R g+rw "${DAGSTER_HOME}/storage" RUN chmod g=u /etc/passwd \ && usermod -g 0 dagster -G 0 # Lower the TLS to 1 as CIL seems to be running 1. RUN sed -i 's/TLSv1.2/TLSv1/g' /etc/ssl/openssl.cnf && \ sed -i 's/SECLEVEL=2/SECLEVEL=1/g' /etc/ssl/openssl.cnf USER ${DAGSTER_UID}
d
Hi Mohan - this looks like a sqlalchemy error related to your specific choice of database so it may be tricky for us to provide in-depth support on the dagster side. I do see some advice for how to deal with this error here but I can't vouch for its accuracy myself: https://stackoverflow.com/questions/38534154/linux-python3-cant-open-lib-sql-server
If there are specific configuration options that we need to provide on the dagster side to make it possible to connect to sql server than we can absolutely provide them - this looks like there may be a missing sql server library of some sort in your container though
m
Hi Daniel, Finally I am able to connect SQL server using Pyodbc and SQLalchemy.
Now we have received the below error:
Operation name: AssetGraphLiveQuery Message: Attempted to deserialize class "EventLogRecord" which is not in the whitelist. This error can occur due to version skew, verify processes are running expected versions. Descent path: <root:dict> Path: ["assetNodes",0,"assetMaterializations"] Locations: [{"line":35,"column":3}]
got the message like this: You hit an unexpected error while fetching data from Dagster. If you have a minute, consider reporting this error either by filing a Github issue or by messaging in the Dagster slack. Use the "Copy" button below to include error information that is helpful for the core development team to diagnose what is happening and to improve Dagster in recovering from unexpected errors.
Please let me know to fix this
d
Would you mind making a new post for the new problem? That will ensure that our support team sees it
m
Sure .. Thanks Daniel
I made new post