{"record":{"id":"8f13555976e230ed","repo":"conductor-oss/conductor","slug":"failed-to-get-all-task-defs","errorCode":null,"errorMessage":"Failed to get all task defs","messagePattern":"Failed to get all task defs","errorType":"exception","errorClass":"TransientException","httpStatus":null,"severity":"error","filePath":"cassandra-persistence/src/main/java/com/netflix/conductor/cassandra/dao/CassandraMetadataDAO.java","lineNumber":369,"sourceCode":"            throw new TransientException(errorMsg, e);\n        }\n    }\n\n    @SuppressWarnings(\"unchecked\")\n    private List<TaskDef> getAllTaskDefsFromDB() {\n        try {\n            ResultSet resultSet = session.execute(selectAllTaskDefsStatement.bind(TASK_DEFS_KEY));\n            List<Row> rows = resultSet.all();\n            if (rows.size() == 0) {\n                LOGGER.info(\"No task definitions were found.\");\n                return Collections.EMPTY_LIST;\n            }\n            return rows.stream().map(this::setDefaults).collect(Collectors.toList());\n        } catch (DriverException e) {\n            Monitors.error(CLASS_NAME, \"getAllTaskDefs\");\n            String errorMsg = \"Failed to get all task defs\";\n            LOGGER.error(errorMsg, e);\n            throw new TransientException(errorMsg, e);\n        }\n    }\n\n    private List<WorkflowDef> getAllWorkflowDefVersions(String name) {\n        try {\n            ResultSet resultSet =\n                    session.execute(selectAllWorkflowDefVersionsByNameStatement.bind(name));\n            recordCassandraDaoRequests(\"getAllWorkflowDefVersions\", \"n/a\", name);\n            List<Row> rows = resultSet.all();\n            if (rows.size() == 0) {\n                LOGGER.info(\"Not workflow definitions were found for : {}\", name);\n                return null;\n            }\n            return rows.stream()\n                    .map(\n                            row ->\n                                    readValue(\n                                            row.getString(WORKFLOW_DEFINITION_KEY),","sourceCodeStart":351,"sourceCodeEnd":387,"githubUrl":"https://github.com/conductor-oss/conductor/blob/cf7c3e4a8adfb158be778ab1ec525323c363cd3a/cassandra-persistence/src/main/java/com/netflix/conductor/cassandra/dao/CassandraMetadataDAO.java#L351-L387","documentation":"Thrown when a DriverException occurs during getAllTaskDefsFromDB, which scans the task_def table by the TASK_DEFS_KEY partition and maps each row through setDefaults. Wrapped as TransientException - the full task-def listing failed at the driver level.","triggerScenarios":"session.execute(selectAllTaskDefsStatement.bind(TASK_DEFS_KEY)) raises a DriverException, or iterating resultSet.all() hits a driver error during the scan.","commonSituations":"Listing all task definitions during cluster degradation; wide partition read timing out; consistency cannot be met; session closed mid-scan.","solutions":["Retry the listing call.","Verify Cassandra connectivity and the task_def table/keyspace.","Tune read timeouts if the task-def partition is large.","Check the underlying DriverException for the precise failure."],"exampleFix":"// before: one-shot listing\nList<TaskDef> all = metadataDAO.getAllTaskDefs();\n\n// after: retry transient failures\nList<TaskDef> all = RetryUtils.retryOn(TransientException.class, 3,\n        Duration.ofMillis(200), metadataDAO::getAllTaskDefs);","handlingStrategy":"retry","validationCode":"// Pre-flight: check session health before listing all task defs\nif (cassandraSession.isClosed()) {\n    throw new IllegalStateException(\"Cassandra session is closed; cannot list task defs\");\n}","typeGuard":null,"tryCatchPattern":"// Retry the task-def listing on transient failure\ntry {\n    return metadataDAO.getAllTaskDefs();\n} catch (TransientException e) {\n    return backoffAndRetry(metadataDAO::getAllTaskDefs, 3);\n}","preventionTips":["Retry getAllTaskDefs on TransientException.","Tune read timeouts if the TASK_DEFS_KEY partition is wide.","Ensure the task_def table is initialized.","Cache the listing short-term under load."],"tags":["cassandra","task-definition","transient","network","driver","list"],"backgroundTag":null,"analyzedSha":"cf7c3e4a8adfb158be778ab1ec525323c363cd3a","analyzedAt":"2026-08-14T03:33:19.897Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}