{"record":{"id":"ba20d42ca0edb777","repo":"apache/seatunnel","slug":"project-logstore-consumer-cursormode-f","errorCode":null,"errorMessage":"${project}:${logStore}:${consumer}:${cursorMode}:fail","messagePattern":"(.+?):(.+?):(.+?):(.+?):fail","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-sls/src/main/java/org/apache/seatunnel/connectors/seatunnel/sls/source/SlsSourceSplitEnumerator.java","lineNumber":263,"sourceCode":"                    if (checkpoints.size() == 1) {\n                        ConsumerGroupShardCheckPoint checkpoint = checkpoints.get(0);\n                        if (!checkpoint.getCheckPoint().equals(\"\")) {\n                            return checkpoint.getCheckPoint();\n                        }\n                    }\n                    return this.slsCleint\n                            .GetCursor(project, logStore, shardIdKey, autoCursorReset)\n                            .GetCursor();\n                } catch (LogException e) {\n                    if (e.GetErrorCode().equals(\"ConsumerGroupNotExist\")) {\n                        return this.slsCleint\n                                .GetCursor(project, logStore, shardIdKey, autoCursorReset)\n                                .GetCursor();\n                    }\n                    throw new RuntimeException(e);\n                }\n        }\n        throw new RuntimeException(\n                project + \":\" + logStore + \":\" + consumer + \":\" + cursorMode + \":\" + \"fail\");\n    }\n\n    private synchronized void assignSplit() {\n        Map<Integer, List<SlsSourceSplit>> readySplit = new HashMap<>(Common.COLLECTION_SIZE);\n        // init task from Parallelism\n        for (int taskID = 0; taskID < context.currentParallelism(); taskID++) {\n            readySplit.computeIfAbsent(taskID, id -> new ArrayList<>());\n        }\n        // Determine if split has been assigned\n        pendingSplit.forEach(\n                (key, value) -> {\n                    if (!assignedSplit.containsKey(key)) {\n                        readySplit\n                                .get(\n                                        getSplitOwner(\n                                                value.getShardId(), context.currentParallelism()))\n                                .add(value);","sourceCodeStart":245,"sourceCodeEnd":281,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-sls/src/main/java/org/apache/seatunnel/connectors/seatunnel/sls/source/SlsSourceSplitEnumerator.java#L245-L281","documentation":"initShardCursor tries each cursor initialization mode in turn when resolving a shard cursor from Aliyun Log Service. If every mode throws, the method falls through its switch and throws this RuntimeException listing project, logStore, consumer, and cursorMode to indicate cursor initialization failed entirely.","triggerScenarios":"Called from fetchPendingShardSplit; any exception inside the per-mode GetCursor calls (e.g. from .GetCursor(project, logStore, shardIdKey, autoCursorReset).GetCursor()) is caught and the loop/fallthrough ends at this throw, meaning no cursor mode succeeded.","commonSituations":"Invalid cursorMode option value; SLS API errors such as LogStoreNotExist, unauthorized access, or shard id out of range; network/auth failures talking to the SLS endpoint.","solutions":["Check the log for the wrapped original exception (`throw new RuntimeException(e)`) to see the underlying SLS error.","Verify cursorMode is one of the supported values for the SLS source config.","Confirm the project/logStore names are correct and the credentials have read permissions.","Ensure the shard id exists on the logstore (shard may have been merged/split)."],"exampleFix":"// before\nthrow new RuntimeException(\n    project + \":\" + logStore + \":\" + consumer + \":\" + cursorMode + \":\" + \"fail\");\n// after\nthrow new RuntimeException(\n    \"Failed to initialize shard cursor (project=\" + project + \", logStore=\" + logStore\n    + \", consumer=\" + consumer + \", cursorMode=\" + cursorMode + \")\", e);","handlingStrategy":"try-catch","validationCode":"try { client.GetCursor(project, logStore, shardId, mode).GetCursor(); } catch (LogException e) { /* pre-flight check of mode, shard existence, permissions */ }","typeGuard":null,"tryCatchPattern":"try { initShardCursor(...); } catch (RuntimeException e) { log.error(\"SLS cursor init failed for project={} logStore={} consumer={} cursorMode={}\", project, logStore, consumer, cursorMode, e.getCause()); throw e; }","preventionTips":["Validate cursorMode is a supported enum value in the config pre-flight","Confirm SLS credentials have log read permissions on the project/logStore","Check shard ids exist (shards may be merged/split) before job start"],"tags":["sls","cursor","config"],"backgroundTag":"invalid-config-value","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}