{"record":{"id":"f2c9eca28103c66f","repo":"alibaba/spring-ai-alibaba","slug":"failed-to-add-start-node-to-queue","errorCode":null,"errorMessage":"Failed to add start node to queue: ","messagePattern":"Failed to add start node to queue: ","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"spring-ai-alibaba-graph-core/src/main/java/com/alibaba/cloud/ai/graph/internal/ParallelEdgeProcessor.java","lineNumber":282,"sourceCode":"\t\tif (startNodeIds.isEmpty()) {\n\t\t\treturn null;\n\t\t}\n\t\tif (startNodeIds.size() == 1) {\n\t\t\t// Single path, find its end\n\t\t\tString startNode = startNodeIds.iterator().next();\n\t\t\treturn findPathEnd(startNode);\n\t\t}\n\n\t\t// Use BFS to find the first common node reachable from all start nodes\n\t\t// Track which start nodes can reach each node\n\t\tMap<String, Set<String>> reachableFrom = new HashMap<>();\n\t\tDeque<String> queue = new ArrayDeque<>();\n\n\t\t// Initialize: mark each start node as reachable from itself\n\t\tfor (String startNode : startNodeIds) {\n\t\t\treachableFrom.put(startNode, new HashSet<>(Set.of(startNode)));\n\t\t\tif (!queue.offer(startNode)) {\n\t\t\t\tthrow new IllegalStateException(\"Failed to add start node to queue: \" + startNode);\n\t\t\t}\n\t\t}\n\n\t\twhile (!queue.isEmpty()) {\n\t\t\tString current = queue.poll();\n\t\t\tSet<String> sources = reachableFrom.get(current);\n\t\t\tif (sources == null) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Get next nodes from current node\n\t\t\tOptional<Edge> edgeOpt = processedData.edges().edgeBySourceId(current);\n\t\t\tif (edgeOpt.isEmpty()) {\n\t\t\t\t// No outgoing edge - this could be an end point\n\t\t\t\t// Check if all paths reach here\n\t\t\t\tif (sources.size() == startNodeIds.size()) {\n\t\t\t\t\treturn current;\n\t\t\t\t}","sourceCodeStart":264,"sourceCodeEnd":300,"githubUrl":"https://github.com/alibaba/spring-ai-alibaba/blob/f82da0b50f35744c13968191be2b1cd2452ef550/spring-ai-alibaba-graph-core/src/main/java/com/alibaba/cloud/ai/graph/internal/ParallelEdgeProcessor.java#L264-L300","documentation":"In findConvergenceNode, the BFS/fixpoint traversal that computes where parallel branches converge initializes a queue with the branch start nodes. ArrayDeque.offer() can only fail if the deque is capacity-bounded, so this IllegalStateException represents an unexpected internal invariant violation.","triggerScenarios":"queue.offer(startNode) returns false while seeding the ArrayDeque with branch start node ids — practically never happens with an unbounded ArrayDeque; it is a defensive check.","commonSituations":"Not reachable in normal use; if seen, it indicates a corrupted/modified library build or an exotic subclassed deque.","solutions":["Verify you are running an unmodified official release of spring-ai-alibaba-graph-core.","Report the issue with the start node ids and graph definition to the maintainers.","Rebuild the dependency from source to rule out a corrupted artifact."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { graph.compile(); } catch (IllegalStateException e) { if (e.getMessage().startsWith(\"Failed to add start node to queue\")) { /* rebuild dependency / report bug */ } }","preventionTips":["Use official release artifacts only","Pin dependency versions in your build","Reproduce with a minimal graph definition before reporting"],"tags":["internal","queue","convergence-analysis","defensive-check"],"backgroundTag":"internal-invariant-violation","analyzedSha":"f82da0b50f35744c13968191be2b1cd2452ef550","analyzedAt":"2026-09-09T15:32:42.421Z","contentChangedAt":"2026-09-09T15:32:42.421Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}