{"record":{"id":"5a2eee3ea208a8c7","repo":"apache/seatunnel","slug":"get-file-status-for-s-failed-cause-s-s","errorCode":null,"errorMessage":"Get file status for [%s] failed, cause=%s: %s","messagePattern":"Get file status for \\[(.+?)\\] failed, cause=(.+?): (.+?)","errorType":"error_code","errorClass":"SeaTunnelRuntimeException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/source/split/AccordingToSplitSizeSplitStrategy.java","lineNumber":130,"sourceCode":"                if (actualEnd <= currentStart) {\n                    actualEnd = tentativeEnd;\n                }\n                splits.add(\n                        new FileSourceSplit(\n                                tableId, normalizedPath, currentStart, actualEnd - currentStart));\n                currentStart = actualEnd;\n            }\n            return splits;\n        } catch (IOException e) {\n            throw mapToRuntimeException(normalizedPath, \"Split file\", e);\n        }\n    }\n\n    private long safeGetFileSize(String filePath) {\n        try {\n            return hadoopFileSystemProxy.getFileStatus(filePath).getLen();\n        } catch (IOException e) {\n            throw mapToRuntimeException(filePath, \"Get file status\", e);\n        }\n    }\n\n    private static SeaTunnelRuntimeException mapToRuntimeException(\n            String filePath, String operation, IOException e) {\n        IOException unwrapped = unwrapRemoteException(e);\n        FileConnectorErrorCode errorCode = mapIOExceptionToErrorCode(unwrapped);\n        String message =\n                String.format(\n                        \"%s for [%s] failed, cause=%s: %s\",\n                        operation,\n                        filePath,\n                        unwrapped.getClass().getSimpleName(),\n                        unwrapped.getMessage());\n        return new SeaTunnelRuntimeException(errorCode, message, unwrapped);\n    }\n\n    private static FileConnectorErrorCode mapIOExceptionToErrorCode(IOException e) {","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/source/split/AccordingToSplitSizeSplitStrategy.java#L112-L148","documentation":"safeGetFileSize queries the Hadoop FileSystem for a file's length so split boundaries can be computed. If getFileStatus throws IOException (missing file, permissions, storage/network errors), it is converted into 'Get file status for [path] failed, cause=...' via mapToRuntimeException.","triggerScenarios":"hadopFileSystemProxy.getFileStatus(filePath) throwing IOException — typically because the path does not exist, the caller lacks read permission, the bucket/container is wrong, or the remote filesystem is unreachable.","commonSituations":"Typo in path or bucket, missing GCS/S3 credentials on worker nodes, file deleted between source enumeration and split calculation, or HDFS namenode unreachable.","solutions":["Confirm the exact path exists and is accessible from the SeaTunnel worker nodes","Check filesystem credentials/config (core-site.xml, service account, tokens) on workers","Validate the path/bucket spelling and that no upstream job deletes it concurrently","Inspect the wrapped cause in the message for the true root cause (FileNotFoundException vs permission vs timeout)"],"exampleFix":"// before\n\"path\" = \"gs://my-buket/data/file.csv\"  // typo'd bucket -> getFileStatus IOException\n// after\n\"path\" = \"gs://my-bucket/data/file.csv\"","handlingStrategy":"try-catch","validationCode":"hadoopFileSystemProxy.getFileStatus(path); // call once in a pre-check; catch IOException and fail fast with a clear message","typeGuard":"static boolean isAccessible(HadoopFileSystemProxy fs, String p) {\n    try { fs.getFileStatus(p); return true; } catch (IOException e) { return false; }\n}","tryCatchPattern":"try {\n    long size = safeGetFileSize(filePath);\n} catch (SeaTunnelRuntimeException e) {\n    // inspect cause: FileNotFoundException -> fix path; auth -> fix credentials\n    throw e;\n}","preventionTips":["Validate every configured path exists before submitting the job","Keep filesystem credentials/config (core-site.xml, service accounts) consistent on all workers","Avoid deleting/moving files while a job is running"],"tags":["io","file-status","hadoop"],"backgroundTag":"file-not-found","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"}