{"record":{"id":"cc305cbbe8f8387f","repo":"apache/seatunnel","slug":"circular-condition-chain-detected-s-already-ex","errorCode":null,"errorMessage":"Circular condition chain detected: '%s' already exists in the chain","messagePattern":"Circular condition chain detected: '(.+?)' already exists in the chain","errorType":"validation","errorClass":"java.lang.IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-api/src/main/java/org/apache/seatunnel/api/configuration/util/Condition.java","lineNumber":117,"sourceCode":"    }\n\n    public Condition<T> and(Condition<?> next) {\n        addCondition(true, next);\n        return this;\n    }\n\n    public Condition<T> or(Condition<?> next) {\n        addCondition(false, next);\n        return this;\n    }\n\n    private void addCondition(boolean and, Condition<?> next) {\n        Condition<?> cur = next;\n        while (cur != null) {\n            Condition<?> self = this;\n            while (self != null) {\n                if (self == cur) {\n                    throw new IllegalArgumentException(\n                            \"Circular condition chain detected: '\"\n                                    + cur.option.key()\n                                    + \"' already exists in the chain\");\n                }\n                self = self.next;\n            }\n            cur = cur.next;\n        }\n        Condition<?> tail = getTailCondition();\n        tail.and = and;\n        tail.next = next;\n    }\n\n    protected int getCount() {\n        int i = 1;\n        Condition<?> cur = this;\n        while (cur.hasNext()) {\n            i++;","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-api/src/main/java/org/apache/seatunnel/api/configuration/util/Condition.java#L99-L135","documentation":"FileDiscoveryScanner.scan stats the root path via session.getFileStatus(root) to begin source listing. If that filesystem operation throws IOException, it is rethrown wrapped as \"Failed during source_listing root_stat for protocol=..., path=...\" with the path masked (sensitive parts hidden), preserving the cause. This means the connector could not even inspect the root directory of the source listing.","triggerScenarios":"Calling scan where session.getFileStatus(root) throws IOException — the root path does not exist on the filesystem (HDFS/S3/local), credentials are missing/invalid, NameNode/endpoint is unreachable, or permission is denied on the root.","commonSituations":"Typo in the configured path or bucket; S3/HDFS credentials not present on the worker; cluster/network partition making the storage endpoint unreachable; path deleted between job configuration and execution.","solutions":["Verify the root path exists and is accessible: run a ls/stat against it with the same credentials the SeaTunnel worker uses.","Check the wrapped cause (getCause) for the real error — FileNotFoundException vs permission vs connectivity — and fix accordingly.","Validate storage credentials/endpoint configuration (e.g. fs.defaultFS, S3 access keys) and network reachability from worker nodes.","Add a pre-flight existence check for the root path before submitting the job."],"exampleFix":"// before\npath = \"hdfs://namenode:8020/data/source\"   // dir does not exist\n// after\n# hdfs dfs -mkdir -p /data/source  (or correct the path)\npath = \"hdfs://namenode:8020/data/source\"","handlingStrategy":"try-catch","validationCode":"java\norg.apache.hadoop.fs.Path root = new org.apache.hadoop.fs.Path(configuredPath);\nFileSystem fs = root.getFileSystem(conf);\nif (!fs.exists(root)) {\n    throw new IllegalArgumentException(\"Source root path does not exist: \" + root);\n}\nfs.getFileStatus(root); // fail fast on permission/credentials issues","typeGuard":null,"tryCatchPattern":"java\ntry {\n    scanner.scan(session, root, filter, consumer);\n} catch (IOException e) {\n    if (e.getMessage().startsWith(\"Failed during source_listing root_stat\")) {\n        LOG.error(\"Cannot stat source root (check path exists, credentials, connectivity): \"\n            + e.getMessage(), e.getCause());\n    }\n}","preventionTips":["Pre-flight check that the root path exists with the worker's credentials","Validate fs.defaultFS / S3 endpoint and credential configuration before job submission","Inspect e.getCause() to distinguish not-found vs permission vs network failures","Ensure the path is not deleted between job config and execution"],"tags":["filesystem","io","file-discovery","hadoop"],"backgroundTag":"file-read-failed","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}