question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CosmosDB UUID issue

See original GitHub issue

Hi,

I’m currently facing issue with UUID 04 representation in CosmosDB mongo API driver:

"Message": "GuidRepresentation Standard is only valid with subType UuidStandard, not with subType UuidLegacy.\r\nИмя параметра: guidRepresentation"

They said they added it to all regions: https://feedback.azure.com/forums/263030-azure-cosmos-db/suggestions/20206180-support-uuid-subtype-4

I just wonder how to make it work both MongoDB and CosmosDB with Standard UUID type?

Seems to me that only CSharpLegacy type will work for both. Any suggestions?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
alexandre-spiesercommented, Sep 27, 2018

yeah it does. I’ve also removed the static constructor in the last version of the repo 😉

1reaction
alexandre-spiesercommented, May 24, 2018

Thanks for the feedback, I’ll look into removing the static constructor. I have not tested this, but are you sure you cannot overwrite the GuidRepresentation in the constructor of your repository though?

    public class TestRepository : BaseMongoRepository, ITestRepository
    {
        public TestRepository(string connectionString, string databaseName) : base(connectionString, databaseName)
        {
              MongoDbContext.SetGuidRepresentation(MongoDB.Bson.GuidRepresentation.CSharpLegacy);
        }
    }

According to https://github.com/mongodb/mongo-csharp-driver/blob/master/src/MongoDB.Driver/MongoDefaults.cs, it should not cause issues:

        /// <summary>
        /// Gets or sets the representation to use for Guids (this is an alias for BsonDefaults.GuidRepresentation).
        /// </summary>
        public static GuidRepresentation GuidRepresentation
        {
            get { return BsonDefaults.GuidRepresentation; }
            set { BsonDefaults.GuidRepresentation = value; }
        }
Read more comments on GitHub >

github_iconTop Results From Across the Web

cosmos cannot delete the duplicate uuid - azure
You cannot delete any content via the query language; you need to use the API (or language-specific Cosmos DB SDK) for any operation...
Read more >
Troubleshoot Azure Cosmos DB bad request exceptions
Learn how to diagnose and fix bad request exceptions such as input content or partition key is invalid, partition key doesn't match in...
Read more >
Troubleshoot Azure Cosmos DB request rate too large ...
A "Request rate too large" exception, also known as error code 429, indicates that your requests against Azure Cosmos DB are being rate ......
Read more >
Preventing Headaches with Cosmos Document IDs
The following simple tip regarding Cosmos DB's document identifier property may help you avoid creating a hard-to-find bug in your code.
Read more >
Vulnerability in Azure Cosmos DB allows for remote code ...
The vulnerability is a design flaw. Each Jupyter Notebook environment in Azure Cosmos DB has a universally unique identifier (UUID). Orca ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found