{"record":{"id":"5c7a93f719a02770","repo":"conductor-oss/conductor","slug":"message-uuidstring","errorCode":null,"errorMessage":"message + \" \" + uuidString","messagePattern":"message \\+ \" \" \\+ uuidString","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":400,"severity":"error","filePath":"cassandra-persistence/src/main/java/com/netflix/conductor/cassandra/dao/CassandraBaseDAO.java","lineNumber":130,"sourceCode":"    protected final Session session;\n    protected final CassandraProperties properties;\n\n    private boolean initialized = false;\n\n    public CassandraBaseDAO(\n            Session session, ObjectMapper objectMapper, CassandraProperties properties) {\n        this.session = session;\n        this.objectMapper = objectMapper;\n        this.properties = properties;\n\n        init();\n    }\n\n    protected static UUID toUUID(String uuidString, String message) {\n        try {\n            return UUID.fromString(uuidString);\n        } catch (IllegalArgumentException iae) {\n            throw new IllegalArgumentException(message + \" \" + uuidString, iae);\n        }\n    }\n\n    private void init() {\n        try {\n            if (!initialized) {\n                session.execute(getCreateKeyspaceStatement());\n                session.execute(getCreateWorkflowsTableStatement());\n                session.execute(getCreateTaskLookupTableStatement());\n                session.execute(getCreateTaskDefLimitTableStatement());\n                session.execute(getCreateTaskRateLimitTableStatement());\n                session.execute(getCreateWorkflowDefsTableStatement());\n                session.execute(getCreateWorkflowDefsIndexTableStatement());\n                session.execute(getCreateTaskDefsTableStatement());\n                session.execute(getCreateEventHandlersTableStatement());\n                session.execute(getCreateEventExecutionsTableStatement());\n                session.execute(getCreateFileMetadataTableStatement());\n                session.execute(getCreateFileMetadataByWorkflowTableStatement());","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/conductor-oss/conductor/blob/cf7c3e4a8adfb158be778ab1ec525323c363cd3a/cassandra-persistence/src/main/java/com/netflix/conductor/cassandra/dao/CassandraBaseDAO.java#L112-L148","documentation":"Thrown by CassandraBaseDAO.toUUID when UUID.fromString rejects the supplied uuidString. It prepends a caller-provided context message to the bad value and rethrows as IllegalArgumentException (unchecked). It is a guard helper used across the Cassandra DAOs to convert workflow/task ID strings to java.util.UUID.","triggerScenarios":"Calling toUUID(uuidString, message) with a string that is not a valid RFC-4122 UUID (wrong length, non-hex characters, missing dashes). Internally triggered when a workflowId or taskId read from Cassandra or supplied by a caller is not UUID-shaped.","commonSituations":"A workflow or task ID generated by a non-UUID ID generator (e.g. string IDs used by the Redis or in-memory DAO) being passed to the Cassandra DAO path. Corrupted/stale data in Cassandra with malformed IDs. A client sending a custom non-UUID correlation ID as the workflow ID.","solutions":["Ensure all workflow and task IDs created against a Cassandra-backed Conductor are valid UUIDs (the default ID generator produces them).","If migrating data from another backend, normalize legacy IDs to UUIDs first or use a compatible ID generator.","Catch IllegalArgumentException at the API boundary and return a 400 with the bad ID rather than a 500.","Audit the offending row/value logged in the message to find the source of the malformed ID."],"exampleFix":"// before\nreturn UUID.fromString(uuidString);\n\n// after (existing helper; caller-side guard)\nprivate static final java.util.regex.Pattern UUID_RE =\n    java.util.regex.Pattern.compile(\"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$\");\nif (!UUID_RE.matcher(uuidString).matches()) {\n    throw new IllegalArgumentException(\"Not a UUID: \" + uuidString);\n}","handlingStrategy":"type-guard","validationCode":"private static final java.util.regex.Pattern UUID_RE =\n    java.util.regex.Pattern.compile(\"^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$\");\nstatic boolean isUuid(String s) { return s != null && UUID_RE.matcher(s).matches(); }","typeGuard":"static boolean isUuid(String s) {\n    if (s == null) return false;\n    try { java.util.UUID.fromString(s); return true; }\n    catch (IllegalArgumentException e) { return false; }\n}","tryCatchPattern":"try {\n    return toUUID(id, \"workflow id\");\n} catch (IllegalArgumentException e) {\n    throw new ResponseStatusException(HttpStatus.BAD_REQUEST, \"invalid id: \" + id, e);\n}","preventionTips":["Use the default UUID-based ID generator when running on Cassandra.","Validate IDs at API boundaries and return 400, not 500, for malformed IDs.","Normalize legacy string IDs during any data migration to Cassandra."],"tags":["cassandra","uuid","validation","persistence"],"backgroundTag":null,"analyzedSha":"cf7c3e4a8adfb158be778ab1ec525323c363cd3a","analyzedAt":"2026-08-14T03:33:19.897Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}