{"record":{"id":"582f33548bce2817","repo":"apache/seatunnel","slug":"excel-file-must-have-a-gz-extension-file-s","errorCode":null,"errorMessage":"Excel file must have a .gz extension. File: %s","messagePattern":"Excel file must have a \\.gz extension\\. File: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/source/reader/AbstractReadStrategy.java","lineNumber":518,"sourceCode":"                                    partitionsMap,\n                                    entry.getName());\n                        }\n                    }\n                }\n                break;\n            case GZ:\n                try (GzipCompressorInputStream gzipIn =\n                        new GzipCompressorInputStream(hadoopFileSystemProxy.getInputStream(path))) {\n                    GzipParameters parameters = gzipIn.getMetaData();\n                    String fileName = parameters.getFilename();\n                    if (fileName == null) {\n                        // remove file suffix\n                        // eg: excel need full compressed name\n                        if (fileFormat == FileFormat.EXCEL) {\n                            if (path.endsWith(\".gz\")) {\n                                fileName = path.substring(0, path.length() - 3);\n                            } else {\n                                throw new IllegalArgumentException(\n                                        \"Excel file must have a .gz extension. File: \" + path);\n                            }\n                        } else {\n                            fileName = path;\n                        }\n                    }\n                    readProcess(\n                            split,\n                            output,\n                            copyInputStream(gzipIn, effectiveMaxBytes),\n                            partitionsMap,\n                            fileName);\n                }\n                break;\n            case NONE:\n                readProcess(\n                        split,\n                        output,","sourceCodeStart":500,"sourceCodeEnd":536,"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/reader/AbstractReadStrategy.java#L500-L536","documentation":"In AbstractReadStrategy.resolveArchiveCompressedInputStream, EXCEL files inside a .gz-compressed archive must keep a .gz extension so the reader can recover the full compressed file name (the .gz suffix is stripped to get the Excel file name). If an Excel path lacks the .gz extension, IllegalArgumentException 'Excel file must have a .gz extension' is thrown (AbstractReadStrategy.java:518).","triggerScenarios":"Reading an EXCEL-format source whose compressed/archive entry path does not end with '.gz' — e.g. the file was gzipped but saved as .xlsx.gz.txt, renamed to drop .gz, or compressed with a different extension.","commonSituations":"Renaming gzip files during upload; upload pipelines stripping double extensions; users zipping Excel files as .zip/.bz2 and expecting Excel+gzip special-casing to apply; automation that munges file names.","solutions":["Rename the file so it ends with .gz (e.g. report.xlsx.gz) and re-run.","If the file is not actually gzipped, disable compress_codec or use the matching compress option.","For non-gzip archives, use a format other than EXCEL or a supported archive layout.","Verify with `file report.xlsx.gz` that the artifact is really gzip data."],"exampleFix":"// before\n# file: report.xlsx (gzipped, renamed)\n// after\nmv report.xlsx report.xlsx.gz","handlingStrategy":"validation","validationCode":"if (\"excel\".equals(fileFormatType) && compressCodecIsGzip && !entryPath.endsWith(\".gz\")) {\n    throw new IllegalArgumentException(\"Excel + gzip requires .gz extension: \" + entryPath);\n}","typeGuard":null,"tryCatchPattern":"try {\n    // read archive\n} catch (IllegalArgumentException e) {\n    if (e.getMessage() != null && e.getMessage().contains(\".gz extension\")) {\n        throw new IllegalStateException(\"Rename the Excel archive to end with .gz\", e);\n    }\n    throw e;\n}","preventionTips":["Never rename gzip files on upload; preserve the .gz suffix.","Verify gzip payloads with `file` before ingestion.","For non-gzip compression, don't rely on the Excel+gzip path."],"tags":["file","compression","excel"],"backgroundTag":"invalid-argument-value","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}