Nil UUID
The nil UUID is 00000000-0000-0000-0000-000000000000. It is valid as a format but often used as a sentinel for 'no ID' or 'unknown'. Some systems reject it for real entities.
Common causes
- Using nil UUID where a real identifier is required.
- Comparing UUIDs and treating nil as a valid entity ID.
- APIs or DBs that disallow nil UUID for primary keys.
How to fix
- If your system allows nil as 'unset', use it consistently and document it.
- If nil is invalid in your context, validate and reject it; use a UUID validator to detect it.
- Generate a proper UUID for new entities instead of defaulting to nil.
FAQ
- Is nil UUID valid?
- Yes as a format. Semantically, many systems reserve it for 'no value' or 'unknown'.
- How do I generate a UUID v4?
- Use a cryptographically secure generator; many languages and online tools can generate UUID v4.
Fix it now
Try in validator (prefill this example)