I have a SQL Server deployed on Openshift Container platform, on a RHEL image. The server is accessible using the SQLCMD command from the container itself. But when I try to access the same server from outside the container/pod, I get a very strange error as below:
Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : Driver's SQLAllocHandle on SQL_HANDLE_HENV failed.
I am attempting this from a container which contains the client tools only. I tried to create a DSN as well. I still get the same error. A Kubernetes Service has been deployed and its pointing to the port 1433.
What am I missing? Please advise. thanks
ok. It turns out that by default a container launched in OCP does not run as a known user. This results in this error. By creating a new user, before invoking sqlcmd
, this issue can be addressed.