-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'ODBC Driver 18 for SQL Server' : file not found (connecting to database) #496
Comments
Initial thoughts are there is a blog on this topic here in a non container environment https://www.hammerdb.com/blog/uncategorized/configuring-unixodbc-and-sql-server-drivers-for-hammerdb-on-linux/ We will check the container |
In the HammerDB DockerFile, in this repo, all is scripted correctly. I have cross-referenced the Microsoft. Which I also posted above. Install and configure Microsoft SQLServer client librariesHowever, I still get the ODBC 18 not found error. |
Testing a build with unixODBC 2.3.11. The current DockerFile uses 2.3.9. Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/l/linux/linux-libc-dev_5.4.0-136.153_amd64.deb 404 Not Found [IP: 91.189.91.39 80] Maybe this is the reason the HammerDb DockerFile remains at 2.3.9 ? I will keep testing and report back. |
Thanks for testing this. Sure do let us know how it goes. For now, Dockerfile is tested and works with ODBC Driver 17 for SQL Server (perhaps 2019) |
Hello. |
Hello, So I replaced the installation for UnixODBC 2.3.9 to 2.3.11 and ODBC Driver 17 to 18 , with some changes and the container builds fine. I haven't tested it against the database yet. I will look into this further. Snippet as below: Install and configure Microsoft SQLServer client librariesRUN apt -y install -q |
I have tested the connectivity for both ODBC 17 & 18 following the instructions here: Only ODBC 17 is installed by default in the current v4.6 Docker release (although ODBC 18 is the HammerDB default) and also the correct odbcinst.ini is not updated for ODBC 17, however adding the correct entry to odbcinst.ini in /usr/local/unixODBC/etc then works correctly connecting to an external SQL Server database on Windows with ODBC 17. For ODBC 18 it is necessary to install the drivers here as described here https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server, however the Ubuntu instructions require the lsb-release command and this is not installed by default. There you need to run:
first, for the instructions to work correctly. After installing lsb-release do:
Note it says that the target directory is /usr/local/unixODBC/etc We can then verify the install:
In my tests I can then use both ODBC Driver 17 and ODBC Driver 18 from within the Docker container. So the Docker container for v4.7 needs to be updated to:
Then the SQL Server for Linux connectivity should work without further configuration. |
When testing this. I am getting a build error. #9 3.224 E: Invalid operation curl |
What I am using that is failing on build. Install and configure Microsoft SQLServer client librariesRUN apt -y install -q && |
Well, Probably some formatting error in the comment section. Please refer the snippet here. Docker builds fine. https://github.com/pooja-jain-17/HammerDB/blob/docker-4.7/Docker/Dockerfile |
I still see this issue with your latest 4.7 repo build. #8 40.95 Err:39 http://security.ubuntu.com/ubuntu focal-updates/main amd64 linux-libc-dev amd64 5.4.0-136.153 |
I have noticed this behavior when we have broken builds on the system. Please check if there are any containers running, Once try post removing the prior hammerdb images and containers. |
@sm-shaw , The RUN command specified above has all the recommendations in your comment, except for From within the container,
I have added this manually in the file odbcinst.ini file for now. Need to add it to the Dockerfile.
|
Really good tip regarding removing previous containers. I did have a few running. I did clean up everything 100%, but still the error regarding the ubuntu security. #8 43.55 Err:39 http://security.ubuntu.com/ubuntu focal-updates/main amd64 linux-libc-dev amd64 5.4.0-136.153 |
Do remove any broken images as well.
and then do a docker build without cache Hope this helps. |
@pooja-jain-17 one check for updating odbcinst.ini is that it is done after the driver installation. If the entry is already there, then I found the driver will not install and gives a message that it is already installed.
|
Thanks Steve. That's taken into account. For next version of HammerDB we will have UnixODBC 2.3.11 and ODBC Driver 18 for MSSQL Server client libraries. I have updated the Dockerfile here here to reflect the same. |
Using the latest DockerFile posted in this repo I am unable to connect via the HammerDB cli.
Error: Transaction Counter Error: connection failed [unixODBC][Driver Manager]Can't open lib 'ODBC Driver 18 for SQL Server' : file not found (connecting to database)
I have added a separate RUN in the DockerFile using this pattern from Microsoft, for an additional test. This feels duplicative from the already scripted DockerFil in this repo. Both tests fail.
Transaction Counter Error: connection failed [unixODBC][Driver Manager]Can't open lib 'ODBC Driver 18 for SQL Server' : file not found (connecting to database)
I can connect to the SQL 2022 in a linux container environment, from any Windows DB admin app, but not with HammerDB CLI in the container.
Thoughts?
The text was updated successfully, but these errors were encountered: