{"record":{"id":"1b01cb1cb50fca46","repo":"conductor-oss/conductor","slug":"error-retrieving-all-workflow-defs-latest-versions","errorCode":null,"errorMessage":"Error retrieving all workflow defs latest versions","messagePattern":"Error retrieving all workflow defs latest versions","errorType":"exception","errorClass":"TransientException","httpStatus":null,"severity":"error","filePath":"cassandra-persistence/src/main/java/com/netflix/conductor/cassandra/dao/CassandraMetadataDAO.java","lineNumber":338,"sourceCode":"                    continue;\n                }\n                if (allWorkflowDefs.get(def.getName()) == null) {\n                    allWorkflowDefs.put(\n                            def.getName(),\n                            new PriorityQueue<>(\n                                    (WorkflowDef w1, WorkflowDef w2) ->\n                                            Integer.compare(w2.getVersion(), w1.getVersion())));\n                }\n                allWorkflowDefs.get(def.getName()).add(def);\n            }\n            return allWorkflowDefs.values().stream()\n                    .map(PriorityQueue::poll)\n                    .collect(Collectors.toList());\n        } catch (DriverException e) {\n            Monitors.error(CLASS_NAME, \"getAllWorkflowDefsLatestVersions\");\n            String errorMsg = \"Error retrieving all workflow defs latest versions\";\n            LOGGER.error(errorMsg, e);\n            throw new TransientException(errorMsg, e);\n        }\n    }\n\n    private TaskDef getTaskDefFromDB(String name) {\n        try {\n            ResultSet resultSet = session.execute(selectTaskDefStatement.bind(name));\n            recordCassandraDaoRequests(\"getTaskDef\", name, null);\n            return Optional.ofNullable(resultSet.one()).map(this::setDefaults).orElse(null);\n        } catch (DriverException e) {\n            Monitors.error(CLASS_NAME, \"getTaskDef\");\n            String errorMsg = String.format(\"Failed to get task def: %s\", name);\n            LOGGER.error(errorMsg, e);\n            throw new TransientException(errorMsg, e);\n        }\n    }\n\n    @SuppressWarnings(\"unchecked\")\n    private List<TaskDef> getAllTaskDefsFromDB() {","sourceCodeStart":320,"sourceCodeEnd":356,"githubUrl":"https://github.com/conductor-oss/conductor/blob/cf7c3e4a8adfb158be778ab1ec525323c363cd3a/cassandra-persistence/src/main/java/com/netflix/conductor/cassandra/dao/CassandraMetadataDAO.java#L320-L356","documentation":"Thrown when a DriverException occurs during getAllWorkflowDefsLatestVersions, which reads indexed definitions and reduces them to the latest version per name using a PriorityQueue. Wrapped as TransientException - an infrastructure-level read failure interrupted the reduction.","triggerScenarios":"The SELECT (selectAllWorkflowDefsLatestVersionsStatement) or the in-memory version reduction's underlying reads raise a DriverException while computing latest versions.","commonSituations":"Computing latest versions during a cluster slowdown; read timeout on a wide index; consistency cannot be met by live replicas.","solutions":["Retry the call - this is a TransientException.","Confirm Cassandra connectivity and read consistency configuration.","Ensure the workflow_def index tables exist and are populated.","Check driver logs for the specific DriverException subtype."],"exampleFix":"// before: single attempt\nList<WorkflowDef> latest = metadataDAO.getAllWorkflowDefsLatestVersions();\n\n// after: retry transient failures\nList<WorkflowDef> latest = RetryUtils.retryOn(TransientException.class, 3,\n        Duration.ofMillis(200),\n        metadataDAO::getAllWorkflowDefsLatestVersions);","handlingStrategy":"retry","validationCode":"// Pre-flight: confirm session is open before computing latest versions\nif (cassandraSession.isClosed()) {\n    throw new IllegalStateException(\"Cassandra session is closed; cannot list latest workflow defs\");\n}","typeGuard":null,"tryCatchPattern":"// Retry the latest-versions computation on transient failure\ntry {\n    return metadataDAO.getAllWorkflowDefsLatestVersions();\n} catch (TransientException e) {\n    return backoffAndRetry(metadataDAO::getAllWorkflowDefsLatestVersions, 3);\n}","preventionTips":["Retry getAllWorkflowDefsLatestVersions on TransientException.","Ensure index tables are populated and consistent.","Tune read timeouts for the reduction over many versions.","Cache latest-version results to reduce repeated scans."],"tags":["cassandra","workflow-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"}