## Driver version or file name
pdo_sqlsrv 5.2.0, msodbcsql17
## SQL Server version
docker mssql image: microsoft/mssql-server-linux:2017-latest
## Client operating system
Php docker image running debian, host machine both UBUNTU and OS X.
PHP 7.2-fpm on debian using the docker image
MSODBCSQL 17.1.0.1 :
/opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.1.so.0.1
Previously I was using the preview driver (pdo_)sqlsrv5.2.0RC together with the preview ODBC17.0.5 drivers from this repo to connect to mssql. My php docker file looked like this:
FROM php:7.2-fpm
ARG TIMEZONE
RUN apt-get update && apt-get install -y freetds-bin freetds-dev freetds-common libct4 libsybdb5 libicu-dev libcurl3-dev git zlib1g-dev apt-transport-https gnupg wget
# Install mssql drivers
RUN apt-get install -y unixodbc-dev
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
RUN curl https://packages.microsoft.com/config/debian/8/prod.list > /etc/apt/sources.list.d/mssql-release.list
RUN apt-get update
RUN ACCEPT_EULA=Y apt-get install -y msodbcsql
RUN yes | apt-get purge -y msodbcsql
RUN wget https://github.com/Microsoft/msphpsql/raw/dev/ODBC%2017%20binaries%20preview/Debian%209/msodbcsql_17.0.0.5-1_amd64.deb
RUN wget https://github.com/Microsoft/msphpsql/raw/dev/ODBC%2017%20binaries%20preview/Debian%209//mssql-tools_17.0.0.5-1_amd64.deb
RUN ACCEPT_EULA=Y dpkg -i msodbcsql_17.0.0.5-1_amd64.deb
RUN ACCEPT_EULA=Y dpkg -i mssql-tools_17.0.0.5-1_amd64.deb
RUN ln -fsv /opt/mssql-tools/bin/* /usr/bin
RUN pecl install sqlsrv
RUN pecl install pdo_sqlsrv-5.2.0RC1
RUN docker-php-ext-enable sqlsrv pdo_sqlsrv
And i was able to connect to mssql from php. However since recently the preview binaries have been removed from this repository and the pdo_sqlsrv version seem to have been updated to a stable version. I decided to upgrade to (pdo)_sqlsrv 5.2 and msodbc 17.1.0.1 by changing my dockerfile to:
FROM php:7.2-fpm
ARG TIMEZONE
RUN apt-get update && apt-get install -y freetds-bin freetds-dev freetds-common libct4 libsybdb5 libicu-dev libcurl3-dev git zlib1g-dev apt-transport-https gnupg wget
# Install mssql drivers
RUN apt-get install -y unixodbc-dev
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
RUN curl https://packages.microsoft.com/config/debian/9/prod.list > /etc/apt/sources.list.d/mssql-release.list
RUN apt-get update
RUN apt-get upgrade
RUN export DEBIAN_FRONTEND=noninteractive && ACCEPT_EULA=Y apt-get install -y msodbcsql17 mssql-tools
RUN ln -fsv /opt/mssql-tools/bin/* /usr/bin
RUN pecl install sqlsrv
RUN pecl install pdo_sqlsrv-5.2.0
RUN docker-php-ext-enable sqlsrv pdo_sqlsrv
After rebuilding the docker image I get the php exception message:
Can't open lib '/opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.1.so.0.1' : file not found
The file however seems to exist (if i run ls /opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.1.so.0.1 it returns the file name). Some how (pdo_) sqsrv 5.2.0 seems to not work with the msodbc sql 17.1.0.1 drivers? Any ideas how to fix this?
Thanks a lot.
hi @svoss , please check this official guide, in which it says near the beginning that If you installed the v17 msodbcsql package that was briefly available, you should remove it before installing the msodbcsql17 package. This will avoid conflicts. The msodbcsql17 package can be installed side by side with the msodbcsql v13 package.
Please let us know if this helps.
My apology, @svoss . I realized you're using docker. Due to security reasons we have changed to immediate binding, which affects how pdo_sqlsrv is loaded. Also, please note that when installing the latest stable versions of our drivers from PECL, you don't need to specify the version number. Therefore, you can simply do the following:
sudo pecl install sqlsrv
sudo pecl install pdo_sqlsrv
For details, please check our documentation for Debian
@yitam I'm trying to get the latest 17.1 ODBC drivers installed in a docker container and getting the same error message. I followed instructions here https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server.
Any ideas on how to fix? I'm using the following dockerfile
<ommitted for brevity but it's a Debian 9 based container image>
...
...
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && curl https://packages.microsoft.com/config/debian/9/prod.list > /etc/apt/sources.list.d/mssql-release.list
RUN apt-get install -y apt-transport-https unixodbc-dev g++
RUN pip install pyodbc
RUN apt-get update
RUN ACCEPT_EULA=Y apt-get install -y msodbcsql17
hi @singhkays please run an strace, "file not found" can also appear if a dependent library was not found.
@yitam I ran a strace but it's about 1200 lines long. Is there something specific you're looking for?
Yes @singhkays please look for "file not found" or something along this line.
@yitam Sure, here are all the references to "No such file or directory"
I've tried installing libssl1.0.0 that was suggested in another Github issue (https://github.com/Microsoft/msphpsql/issues/484#issuecomment-353127936) but it hasn't helped
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/local/bin/pyvenv.cfg", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/local/pyvenv.cfg", O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/usr/local/bin/Modules/Setup", 0x7ffe46a749d0) = -1 ENOENT (No such file or directory)
stat("/usr/local/bin/lib/python3.6/os.py", 0x7ffe46a6a880) = -1 ENOENT (No such file or directory)
stat("/usr/local/bin/lib/python3.6/os.pyc", 0x7ffe46a6a880) = -1 ENOENT (No such file or directory)
stat("/usr/local/bin/pybuilddir.txt", 0x7ffe46a749d0) = -1 ENOENT (No such file or directory)
stat("/usr/local/bin/lib/python3.6/lib-dynload", 0x7ffe46a749d0) = -1 ENOENT (No such file or directory)
stat("/usr/local/lib/python36.zip", 0x7ffe46a7b5a0) = -1 ENOENT (No such file or directory)
stat("/usr/local/lib/python36.zip", 0x7ffe46a7add0) = -1 ENOENT (No such file or directory)
stat("/usr/local/lib/python3.6/encodings/__init__.cpython-36m-x86_64-linux-gnu.so", 0x7ffe46a7b170) = -1 ENOENT (No such file or directory)
stat("/usr/local/lib/python3.6/encodings/__init__.abi3.so", 0x7ffe46a7b170) = -1 ENOENT (No such file or directory)
stat("/usr/local/lib/python3.6/encodings/__init__.so", 0x7ffe46a7b170) = -1 ENOENT (No such file or directory)
stat("/usr/local/bin/pyvenv.cfg", 0x7ffe46a7b090) = -1 ENOENT (No such file or directory)
stat("/usr/local/pyvenv.cfg", 0x7ffe46a7b090) = -1 ENOENT (No such file or directory)
stat("/usr/local/bin/Modules/Setup.dist", 0x7ffe46a79c10) = -1 ENOENT (No such file or directory)
stat("/usr/local/bin/Modules/Setup.local", 0x7ffe46a79c10) = -1 ENOENT (No such file or directory)
stat("/root/.local/lib/python3.6/site-packages", 0x7ffe46a7b310) = -1 ENOENT (No such file or directory)
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
stat("/usr/local/lib/python3.6/collections/__init__.cpython-36m-x86_64-linux-gnu.so", 0x7ffe46a754f0) = -1 ENOENT (No such file or directory)
stat("/usr/local/lib/python3.6/collections/__init__.abi3.so", 0x7ffe46a754f0) = -1 ENOENT (No such file or directory)
stat("/usr/local/lib/python3.6/collections/__init__.so", 0x7ffe46a754f0) = -1 ENOENT (No such file or directory)
open("/root/.odbcinst.ini", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/root/.odbcinst.ini", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/root/.odbcinst.ini", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/root/.odbcinst.ini", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/root/.odbcinst.ini", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/root/.odbcinst.ini", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/root/.odbcinst.ini", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/root/.odbcinst.ini", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/root/.odbcinst.ini", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/root/.odbcinst.ini", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/root/.odbcinst.ini", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/root/.odbcinst.ini", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/root/.odbcinst.ini", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/root/.odbcinst.ini", O_RDONLY) = -1 ENOENT (No such file or directory)
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/tls/x86_64/libcrypto.so.1.0.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/lib/x86_64-linux-gnu/tls/x86_64", 0x7ffe46a78ad0) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/tls/libcrypto.so.1.0.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/lib/x86_64-linux-gnu/tls", 0x7ffe46a78ad0) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/x86_64/libcrypto.so.1.0.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/lib/x86_64-linux-gnu/x86_64", 0x7ffe46a78ad0) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libcrypto.so.1.0.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/x86_64-linux-gnu/tls/x86_64/libcrypto.so.1.0.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib/x86_64-linux-gnu/tls/x86_64", 0x7ffe46a78ad0) = -1 ENOENT (No such file or directory)
open("/usr/lib/x86_64-linux-gnu/tls/libcrypto.so.1.0.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib/x86_64-linux-gnu/tls", 0x7ffe46a78ad0) = -1 ENOENT (No such file or directory)
open("/usr/lib/x86_64-linux-gnu/x86_64/libcrypto.so.1.0.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib/x86_64-linux-gnu/x86_64", 0x7ffe46a78ad0) = -1 ENOENT (No such file or directory)
open("/usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/lib/tls/x86_64/libcrypto.so.1.0.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/lib/tls/x86_64", 0x7ffe46a78ad0) = -1 ENOENT (No such file or directory)
open("/lib/tls/libcrypto.so.1.0.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/lib/tls", 0x7ffe46a78ad0) = -1 ENOENT (No such file or directory)
open("/lib/x86_64/libcrypto.so.1.0.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/lib/x86_64", 0x7ffe46a78ad0) = -1 ENOENT (No such file or directory)
open("/lib/libcrypto.so.1.0.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/tls/x86_64/libcrypto.so.1.0.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib/tls/x86_64", 0x7ffe46a78ad0) = -1 ENOENT (No such file or directory)
open("/usr/lib/tls/libcrypto.so.1.0.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib/tls", 0x7ffe46a78ad0) = -1 ENOENT (No such file or directory)
open("/usr/lib/x86_64/libcrypto.so.1.0.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib/x86_64", 0x7ffe46a78ad0) = -1 ENOENT (No such file or directory)
open("/usr/lib/libcrypto.so.1.0.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/root/.odbcinst.ini", O_RDONLY) = -1 ENOENT (No such file or directory)
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libcrypto.so.1.0.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/lib/libcrypto.so.1.0.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/libcrypto.so.1.0.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
@singhkays I'm not sure why this is happening, but looks like you installed pyodbc before the odbc driver...
Can you try installing only the odbc driver?
If it works, try installing pyodbc
@yitam Tried that but still failing
root@2df588322ea8:/usr/workspace# pip install pyodbc
Collecting pyodbc
Downloading pyodbc-4.0.23.tar.gz (215kB)
100% |ββββββββββββββββββββββββββββββββ| 225kB 4.2MB/s
Building wheels for collected packages: pyodbc
Running setup.py bdist_wheel for pyodbc ... done
Stored in directory: /root/.cache/pip/wheels/e3/56/cc/eb01e0620f693653f03336c0ab130c7be24cf90403d06cfae9
Successfully built pyodbc
Installing collected packages: pyodbc
Successfully installed pyodbc-4.0.23
You are using pip version 9.0.1, however version 9.0.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
root@2df588322ea8:/usr/workspace# python sql.py
Traceback (most recent call last):
File "sql.py", line 5, in <module>
cnxn = pyodbc.connect('Driver={ODBC Driver 17 for SQL Server};Server=<address>;Database=tesdb;Uid=<user>;Pwd=<pass>;Encrypt=yes;TrustServerCertificate=no;Connection Timeout=30;')
pyodbc.Error: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib '/opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.1.so.0.1' : file not found (0) (SQLDriverConnect)")
root@2df588322ea8:/usr/workspace#
After you've installed odbc driver, do the following please:
odbcinst -j
odbcinst -q -d -n "ODBC Driver 17 for SQL Server"
@yitam Sure, here you go
root@08a9000eb665:/usr/workspace# odbcinst -q -d -n "ODBC Driver 17 for SQL Server"
[ODBC Driver 17 for SQL Server]
Description=Microsoft ODBC Driver 17 for SQL Server
Driver=/opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.1.so.0.1
UsageCount=1
ldd /opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.1.so.0.1
Look for any "not found"s.
@v-chojas I don't see any "not found"s
Could you attach the full strace for examination?
@v-chojas Sure, attached
strace.txt
open("/usr/lib/libcrypto.so.1.0.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
It appears you do not have OpenSSL (at least 1.0.2) installed.
@v-chojas Thanks for taking a deeper look, that was it! _... in a roundabout way...._ I started looking into why that package was not available for my container image and it turns out the container image is based on Debian 8 instead of 9 as I had initially thought. I updated the Dockerfile with Debian 8 install instructions and it works now!
Closing this issue due to inactivity. Please feel free to reopen should you have any question.
If anyone else hit the same issue as me (which is the opposite problem as @singhkays had) it looks like the official PHP Docker image for 7.1 updated from jessie to stretch last week, which broke our build since the binaries from the Debian 8 repo target different versions of libssl/libcrypto
Thanks for the info @stevedesmond-ca
If you require any assistance, please feel free to create a new issue and reference this one, if you like.
I'm seeing the same issue as @stevedesmond-ca, using PHP7.2 official images and getting the "file not found" for libssl and libcrypto when running
ldd /opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.1.so.0.1
linux-vdso.so.1 (0x00007ffc903a4000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f310f2e9000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f310f0e1000)
libodbcinst.so.2 => /usr/lib/x86_64-linux-gnu/libodbcinst.so.2 (0x00007f310eecc000)
libcrypto.so.1.0.0 => not found
libkrb5.so.3 => /usr/lib/x86_64-linux-gnu/libkrb5.so.3 (0x00007f310ebf2000)
libgssapi_krb5.so.2 => /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2 (0x00007f310e9a7000)
libcurl.so.4 => /usr/lib/x86_64-linux-gnu/libcurl.so.4 (0x00007f310e727000)
libssl.so.1.0.0 => not found
libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007f310e522000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f310e1a0000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f310de9c000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f310dc85000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f310da68000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f310d6c9000)
/lib64/ld-linux-x86-64.so.2 (0x00007f310f901000)
libltdl.so.7 => /usr/lib/x86_64-linux-gnu/libltdl.so.7 (0x00007f310d4bf000)
libk5crypto.so.3 => /usr/lib/x86_64-linux-gnu/libk5crypto.so.3 (0x00007f310d28c000)
libcom_err.so.2 => /lib/x86_64-linux-gnu/libcom_err.so.2 (0x00007f310d088000)
libkrb5support.so.0 => /usr/lib/x86_64-linux-gnu/libkrb5support.so.0 (0x00007f310ce7c000)
libkeyutils.so.1 => /lib/x86_64-linux-gnu/libkeyutils.so.1 (0x00007f310cc78000)
libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f310ca61000)
libnghttp2.so.14 => /usr/lib/x86_64-linux-gnu/libnghttp2.so.14 (0x00007f310c83b000)
libidn2.so.0 => /usr/lib/x86_64-linux-gnu/libidn2.so.0 (0x00007f310c619000)
librtmp.so.1 => /usr/lib/x86_64-linux-gnu/librtmp.so.1 (0x00007f310c3fc000)
libssh2.so.1 => /usr/lib/x86_64-linux-gnu/libssh2.so.1 (0x00007f310c1d0000)
libpsl.so.5 => /usr/lib/x86_64-linux-gnu/libpsl.so.5 (0x00007f310bfc2000)
libssl.so.1.0.2 => /usr/lib/x86_64-linux-gnu/libssl.so.1.0.2 (0x00007f310bd59000)
libcrypto.so.1.0.2 => /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.2 (0x00007f310b8f5000)
liblber-2.4.so.2 => /usr/lib/x86_64-linux-gnu/liblber-2.4.so.2 (0x00007f310b6e6000)
libldap_r-2.4.so.2 => /usr/lib/x86_64-linux-gnu/libldap_r-2.4.so.2 (0x00007f310b495000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f310b27b000)
libunistring.so.0 => /usr/lib/x86_64-linux-gnu/libunistring.so.0 (0x00007f310af64000)
libgnutls.so.30 => /usr/lib/x86_64-linux-gnu/libgnutls.so.30 (0x00007f310abcb000)
libhogweed.so.4 => /usr/lib/x86_64-linux-gnu/libhogweed.so.4 (0x00007f310a996000)
libnettle.so.6 => /usr/lib/x86_64-linux-gnu/libnettle.so.6 (0x00007f310a75f000)
libgmp.so.10 => /usr/lib/x86_64-linux-gnu/libgmp.so.10 (0x00007f310a4dc000)
libgcrypt.so.20 => /lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007f310a1cc000)
libsasl2.so.2 => /usr/lib/x86_64-linux-gnu/libsasl2.so.2 (0x00007f3109fb1000)
libp11-kit.so.0 => /usr/lib/x86_64-linux-gnu/libp11-kit.so.0 (0x00007f3109d4c000)
libidn.so.11 => /lib/x86_64-linux-gnu/libidn.so.11 (0x00007f3109b18000)
libtasn1.so.6 => /usr/lib/x86_64-linux-gnu/libtasn1.so.6 (0x00007f3109905000)
libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007f31096f1000)
libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007f31094e8000)
Relevant "not found" outputs
libcrypto.so.1.0.0 => not found
libssl.so.1.0.0 => not found
I realized the problem - in my dockerfile I was still using the debian 8 repo (for jessie) and needed to update it to use the debian 9 (stretch) repo.
Now it's working properly! Here is that section from my dockerfile
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
RUN curl https://packages.microsoft.com/config/debian/9/prod.list > /etc/apt/sources.list.d/mssql-release.list
RUN apt-get update -yqq \
&& ACCEPT_EULA=Y apt-get install -y msodbcsql17 unixodbc-dev unixodbc \
&& rm -r /var/lib/apt/lists/*
RUN pecl install sqlsrv pdo_sqlsrv
RUN /usr/local/bin/docker-php-ext-enable sqlsrv pdo_sqlsrv
I leave this here. It detects the Debian version:
RUN DEBIAN_FRONTEND=noninteractive apt-get update -yqq \
&& apt-get install -y apt-transport-https \
&& apt-get install -y --no-install-recommends curl libc6 g++ libssl1.0 \
&& export $(grep VERSION_ID /etc/os-release | sed -e 's/\"//g') \
&& curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \
&& curl https://packages.microsoft.com/config/debian/${VERSION_ID}/prod.list > /etc/apt/sources.list.d/mssql-release.list \
&& apt-get update -yqq \
&& ACCEPT_EULA=Y apt-get install -y --no-install-recommends unixodbc odbcinst1debian2 unixodbc-dev msodbcsql17 mssql-tools \
&& pecl install pdo_sqlsrv \
&& docker-php-ext-enable pdo_sqlsrv \
&& apt-get remove -y unixodbc-dev curl g++ apt-transport-https \
&& rm -rf /var/lib/apt/lists/* \
&& rm /etc/apt/sources.list.d/mssql-release.list
in kali linux,how fix? @fabiang @chrispappas @stevedesmond-ca
# ldd '/opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.2.so.0.1'|grep 'not found'
libcrypto.so.1.0.0 => not found
libssl.so.1.0.0 => not found
# apt search libcrypto|grep installed
libssl-dev/kali-rolling,testing,now 1.1.0h-4 amd64 [installed]
libssl1.0.2/kali-rolling,testing,now 1.0.2o-1 amd64 [installed]
libssl1.1/kali-rolling,testing,now 1.1.0h-4 amd64 [installed]
in kali linux,how fix,
i am ok
@fabiang @chrispappas @stevedesmond-ca
# find / -name "libssl.so.1*.*"
/var/lib/docker/aufs/diff/ab6ad040a6763faa6f03ef656622243463e7730a88f68a6725c462465edc0bfe/lib/x86_64-linux-gnu/libssl.so.1.0.0
^C
root@b90f61682f4b:~/mytools/tmp# cp /var/lib/docker/aufs/diff/ab6ad040a6763faa6f03ef656622243463e7730a88f68a6725c462465edc0bfe/lib/x86_64-linux-gnu/libssl.so.1.0.0 /usr/lib/x86_64-linux-gnu/
# find / -name "libcrypto.so.1*.*"
/var/lib/docker/aufs/diff/ab6ad040a6763faa6f03ef656622243463e7730a88f68a6725c462465edc0bfe/lib/x86_64-linux-gnu/libcrypto.so.1.0.0
cp /var/lib/docker/aufs/diff/ab6ad040a6763faa6f03ef656622243463e7730a88f68a6725c462465edc0bfe/lib/x86_64-linux-gnu/libcrypto.so.1.0.0 /usr/lib/x86_64-linux-gnu/
@hktalent Does @chrispappas's fix not work for you? It seems this bug can be fixed by configuring the correct repo, and my understanding is that Debian repos are compatible with Kali Linux.
On ubuntu 18.04 and Debian 9, you can install libssl 1.0 to fix this issue:
apt install libssl1.0
This should be a dependency the msodbcsql17 package.
On ubuntu 18.04 and Debian 9, you can install libssl 1.0 to fix this issue:
apt install libssl1.0This should be a dependency the msodbcsql17 package.
This fixed my similar problem for "Canβt open lib β/opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.2.so.0.1β : file not found".
Anyway ubuntu 18.04 has libssl1.1 installed, but msodbcsql17 ignored it. Make use of libssl1.1 instead of libssl1.0 should be a better solution.
@whuhacker yes, ODBC team is aware of this issue. Their future release will detect openssl 1.0 or 1.1 and use whichever is available.
libssl1.0.0 seems to be not available anymore, so manual install worked for me:
RUN wget http://security.debian.org/debian-security/pool/updates/main/o/openssl/libssl1.0.0_1.0.1t-1+deb8u10_amd64.deb \
&& dpkg -i libssl1.0.0_1.0.1t-1+deb8u10_amd64.deb
I recommend to move them instead of copying, that way you will not confuse yourself with multiple DM libraries.
Most helpful comment
On ubuntu 18.04 and Debian 9, you can install libssl 1.0 to fix this issue:
This should be a dependency the msodbcsql17 package.