Closed ibombonato closed 5 years ago
@ajdavis what does this error mean? I'm guessing the server version of openssl is too old?
No, it's a CosmosDB issue. It reports maxWireVersion 2, but the C Driver requires a server that supports wire protocol version 3 or later. I'd report it to Microsoft.
@ibombonato not much I can do here then. You can try installing an old version such as mongolite 1.6, which was the last version to support wire version 2:
install.packages('mongolite', repos = 'https://cran.microsoft.com/snapshot/2018-08-01')
@ajdavis I don't know if this changes anything, but I run a command here to see the wire version and it reports 2 when using emulator, but 5 at production environment. So in theory, I guess I should be able to connect to the production environment, but I cant anyway.
Production Environment:
db.runCommand( { isMaster: 1 } )
{
"_t" : "IsMasterResponse",
"ok" : 1,
"ismaster" : true,
"maxBsonObjectSize" : 16777216,
"maxMessageSizeBytes" : 4194304,
"maxWriteBatchSize" : 1000,
"minWireVersion" : 0,
"maxWireVersion" : 5,
"localTime" : ISODate("2018-12-12T18:59:23.171Z"),
"setVersion" : 1,
}
Emulator:
{
"_t" : "IsMasterResponse",
"ok" : 1,
"ismaster" : true,
"maxBsonObjectSize" : 16777216,
"maxMessageSizeBytes" : 4194304,
"maxWriteBatchSize" : 1000,
"minWireVersion" : 0,
"maxWireVersion" : 2,
"localTime" : ISODate("2018-12-12T18:58:10.408Z")
}
Hi, I don't have any experience with Azure or CosmosDB. What emulator are you referring to please?
There is a software to emulate Azure Cosmos DB at your on machine, that way you can develop/test things out without the need to pay for it on Azure itself.
CosmosDB Local Emulator - (https://docs.microsoft.com/en-us/azure/cosmos-db/local-emulator)
So, according to my previous post, at the emulator, maxWireVersion is 2, so it is a Microsoft problem for sure... But when I run at CosmosDB on Azure, not the emulator, maxWireVersion is 5, so the problem should not happen, but it is happen anyway.
What command do you use to get the wire version? Is it db.runCommand( { isMaster: 1 } )
? Or is something else? That way I can test it here.
I can create/provide access to a sample database in CosmosDB at Azure itself if you need to test something out.
@ibombonato not much I can do here then. You can try installing an old version such as mongolite 1.6, which was the last version to support wire version 2:
install.packages('mongolite', repos = 'https://cran.microsoft.com/snapshot/2018-08-01')
fwiw, It is working with this version.
Thank you!
Right, run db.runCommand({isMaster: 1}). The logic MongoDB drivers use to check compatibility is specified here:
MongoDB drivers currently define clientMinWireVersion as 3, and clientMaxWireVersion as 6.
I reported this to Microsoft in August (Support Request Number - 118082418860894). After some back and forth they acknowledged that it was their issue and it was supposed to be fixed in September. I haven't been following it since then, as I was unable to continue use of mongolite because I need GridFS support
mongolite does have GridFS support now, right?
Yes it does, but he isn't able to use the latest version of the C driver because his CosmosDB server only supports wire version 2. This is a bug in CosmosDB, we can't fix this in the client.
This is now fixed in Cosmos - but you have to specify to use Server Version 3.6 when you set up your Cosmos DB account
@rtreacy I have specified Server Version 3.6 and still don't work in mongolite last version. Only with https://cran.microsoft.com/snapshot/2018-08-01.
"Server at cdb-ms-prod-eastus1-fd25.documents.azure.com:10255 reports wire version 2, but this version of libmongoc requires at least 3 (MongoDB 3.0)"
Any advice?
@pedrodpduarte The connection string has a slightly different format. Are you using the new connection string generated when you set up the new 3.6 Cosmos DB account, from the portal under Settings -> Connection String?
I am trying to connect to Azure CosmosDB (Mongo API) and when trying to connect, it gives a message telling that libmongc requires version 3.
How to reproduce it using Azure Cosmos Emulator
After install the CosmosDB Local Emulator, juts start it and go to
R
.I connect to the emulator using Robomongo, (https://dotnetthoughts.net/connecting-to-azure-cosmos-db-emulator-from-robomongo/) and it says the version is 3.2.0: