DLL error on connecting to Latin1_General_BIN collation server using Docker image

2021-01-06T19:46:43.183+00:00

There is a DLL error being throwing when trying to connect to mcr.microsoft.com/mssql/server:2017-latest on Docker using Latin1_General_BIN with the node.js tedious driver. More info can be found here: https://github.com/tediousjs/tedious/issues/1195

For e.g., running this command: docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=Password(12)" -e "MSSQL_COLLATION=Latin1_General_BIN" -p 1433:1433 -d mcr.microsoft.com/mssql/server:2017-latest

Tedious returns an error thrown from the server: RequestError: Could not load the DLL (server internal), or one of the DLLs it references. Reason: 126(The specified module could not be found.).

Any thoughts?

Thanks!

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,629 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Erland Sommarskog 109.8K Reputation points MVP
    2021-01-07T22:35:37.463+00:00

    I tried connecting to the Docker image with a .NET client and that worked.

    Unfortunately, I don't think I can try Tedious myself, because I'm not at all into Javascript. But there must be something that you are API is doing differently that provokes this error.

    But here are some things to try to narrow this down a bit:

    • Install a regular SQL Server instance with Latin1_General_BIN as the server collation.
    • Try other collations, for instance Latin1_General_BIN2.

    When you get this error, do you get it directly on connection? Or do you need to submit a query?

    1 person found this answer helpful.

  2. Erland Sommarskog 109.8K Reputation points MVP
    2021-01-08T17:23:55.407+00:00

    I looked at Tedious at little more and I realise that you speak TDS directly from Javascript without an underlying API.

    I will have to say that there is a fair chance that you are not doing something a bit incorrectly. But what exactly what it would be, I don't know.

    You should absolutely test against a non-Docker instance of SQL Server with Latin1_General_BIN as the server collation. And preferably both on Windows and Linux. If it fails in these two cases, I would be quite confident that this is an issue in Tedious.

    Does any query fail, for instance a simple one as SELECT 1 AS n? Or does it have to be one with parameters? String parameters? (These are questions I mainly ask to inspire your troubleshooting.)

    1 person found this answer helpful.

  3. Erland Sommarskog 109.8K Reputation points MVP
    2021-07-07T22:34:53.737+00:00

    Thanks to Sławomir's post, it is clear that this is purely an SQL Server, and Tedious was just an unfortunate victim. I was able to repro the problem by installing SQL Server with a BIN2 collation, and then running

    EXEC sp_executesql N'SELECT 1'
    
    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.