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

/opt/mssql-tools/bin/sqlcmd: not found in mcr.microsoft.com/mssql/server:2022-latest #573

Closed
mchoma opened this issue Aug 19, 2024 · 2 comments
Labels

Comments

@mchoma
Copy link
Contributor

mchoma commented Aug 19, 2024

Latest mssql (2022-latest refering to 2022-CU14-ubuntu-20.04) is not starting properly because we are getting probe error

Readiness probe failed: /bin/sh: 0: can't access tty; job control turned off /bin/sh: 1: /opt/mssql-tools/bin/sqlcmd: not found 

Commadn wasreplaced /opt/mssql-tools/bin/sqlcmd -> /opt/mssql-tools18/bin/sqlcmd. From tracking issue microsoft/mssql-docker#892, it does not seem adding symlink is plan.

Seems to me we need to change this code in xtf

@Override
protected ProbeSettings getProbeSettings() {
return new ProbeSettings(30,
String.valueOf(this.getPort()),
5,
"/opt/mssql-tools/bin/sqlcmd -S localhost -d " + getDbName() + " -U " + getUsername() + " -P " + getPassword()
+ " -Q \"Select 1\"",
5,
"/opt/mssql-tools/bin/sqlcmd -S localhost -d " + getDbName() + " -U " + getUsername() + " -P " + getPassword()
+ " -Q \"Select 1\"",
10,
10);
}
to be able to use latest mssql images again.

Also from issue comments we may need to add option -C

@mchoma
Copy link
Contributor Author

mchoma commented Aug 19, 2024

@dosu any idea?

Copy link

dosubot bot commented Aug 19, 2024

To resolve the readiness probe failure with the latest MSSQL Docker image, you need to update the getProbeSettings method in the MsSQL.java file to use the new path /opt/mssql-tools18/bin/sqlcmd and include the -C option. Here is the updated code:

@Override
protected ProbeSettings getProbeSettings() {
    return new ProbeSettings(30,
            String.valueOf(this.getPort()),
            5,
            "/opt/mssql-tools18/bin/sqlcmd -S localhost -d " + getDbName() + " -U " + getUsername() + " -P " + getPassword()
                    + " -C -Q \"Select 1\"",
            5,
            "/opt/mssql-tools18/bin/sqlcmd -S localhost -d " + getDbName() + " -U " + getUsername() + " -P " + getPassword()
                    + " -C -Q \"Select 1\"",
            10,
            10);
}

This change updates the readiness probe command to use the new path and includes the -C option for compatibility with the latest MSSQL Docker image [1].

To continue talking to Dosu, mention @dosu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants