{"record":{"id":"d9192b86bbe9b232","repo":"apache/seatunnel","slug":"seatunnelapierrorcode-config-validation-failed-d9192b","errorCode":"SeaTunnelAPIErrorCode.CONFIG_VALIDATION_FAILED","errorMessage":"When sync_mode=update, file_format_type must be set.","messagePattern":"When sync_mode=update, file_format_type must be set\\.","errorType":"error_code","errorClass":"FileConnectorException","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":761,"sourceCode":"        if (targetHadoopFileSystemProxy != null && !shareTargetFileSystemProxy) {\n            closeFileSystemProxy(targetHadoopFileSystemProxy, \"target\");\n        }\n        if (hadoopFileSystemProxy != null) {\n            closeFileSystemProxy(hadoopFileSystemProxy, \"source\");\n        }\n    }\n\n    private void closeFileSystemProxy(HadoopFileSystemProxy proxy, String role) {\n        try {\n            proxy.close();\n        } catch (Exception e) {\n            log.warn(\"Failed to close {} file system proxy\", role, e);\n        }\n    }\n\n    private void validateUpdateSyncConfig(Config pluginConfig) {\n        if (!pluginConfig.hasPath(FileBaseSourceOptions.FILE_FORMAT_TYPE.key())) {\n            throw new FileConnectorException(\n                    SeaTunnelAPIErrorCode.CONFIG_VALIDATION_FAILED,\n                    \"When sync_mode=update, file_format_type must be set.\");\n        }\n        FileFormat fileFormat =\n                FileFormat.valueOf(\n                        pluginConfig\n                                .getString(FileBaseSourceOptions.FILE_FORMAT_TYPE.key())\n                                .toUpperCase());\n        if (fileFormat != FileFormat.BINARY) {\n            throw new FileConnectorException(\n                    SeaTunnelAPIErrorCode.CONFIG_VALIDATION_FAILED,\n                    \"sync_mode=update currently only supports file_format_type=binary.\");\n        }\n\n        if (!pluginConfig.hasPath(FileBaseSourceOptions.TARGET_PATH.key())\n                || StringUtils.isBlank(\n                        pluginConfig.getString(FileBaseSourceOptions.TARGET_PATH.key()))) {\n            throw new FileConnectorException(","sourceCodeStart":743,"sourceCodeEnd":779,"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#L743-L779","documentation":"validateUpdateSyncConfig enforces that when the file source runs in sync_mode=update (incremental synchronization), the plugin config must declare file_format_type. If the key is absent, a FileConnectorException with SeaTunnelAPIErrorCode.CONFIG_VALIDATION_FAILED is thrown during initialization.","triggerScenarios":"Configuring a file source with sync_mode = update but omitting file_format_type; validation runs in AbstractReadStrategy during reader setup.","commonSituations":"Users copy a batch-mode file-source config and only add sync_mode = update, forgetting the format key the update mode requires to interpret files.","solutions":["Add file_format_type = \"binary\" to the source config (the only format update mode supports).","If incremental sync is not needed, remove sync_mode = update to use normal batch semantics."],"exampleFix":"// before\nsync_mode = update\n// after\nsync_mode = update\nfile_format_type = binary","handlingStrategy":"validation","validationCode":"if (config.hasPath(\"sync_mode\") && \"update\".equals(config.getString(\"sync_mode\")) && !config.hasPath(\"file_format_type\")) {\n    throw new IllegalArgumentException(\"sync_mode=update requires file_format_type\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    submitJob(conf);\n} catch (FileConnectorException e) {\n    if (e.getSeaTunnelApiErrorCode() == SeaTunnelAPIErrorCode.CONFIG_VALIDATION_FAILED) {\n        // fix config and resubmit\n    }\n}","preventionTips":["Keep a canonical sync_mode=update config template that always includes file_format_type","Validate HOCON configs in CI before deployment"],"tags":["config","validation","file-source"],"backgroundTag":"missing-required-config-field","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"}