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.

issue with uuidv5 and/or parse function - Invalid UUID

See original GitHub issue

Describe the bug

A GUID generated in dotnet is failing to parse. We get an error: Invalid UUID. We encountered the issue with v5, but it’s the same error if you pass to the new parse function. I ran git bisect using this test and it fails starting on commit: 0e6c10ba1bf9517796ff23c052fc0468eedfd5f4.

    describe('v5', () => {
       test('should parse', () => {
       const id1 = v5('test', 'de42f6ff-210c-da9c-a30e-1a4ac2743656');
  
       });
    });

How to reproduce

Run this test:

    describe('v5', () => {
       test('should parse', () => {
       const id1 = v5('test', 'de42f6ff-210c-da9c-a30e-1a4ac2743656');
  
       });
    });

Expected behavior

Should produce a v5 uuid.

Runtime

  • OS: [macOS, Linux]
  • Runtime: [e.g. Node.js, AWS Lambda]
  • Runtime Version: [e.g. 12x]

Additional information

[Any other information or comments that you think will help]

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
afterthoughtcommented, Aug 20, 2020

Ok. So I was wrong about it coming from dotnet. It actually originates from an old titanium based mobile app with a handwritten random number generator that just orders the chars/digits into a guid format. Pretty bad. (I did do some testing with the MS Guid.newGuid() method and it seems compliant).

I definitely see that the ID is non-compliant and now we know why. I’m now in the pinch of figuring out how to move forward. Our design/architecture relies heavily on uuidv5 and now I’ve found that I have a mountain of legacy data that won’t be compatible. For now I can pin the library at 8.2. Not a great long-term solution though. On my end I’m going to see if I can convince the product team to fix the uuid generation and ideally have a conversion strategy for older data.

1reaction
broofacommented, Aug 20, 2020

FWIW, I think there’s some misconceptions around the synonymity of Microsoft GUIDs and RFC4122. Lots of articles out there conflating these two terms, often claiming they’re identical. However, Microsoft is pretty clear that GUIDs are allowed to contain any hex digit.

As @ctavan notes, RFC UUIDs have specific requirements for the version and variant fields, whereas GUIDS can have any hex digts there. I.e. The current behavior - where this library considers Microsoft GUIDs that don’t comply with the RFC spec to be invalid - is the intended behavior.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Generating uuid v5 in node.js erros out with no information?
I want to egenrate a v5 uuid. I can generate a v4 no problem by requiring the module: const { v4: uuidv4 }...
Read more >
uuidv5 - Functions - Configuration Language | Terraform
The uuidv5 function generates a uuid v5 string representation of the value in the specified namespace.
Read more >
UUID:fromString() parses incorrect strings without error
Bug - A problem which impairs or prevents the functions of the product. JDK-8216407 java.util.UUID.fromString accepts input that does not match expected format....
Read more >
UUIDs - Go Packages
The uuid package generates and inspects UUIDs based on RFC 4122 and DCE 1.1: Authentication and Security Services. This package is based on...
Read more >
Recalculate UUIDs for Vulnerabilities::Findings using UUIDv5
Important Note: Rails UUID V5 generation method has a flaw inside which results in creating wrong UUIDs if the namespace ID is also...
Read more >

github_iconTop Related Medium Post

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