{"record":{"id":"b958b5f18434b575","repo":"conductor-oss/conductor","slug":"error-creating-updating-task-definition-s","errorCode":null,"errorMessage":"Error creating/updating task definition: %s","messagePattern":"Error creating/updating task definition: (.+?)","errorType":"exception","errorClass":"TransientException","httpStatus":null,"severity":"error","filePath":"cassandra-persistence/src/main/java/com/netflix/conductor/cassandra/dao/CassandraMetadataDAO.java","lineNumber":410,"sourceCode":"            String errorMsg = String.format(\"Failed to get workflows defs for : %s\", name);\n            LOGGER.error(errorMsg, e);\n            throw new TransientException(errorMsg, e);\n        }\n    }\n\n    private TaskDef insertOrUpdateTaskDef(TaskDef taskDef) {\n        try {\n            String taskDefinition = toJson(taskDef);\n            session.execute(insertTaskDefStatement.bind(taskDef.getName(), taskDefinition));\n            recordCassandraDaoRequests(\"storeTaskDef\");\n            recordCassandraDaoPayloadSize(\n                    \"storeTaskDef\", taskDefinition.length(), taskDef.getName(), \"n/a\");\n        } catch (DriverException e) {\n            Monitors.error(CLASS_NAME, \"insertOrUpdateTaskDef\");\n            String errorMsg =\n                    String.format(\"Error creating/updating task definition: %s\", taskDef.getName());\n            LOGGER.error(errorMsg, e);\n            throw new TransientException(errorMsg, e);\n        }\n        return taskDef;\n    }\n\n    @VisibleForTesting\n    String getWorkflowDefIndexValue(String name, int version) {\n        return name + INDEX_DELIMITER + version;\n    }\n\n    @VisibleForTesting\n    ImmutablePair<String, Integer> getWorkflowNameAndVersion(String nameVersionStr) {\n        int lastIndexOfDelimiter = nameVersionStr.lastIndexOf(INDEX_DELIMITER);\n\n        if (lastIndexOfDelimiter == -1) {\n            throw new IllegalStateException(\n                    nameVersionStr\n                            + \" is not in the 'workflowName\"\n                            + INDEX_DELIMITER","sourceCodeStart":392,"sourceCodeEnd":428,"githubUrl":"https://github.com/conductor-oss/conductor/blob/cf7c3e4a8adfb158be778ab1ec525323c363cd3a/cassandra-persistence/src/main/java/com/netflix/conductor/cassandra/dao/CassandraMetadataDAO.java#L392-L428","documentation":"Thrown when a DriverException occurs in insertOrUpdateTaskDef while serializing a TaskDef to JSON and writing it to the task_def table. Wrapped as TransientException - the store could not complete due to an infrastructure-level driver failure.","triggerScenarios":"session.execute(insertTaskDefStatement.bind(name, json)) raises a DriverException (write timeout, unavailable, closed session) during task-definition create/update.","commonSituations":"Registering/updating a task def during a node loss; keyspace/table missing after partial deploy; connection pool exhausted; large payload timing out.","solutions":["Retry the store operation - TransientException is retryable.","Verify the Cassandra cluster and task_def table are present.","Review conductor.cassandra.writeConsistencyLevel and timeouts.","Check the wrapped DriverException to distinguish timeout vs unavailable."],"exampleFix":"// before: single write\nmetadataDAO.createTaskDef(taskDef);\n\n// after: retry transient write failures\nRetryUtils.retryOn(TransientException.class, 3, Duration.ofMillis(200),\n    () -> metadataDAO.createTaskDef(taskDef));","handlingStrategy":"retry","validationCode":"// Pre-flight: verify session before writing a task def\nif (cassandraSession.isClosed()) {\n    throw new IllegalStateException(\"Cassandra session is closed; cannot store task def\");\n}","typeGuard":null,"tryCatchPattern":"// Retry transient task-def store failures\ntry {\n    metadataDAO.createTaskDef(taskDef);\n} catch (TransientException e) {\n    backoffAndRetry(() -> metadataDAO.createTaskDef(taskDef), 3);\n}","preventionTips":["Wrap task-def stores in retry-with-backoff for TransientException.","Ensure the task_def table exists before startup.","Size write timeouts for the largest serialized TaskDef payload.","Alert on recurring TransientException to catch cluster degradation."],"tags":["cassandra","task-definition","transient","network","driver","write"],"backgroundTag":null,"analyzedSha":"cf7c3e4a8adfb158be778ab1ec525323c363cd3a","analyzedAt":"2026-08-14T03:33:19.897Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}