{"record":{"id":"78de8569697d43a0","repo":"apache/seatunnel","slug":"option-not-be-null","errorCode":null,"errorMessage":"Option not be null.","messagePattern":"Option not be null\\.","errorType":"exception","errorClass":"java.lang.NullPointerException","httpStatus":null,"severity":"error","filePath":"seatunnel-api/src/main/java/org/apache/seatunnel/api/configuration/ReadonlyConfig.java","lineNumber":105,"sourceCode":"        return result;\n    }\n\n    public void toMap(Map<String, String> result) {\n        if (confData.isEmpty()) {\n            return;\n        }\n        for (Map.Entry<String, Object> entry : confData.entrySet()) {\n            result.put(entry.getKey(), convertToJsonString(entry.getValue()));\n        }\n    }\n\n    public Map<String, Object> getSourceMap() {\n        return confData;\n    }\n\n    public <T> Optional<T> getOptional(Option<T> option) {\n        if (option == null) {\n            throw new NullPointerException(\"Option not be null.\");\n        }\n        Object value = getValue(option.key());\n        if (value == null) {\n            for (String fallbackKey : option.getFallbackKeys()) {\n                value = getValue(fallbackKey);\n                if (value != null) {\n                    log.warn(\n                            \"Please use the new key '{}' instead of the deprecated key '{}'.\",\n                            option.key(),\n                            fallbackKey);\n                    break;\n                }\n            }\n        }\n        if (value == null) {\n            return Optional.empty();\n        }\n        return Optional.of(convertValue(value, option));","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-api/src/main/java/org/apache/seatunnel/api/configuration/ReadonlyConfig.java#L87-L123","documentation":"While reading with POI, ExcelReadStrategy computes startRow = firstRowNum + skipHeaderNumber. If that start row is beyond the sheet's lastRowNum, there are no data rows left to read, and it throws FileConnectorException with UNSUPPORTED_OPERATION. It protects against a skip-header-row-number that exceeds the sheet's row count.","triggerScenarios":"readByPoi is called on a sheet whose (lastRowNum - firstRowNum + 1) is less than or equal to the configured skip_header_row_number, e.g. skipping 5 header rows on a sheet with only 3 rows, or on an effectively empty sheet.","commonSituations":"A shared skip_header_row_number value reused across files where some sheets are nearly empty; miscounting header rows; the pipeline picked up a truncated or header-only Excel file.","solutions":["Lower skip_header_row_number so it is strictly less than the number of rows in every matched sheet.","Remove the nearly empty file from the source path or move it out of the matched directory.","Pre-check each Excel file's row count before the job and validate it against the configured skip value."],"exampleFix":"// before\nskip_header_row_number = 5   // sheet only has 3 rows\n// after\nskip_header_row_number = 1","handlingStrategy":"validation","validationCode":"java\n// Before the job: ensure sheet has more rows than skip count\nint lastRowNum = sheet.getLastRowNum();\nif (skipHeaderRowNumber >= lastRowNum + 1) {\n    throw new IllegalArgumentException(\"skip_header_row_number=\" + skipHeaderRowNumber\n        + \" exceeds rows in sheet (lastRowNum=\" + lastRowNum + \")\");\n}","typeGuard":null,"tryCatchPattern":"java\ntry {\n    reader.readProcess(split);\n} catch (FileConnectorException e) {\n    if (e.getMessage().contains(\"Skip the number of rows exceeds\")) {\n        LOG.error(\"skip_header_row_number too large for file {} — lower it or exclude the file\", split.getPath(), e);\n    }\n}","preventionTips":["Verify each matched sheet's row count when reusing skip_header_row_number across files","Exclude empty or header-only Excel files from the source path","Remember the skip value applies to every sheet/file the job reads"],"tags":["excel","configuration","rows","poi"],"backgroundTag":"value-out-of-range","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"}