-
Notifications
You must be signed in to change notification settings - Fork 760
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
Latest Docker image missing /opt/mssql-tools directory #892
Comments
Our CI Pipeline has started doing this: [testcontainers.org 00:00:23.12] Docker image mcr.microsoft.com/mssql/server:2022-latest created This was working yesterday, and changing it from latest to mcr.microsoft.com/mssql/server:2022-CU13-ubuntu-22.04 fixes the issue |
Our CI pipeline is suddenly doing the same thing as of today. Will revert to the previous build until Microsoft remember what testing is. |
I am getting this as well all our ci/cd builds fail. Trying an earlier image like SQL server 2017 works if that is an option in the mean time. |
I fixed the problem by changing my healthcheck path to /opt/mssql-tools18/bin/sqlcmd And i needed to add the -C to trust the certificate healthcheck:
test: /opt/mssql-tools18/bin/sqlcmd -C -S localhost -U sa -P "$${SA_PASSWORD}" -Q "SELECT 1" -b -o /dev/null
interval: 10s
timeout: 3s
retries: 10
start_period: 10s |
Thank you all for the workaround. I imagine I was not alone being up part of the night unblocking QA by temporarily disabling CI tests as a build gate so QA could move forward.. Which would have never been a permanent solution, and we still would have been unable to release without the CI tests working and only having manual testing. These workarounds are great and we are confident implementing these will allow us to move forward with the release. |
As a workaround i use server:2022-CU13-ubuntu-20.04 instead of server:2022-latest |
.. with testcontainers because the path `/opt/mssql-tools/bin/sqlcmd` changed to `/opt/mssql-tools18/bin/sqlcmd`. But this hardcoded path is being used in testcontainers, causing it to fail. testcontainers/testcontainers-dotnet#1220 microsoft/mssql-docker#892
.. because the path `/opt/mssql-tools/bin/sqlcmd` changed to `/opt/mssql-tools18/bin/sqlcmd`. And this is being used in `samples/DatabaseContainers/DatabaseContainers.AppHost/sqlserverconfig/configure-db.sh`. testcontainers/testcontainers-dotnet#1220 microsoft/mssql-docker#892
…testcontainers (#5058) * [tests] Workaround sqlserver 2022-latest latest image failing .. with testcontainers because the path `/opt/mssql-tools/bin/sqlcmd` changed to `/opt/mssql-tools18/bin/sqlcmd`. But this hardcoded path is being used in testcontainers, causing it to fail. testcontainers/testcontainers-dotnet#1220 microsoft/mssql-docker#892 * add comment referencing the issue
* Workaround sqlserver 2022-latest latest image failing .. because the path `/opt/mssql-tools/bin/sqlcmd` changed to `/opt/mssql-tools18/bin/sqlcmd`. And this is being used in `samples/DatabaseContainers/DatabaseContainers.AppHost/sqlserverconfig/configure-db.sh`. testcontainers/testcontainers-dotnet#1220 microsoft/mssql-docker#892 * Fix sqlcmd invocation to trust the server certificate Fixes: ``` Sqlcmd: Error: Microsoft ODBC Driver 18 for SQL Server : TCP Provider: Error code 0x2749. Sqlcmd: Error: Microsoft ODBC Driver 18 for SQL Server : SSL Provider: [error:0A000086:SSL routines::certificate verify failed:self-signed certificate]. Sqlcmd: Error: Microsoft ODBC Driver 18 for SQL Server : A network-related or instance-specific error has occurred while establishing a connection to 2d77e8a3691a. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.. Sqlcmd: Error: Microsoft ODBC Driver 18 for SQL Server : Client unable to establish connection. For solutions related to encryption errors, see https://go.microsoft.com/fwlink/?linkid=2226722. ```
We have updated our documentation to say the following:
|
* chore: upgrade atlas and SDK * .github/workflows: fixed sqlserver2022 break see: microsoft/mssql-docker#892
* Workaround sqlserver 2022-latest latest image failing .. because the path `/opt/mssql-tools/bin/sqlcmd` changed to `/opt/mssql-tools18/bin/sqlcmd`. And this is being used in `samples/DatabaseContainers/DatabaseContainers.AppHost/sqlserverconfig/configure-db.sh`. testcontainers/testcontainers-dotnet#1220 microsoft/mssql-docker#892 * Fix sqlcmd invocation to trust the server certificate Fixes: ``` Sqlcmd: Error: Microsoft ODBC Driver 18 for SQL Server : TCP Provider: Error code 0x2749. Sqlcmd: Error: Microsoft ODBC Driver 18 for SQL Server : SSL Provider: [error:0A000086:SSL routines::certificate verify failed:self-signed certificate]. Sqlcmd: Error: Microsoft ODBC Driver 18 for SQL Server : A network-related or instance-specific error has occurred while establishing a connection to 2d77e8a3691a. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.. Sqlcmd: Error: Microsoft ODBC Driver 18 for SQL Server : Client unable to establish connection. For solutions related to encryption errors, see https://go.microsoft.com/fwlink/?linkid=2226722. ```
Do you plan on fixing the examples in this repo? mssql-docker/linux/preview/examples/mssql-customize/configure-db.sh Lines 12 to 25 in 264d720
|
...theres this thing called a "symlink" that is useful to maintain compatibility, consistent with the "phasing out" position... |
This looks like an (very) unnecessary break and doesn't fit with the cloud-native paradigm/principles. It should be reverted or apply a symlink as aptly suggested by @cloudshiftchris. Also, was there an announcement for this break ahead of time? If not, that's something to consider for next time. Again, breaks should never be a surprise. If this break was accidental, then the comment by @eerhardt is quite relevant. |
Hi, i don't get that this should be the solution. Some ppl like me might have to test our software with a mssql server as our customers want to use them for some reason... so i have to get a container ready and filled with data for my tests. to do this i have to use the mssql cmd. ist is not that hard to set a fallback from /opt/mssql-tools/ to the new /opt/mssql-tools18/ i don't careifs it is tools version 18, 19 or 20. you can easaly swap there to the newest version and let the option to take a specific one if someone need it. and btw you still have this on dockerhub.... docker exec -it <container_id|container_name> /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P <your_password> |
2 things need to change: - the path to the binary, which is now secure by default; - the addition of the -C flag, telling sqlcmd to trust the certificate of the server. Quote from the documentation: > In SQL Server 2022 (16.x) CU 14 and later versions, container images > include the new mssql-tools18 package. The previous directory > /opt/mssql-tools/bin is being phased out. The new directory for > Microsoft ODBC 18 tools is /opt/mssql-tools18/bin, aligning with the > latest tools offering. For more information about changes and security > enhancements, see https://techcommunity.microsoft.com/t5/sql-server-blog/odbc-driver-18-0-for-sql-server-released/ba-p/3169228 See microsoft/mssql-docker#892
beside that, the new tool in 2019-latest does not trust the localhost self signed cert by default, thats why you may need to add "-C" flag to the call, like:
"Breaking changes from sqlcmd (ODBC)": If -N and -C aren't provided, sqlcmd negotiates authentication with the server without validating the server certificate. this change did break all our CI runs |
updates Testcontainers to the latest version `3.10.0`. This version includes a fix for the regression/changes made in the latest MSSQL Docker image (microsoft/mssql-docker#892). The recently added workaround (#5057, #5058) is no longer necessary. Fixes #5057
Well, as a workaround, for anyone who would like to have this symlink to
I'm doing something similar here. |
Tried on Ubuntu and Ubuntu on WSL.
When using the image mcr.microsoft.com/mssql/server:2022-latest, we are unable to call
/opt/mssql-tools/bin/sqlcmd
Container: mcr.microsoft.com/mssql/server:2022-latest
Ubuntu on WLS: Ubuntu 22.04.3 LTS
Further inspection show that mssql-tools has been replaced by mssql-tools18, in the image we have.
Steps to Replicate:
docker run --restart=unless-stopped -e \"ACCEPT_EULA=Y\" -e \"MSSQL_SA_PASSWORD=****\" -p 1433:1433 -d --name MyServer mcr.microsoft.com/mssql/server:2022-latest
docker exec MyServer /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P \"*****\" -Q \"CREATE DATABASE myDatabase\"
The above command is part of our CI pipeline and started failing today.
The text was updated successfully, but these errors were encountered: