Skip to content
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

CI failing SQL Server: no sqlcmd #1380

Closed
mkleehammer opened this issue Sep 8, 2024 · 6 comments
Closed

CI failing SQL Server: no sqlcmd #1380

mkleehammer opened this issue Sep 8, 2024 · 6 comments

Comments

@mkleehammer
Copy link
Owner

The CI jobs are failing with this message:

OCI runtime exec failed: exec failed: unable to start container process: exec: "/opt/mssql-tools/bin/sqlcmd": stat /opt/mssql-tools/bin/sqlcmd: no such file or directory: unknown

Possibly related to this?

microsoft/mssql-docker#892

@mkleehammer
Copy link
Owner Author

https://learn.microsoft.com/en-us/sql/linux/sql-server-linux-setup-tools?view=sql-server-ver16&tabs=redhat-install#install-tools-on-linux

According to the bug report in the description and this documentation it points to, it should be as easy as adding "18" to the directory name (and maybe add -C). It says the docker image should already contain it. I tried on a fix-ss-tests branch and it isn't working.

OCI runtime exec failed: exec failed: unable to start container process: exec: "/opt/mssql-tools18/bin/sqlcmd": stat /opt/mssql-tools18/bin/sqlcmd: no such file or directory: unknown

@mkleehammer
Copy link
Owner Author

@keitherskine
Copy link
Collaborator

keitherskine commented Sep 8, 2024

Adding "18" and "-C" to the mssql2019 and mssql2022 commands (but leaving mssql2017 as was) seems to work:

        echo "*** SQL Server 2017"
        docker exec -i "${{ job.services.mssql2017.id }}" /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P 'StrongPassword2017' -Q "SELECT @@VERSION" || sleep 5
        docker exec -i "${{ job.services.mssql2017.id }}" /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P 'StrongPassword2017' -Q "CREATE DATABASE test"
        echo "*** SQL Server 2019"
        docker exec -i "${{ job.services.mssql2019.id }}" /opt/mssql-tools18/bin/sqlcmd -S localhost -U SA -P 'StrongPassword2019' -C -Q "SELECT @@VERSION" || sleep 5
        docker exec -i "${{ job.services.mssql2019.id }}" /opt/mssql-tools18/bin/sqlcmd -S localhost -U SA -P 'StrongPassword2019' -C -Q "CREATE DATABASE test"
        echo "*** SQL Server 2022"
        docker exec -i "${{ job.services.mssql2022.id }}" /opt/mssql-tools18/bin/sqlcmd -S localhost -U SA -P 'StrongPassword2022' -C -Q "SELECT @@VERSION" || sleep 5
        docker exec -i "${{ job.services.mssql2022.id }}" /opt/mssql-tools18/bin/sqlcmd -S localhost -U SA -P 'StrongPassword2022' -C -Q "CREATE DATABASE test"

https://github.com/keitherskine/pyodbc/actions/runs/10761640943/job/29841067213

@keitherskine
Copy link
Collaborator

OK, will do. One sec...

@mkleehammer
Copy link
Owner Author

Thanks @keitherskine That was it. I thought 2017 was also failing.

@keitherskine
Copy link
Collaborator

No probs @mkleehammer , the Ubuntu CI tests are passing now.

ffelixg pushed a commit to ffelixg/pyodbc that referenced this issue Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants