-
Notifications
You must be signed in to change notification settings - Fork 290
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
Bug: MSSQL Cannot run 'SELECT 1': container is not ready #666
Comments
This issue is also present in other Testcontainers implementations: testcontainers/testcontainers-dotnet#1220 |
ok so based on the quoting this is being executed by the container's shell. so it can simply be replaced with $ docker image inspect mcr.microsoft.com/mssql/server:2019-latest | jq .[].Config.Env
[
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
] so how should we fix?
this does appear to work: $ docker run --rm -it --entrypoint 'bash' mcr.microsoft.com/mssql/server:2019-latest
mssql@5d2990b93a8a:/$ file /opt/mssql-tools*/bin/sqlcmd
/opt/mssql-tools18/bin/sqlcmd: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.24, BuildID[sha1]=a341d98e7522c347f723c8f11a1170d9cdf8ad7a, stripped
mssql@5d2990b93a8a:/$ /opt/mssql-tools*/bin/sqlcmd
^CCanceling connection...
mssql@5d2990b93a8a:/$ |
Cool. This is an elegant solution. |
Hi @alexanderankin, unfortunately, docker execute run
|
🤖 I have created a release *beep* *boop* --- ## [4.8.1](testcontainers-v4.8.0...testcontainers-v4.8.1) (2024-08-18) ### Bug Fixes * **generic:** Update the FastAPI install on genric module doctest samples ([#686](#686)) ([5216b02](5216b02)) * **mssql:** use glob to find mssql-tools folder since it moves ([#685](#685)) ([4912725](4912725)), closes [#666](#666) * wait_for_logs can now fail early when the container stops ([#682](#682)) ([925329d](925329d)) ### Documentation * Add a more advance usecase documentation for ServerContainer ([#688](#688)) ([2cf5a9f](2cf5a9f)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Describe the bug
Microsoft changes the
mssql-tools
folder name tomssql-tools18
at2019-latest
and2022-latest
. Testcontainer could not use the right path to check database status by mssql tool.testcontainers-python/modules/mssql/testcontainers/mssql/__init__.py
Line 55 in e1e3d13
Relate microsoft/mssql-docker#892 (comment)
To Reproduce
Solution
We need to determine the exact location of the MSSQL tool before utilizing it.
The text was updated successfully, but these errors were encountered: