{"record":{"id":"0a4da15b68d8b0d6","repo":"apache/seatunnel","slug":"input-id-must-be-non-empty","errorCode":null,"errorMessage":"input.id must be non-empty.","messagePattern":"input\\.id must be non-empty\\.","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-edge-agent/seatunnel-edge-agent-connector/src/main/java/org/apache/seatunnel/edge/agent/connector/config/FileCollectConfig.java","lineNumber":57,"sourceCode":"    private final List<String> paths;\n    private final String encoding;\n    private final boolean readFromBeginning;\n    private final String multilinePattern;\n    private final String multilineMatch;\n    private final boolean multilineNegate;\n    private final int multilineMaxLines;\n    private final long multilineFlushIdleTimeoutMs;\n    private final String outputType;\n    private final Charset charset;\n    private final String onError;\n    private final long globScanIntervalMs;\n    private final long closeInactiveMs;\n\n    public FileCollectConfig(ReadonlyConfig config) {\n        Objects.requireNonNull(config, \"config\");\n        this.id = config.get(FileCollectOptions.ID);\n        if (this.id == null || this.id.trim().isEmpty()) {\n            throw new IllegalArgumentException(\"input.id must be non-empty.\");\n        }\n        List<String> pathList = config.get(FileCollectOptions.PATHS);\n        if (pathList == null || pathList.isEmpty()) {\n            throw new IllegalArgumentException(\n                    \"input.paths must not be empty (input id=\" + this.id + \").\");\n        }\n        for (String path : pathList) {\n            if (path == null || path.trim().isEmpty()) {\n                throw new IllegalArgumentException(\n                        \"input.paths must not contain blank entries (input id=\" + this.id + \").\");\n            }\n        }\n        this.paths = Collections.unmodifiableList(new ArrayList<>(pathList));\n        this.encoding = config.get(FileCollectOptions.ENCODING);\n        this.charset = resolveCharset(this.encoding, this.id);\n        this.readFromBeginning = config.get(FileCollectOptions.READ_FROM_BEGINNING);\n        this.multilinePattern =\n                config.getOptional(FileCollectOptions.MULTILINE_PATTERN).orElse(null);","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-edge-agent/seatunnel-edge-agent-connector/src/main/java/org/apache/seatunnel/edge/agent/connector/config/FileCollectConfig.java#L39-L75","documentation":"FileCollectConfig is the parsed configuration for a file-collect input in the edge agent connector. Its constructor requires `input.id` (FileCollectOptions.ID) to be present and non-blank, throwing IllegalArgumentException otherwise. The id is used to identify the input in logs, metrics, and error context, so it cannot be defaulted.","triggerScenarios":"Constructing FileCollectConfig from a ReadonlyConfig that lacks the `input.id` option, or has it set to an empty/whitespace-only string; typically when building the agent's connector input configs from user-supplied agent configuration.","commonSituations":"An input entry in the edge agent config missing the id field, generated configs where id was omitted, or ids defined as empty strings by template rendering with unset variables.","solutions":["Add a unique non-empty `input.id` to the file-collect input config","Ensure template/variable substitution didn't render the id as empty","Check the config keys are nested correctly so `input.id` is actually parsed","Validate agent config at startup and fail fast on missing ids"],"exampleFix":"// before\ninput {\n  paths = [\"/var/log/app/*.log\"]\n}\n// after\ninput {\n  id = \"app-logs\"\n  paths = [\"/var/log/app/*.log\"]\n}","handlingStrategy":"validation","validationCode":"String id = config.get(FileCollectOptions.ID);\nif (id == null || id.trim().isEmpty()) {\n    throw new IllegalArgumentException(\"input.id must be set before building FileCollectConfig\");\n}","typeGuard":"boolean hasValidId(ReadonlyConfig c) {\n    String id = c.get(FileCollectOptions.ID);\n    return id != null && !id.trim().isEmpty();\n}","tryCatchPattern":"try {\n    FileCollectConfig cfg = new FileCollectConfig(config);\n} catch (IllegalArgumentException e) {\n    log.error(\"Invalid input config: {}\", e.getMessage());\n}","preventionTips":["Require input.id in agent config schema validation","Fail fast at config load time","Use deterministic ids per input in templates","Add unit tests for config parsing with missing fields"],"tags":["config-validation","edge-agent","file-collect"],"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-23T08:17:48.524Z"}