-
Notifications
You must be signed in to change notification settings - Fork 204
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
Failure when writing to Cosmos MongoDB Service #1717
Labels
Milestone
Comments
dgomezc
added
bug
Something is broken
Generated Code
Template code that is generated
labels
Feb 12, 2021
ghost
added
the
needs-triage
For new issues that are raised to get reviewed by internal Microsoft employees
label
Feb 12, 2021
To solve this, add the property
function connect() {
mongoose
.connect(`${process.env.COSMOSDB_CONNSTR}?ssl=true&replicaSet=globaldb`, {
auth: {
user: process.env.COSMOSDB_USER,
password: process.env.COSMOSDB_PASSWORD
},
useNewUrlParser: true,
useUnifiedTopology: true,
retryWrites: false
})
.then(() => console.log("Connection to CosmosDB successful"))
.catch(err => console.error(err));
}
client = MongoClient(connection_str + '?ssl=true&replicaSet=globaldb&retryWrites=false')
private IMongoClient InitializeCosmosClientInstance()
{
var connectionString = Configuration["COSMOSDB_CONNSTR"];
var userName = Configuration["COSMOSDB_USER"];
var dbName = Configuration["COSMOSDB_DB_NAME"];
var password = Configuration["COSMOSDB_PASSWORD"];
var settings = MongoClientSettings.FromConnectionString(connectionString);
var identity = new MongoInternalIdentity(dbName, userName);
var evidence = new PasswordEvidence(password);
settings.Credential = new MongoCredential("SCRAM-SHA-1", identity, evidence);
settings.UseTls = true;
settings.SslSettings = new SslSettings() { EnabledSslProtocols = SslProtocols.Tls12 };
settings.RetryWrites = false;
return new MongoClient(settings);
}
adapter: new MongoAdapter(
`${process.env.COSMOSDB_CONNSTR}?ssl=true&replicaSet=globaldb`,
{
auth: {
user: process.env.COSMOSDB_USER,
password: process.env.COSMOSDB_PASSWORD
},
useNewUrlParser: true,
useUnifiedTopology: true,
retryWrites: false
}
), |
sibille
changed the title
Failed when execute an App with Cosmos MongoDB Service
Failure when writing to Cosmos MongoDB Service
Feb 12, 2021
dgomezc
added
In Progress
Indicates the issue is currently being worked on
and removed
needs-triage
For new issues that are raised to get reviewed by internal Microsoft employees
In Progress
Indicates the issue is currently being worked on
labels
Feb 15, 2021
Fixed and tested in version: 0.5.2104801 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
When writing to a Cosmos MongoDB service from a generated app we get the following error:
"Retryable writes are not supported. Please disable retryable writes by specifying "retrywrites=false" in the connection string or an equivalent driver specific config."
To Reproduce
Steps to reproduce the behavior:
The text was updated successfully, but these errors were encountered: