SQL Server 2019 and MongoDB

Ilia Odintsov 1 Reputation point
2020-09-14T10:07:31.607+00:00

Hi,

I am using:

Microsoft SQL Server 2019 (RTM-CU7) (KB4570012) - 15.0.4063.15 (X64) 
Aug 15 2020 10:48:11 
Copyright (C) 2019 Microsoft Corporation
Developer Edition (64-bit) on Linux (Ubuntu 20.04.1 LTS) <X64>

and MongoDB:

"version": "4.4.1",
"gitVersion": "ad91a93a5a31e175f5cbf8c69561e788bbc55ce1",
"openSSLVersion": "OpenSSL 1.1.1f 31 Mar 2020",
"modules": [],
"allocator": "tcmalloc",
"environment": {
"distmod": "ubuntu2004",
"distarch": "x86_64",
"target_arch": "x86_64"

When I try to connect to use PolyBase to create External tables I have some weird error:

105082;Generic ODBC error: [Microsoft][MongoDBODBC] (110) Error from MongoDB Client: No servers yet eligible for rescan (Error Code: 13053) Additional error <2>: ErrorMsg: [Microsoft][MongoDBODBC] (110) Error from MongoDB Client: No servers yet eligible for rescan (Error Code: 13053), SqlState: HY000, NativeError: 110 .

After few executions table is finally created. But then, when I try to query it it shows same error.

No interesting info in logs on both sides, but I find out based on a mongodb logs that SQL Server is using mongoc drivers version 1.13

"driver":{"name":"mongoc","version":"1.13.0"},"os":{"type":"Windows","name":"Windows","version":"6.2 (9200)","architecture":"x86_64"

And this version is not compatible with version 4.4 of mongodb (https://docs.mongodb.com/drivers/c#compatibility).

Am I right and switching to older version of mongo will help? Is there any plans to update drivers used to access mongodb in SQL Server on Linux? Can I somehow point SQL Server to another drivers?

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

3 answers

Sort by: Most helpful
  1. Olaf Helper 40,901 Reputation points
    2020-09-14T12:05:02.6+00:00

    Have you followed all steps from Configure PolyBase to access external data in MongoDB ?


  2. CathyJi-MSFT 21,096 Reputation points Microsoft Vendor
    2020-09-15T07:55:41.907+00:00

    Hi @John Abel ,

    Try to check if MongoDB 4.0.4 still have this issue? Refer to this blog Enhanced PolyBase SQL 2019 – MongoDB and external table.

    Best regards,
    Cathy


    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  3. Schmlughtz 1 Reputation point
    2022-02-01T21:20:44.46+00:00

    I'm using the latest version of mongodb, and had exactly the same error, it is really frustrating !
    Msg 105082, Level 16, State 1, Line 12
    105082;Generic ODBC error: NativeOdbcConnection.Open, error in OdbcConnectionCreate: SqlState: HY000, NativeError: 110, 'Error calling: SQLDriverConnect(this->_hdbc, NULL, (SQLWCHAR*)connectionString, SQL_NTS, NULL, 0, &cbConnStrOut, SQL_DRIVER_NOPROMPT), SQL return code: -1 | SQL Error Info: Error <1>: ErrorMsg: [Microsoft][MongoDBODBC] (110) Error from MongoDB Client: No servers yet eligible for rescan (Error Code: 13053) Additional error <2>: ErrorMsg: [Microsoft][MongoDBODBC] (110) Error from MongoDB Client: No servers yet eligible for rescan (Error Code: 13053), SqlState: HY000, NativeError: 110 | ConnectionPooling: 1 | Error calling: pConn->Create(connectionString, databaseName, useConnectionPooling, packetSize, connectionLoginTimeout, environmentSettings, transactionToken, transactionTokenSize, resourceGroupName, driverCapabilities, spid) | state: FFFF, number: 1, active connections: 1', Connection String: Driver={PolyBase ODBC Driver for MongoDB};ssl=1;sslallowinvalidcertificates=1;defaultstringcolumnlength=2147483647;defaultbinarycolumnlength=2147483647;uid=james;server=127.0.0.1;port=27017;database=testmongo;authmechanism=SCRAM-SHA-1.

    0 comments No comments