Random but might save someone else time - our dock...
# troubleshooting
j
Random but might save someone else time - our docker container updated yesterday and meltano stopped working for snowflake. We think this is related because openssl version bumped past 3.0.9. https://community.snowflake.com/s/article/Python-Connector-fails-to-connect-with-LibraryNotFoundError-Error-detecting-the-version-of-libcrypto
Has anyone come up with a better solution than this? after a meltano install I hop into the loader venv and force update the oscrypto package
Copy code
# The oscrypto package does not support OpenSSL versions with two digits
# And the maintainer refuses (Oct 2023) to rev pypl.

echo "patching snowflake_connector for target-snowflake"

SCRIPT=$(realpath "$0")
SCRIPTPATH=$(dirname "$SCRIPT")
echo $SCRIPTPATH

cd "$SCRIPTPATH/.meltano/loaders/target-snowflake/venv/bin"
echo "...activating target-snowflake venv"

source "$SCRIPTPATH/.meltano/loaders/target-snowflake/venv/bin/activate"

echo "...pip installing custom patch"

./pip install --force-reinstall git+<https://github.com/wbond/oscrypto.git@1547f535001ba568b239b8797465536759c742a3>
deactivate
👍 1
m
In case someone will need a Dockerfile with this fix
Copy code
# <http://registry.gitlab.com/meltano/meltano:latest|registry.gitlab.com/meltano/meltano:latest> is also available in GitLab Registry
ARG MELTANO_IMAGE=meltano/meltano:latest
FROM $MELTANO_IMAGE

WORKDIR /artera

# Install any additional requirements
COPY ./requirements.txt .
RUN pip install -r requirements.txt
# Copy over Meltano project directory
COPY . .
RUN meltano install

#####################
##########FIX: oscrypto.errors.LibraryNotFoundError: Error detecting the version of libcrypto
########## related to Snowflake Connector
# We need a newer version of oscrypto than the one released to get a fix for a bug
# that gets triggered when having double digits on the OpenSSL version
# (<https://github.com/wbond/oscrypto/issues/75>).
# We can remove the oscrypto pinning once the fix becomes part of a new release.
ENV PATH="/artera/.meltano/loaders/target-snowflake/venv/bin:$PATH"
RUN pip install --force-reinstall git+<https://github.com/wbond/oscrypto.git@1547f535001ba568b239b8797465536759c742a3>

# Don't allow changes to containerized project files
#ENV MELTANO_PROJECT_READONLY 1

ENTRYPOINT ["/bin/bash"]