{"record":{"id":"256896e5887fcfa6","repo":"apache/seatunnel","slug":"input-must-be-defined","errorCode":null,"errorMessage":"input must be defined.","messagePattern":"input must be defined\\.","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"critical","filePath":"seatunnel-edge-agent/seatunnel-edge-agent-starter/src/main/java/org/apache/seatunnel/edge/agent/starter/parse/EdgeAgentConfigLoader.java","lineNumber":56,"sourceCode":"     *\n     * <p>Entry point for {@code EdgeAgentRuntime.start()}. Resolves default input type {@code file}\n     * and output type {@code console} when omitted.\n     *\n     * @param agentYamlPath path to the agent YAML file\n     * @return immutable resolved snapshot for assembly and runtime\n     * @throws Exception if the file is missing, YAML is invalid, or validation fails\n     */\n    public static EdgeAgentResolvedConfig load(Path agentYamlPath) throws Exception {\n        return load(agentYamlPath, Paths.get(\"\").toAbsolutePath());\n    }\n\n    public static EdgeAgentResolvedConfig load(Path agentYamlPath, Path installRoot)\n            throws Exception {\n        Path configPath = Objects.requireNonNull(agentYamlPath, \"configPath\");\n        Path root = Objects.requireNonNull(installRoot, \"installRoot\").toAbsolutePath().normalize();\n        AgentYamlConfig yaml = AgentYamlLoader.load(configPath);\n        if (yaml.getInput() == null) {\n            throw new IllegalArgumentException(\"input must be defined.\");\n        }\n\n        EdgeAgentIdResolver.resolve(yaml, root);\n\n        ReadonlyConfig agentConfig = AgentConfigBridge.agent(yaml.getAgent());\n        ReadonlyConfig queueConfig = AgentConfigBridge.queue(yaml.getQueue());\n        ReadonlyConfig retryConfig = AgentConfigBridge.retry(yaml.getRetry());\n        AgentRuntimeConfig runtimeConfig =\n                AgentRuntimeConfig.compose(\n                        AgentSectionConfig.from(agentConfig),\n                        QueueConfig.from(queueConfig),\n                        AgentSchedulerConfig.from(agentConfig),\n                        RetryConfig.from(retryConfig));\n\n        ReadonlyConfig rawInputConfig = AgentConfigBridge.input(yaml.getInput());\n        String inputType = EdgeAgentTypeResolver.resolveInputType(rawInputConfig);\n        ReadonlyConfig inputConfig = EdgeAgentTypeResolver.withInputType(rawInputConfig, inputType);\n","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-edge-agent/seatunnel-edge-agent-starter/src/main/java/org/apache/seatunnel/edge/agent/starter/parse/EdgeAgentConfigLoader.java#L38-L74","documentation":"EdgeAgentConfigLoader.load builds a fully resolved agent configuration from the agent YAML. Before anything else it requires an 'input' section to be present; without an input source the agent has nothing to consume, so load throws IllegalArgumentException fail-fast.","triggerScenarios":"Calling EdgeAgentConfigLoader.load(agentYamlPath, installRoot) where AgentYamlLoader parsed a YAML whose 'input' section is missing (yaml.getInput() == null).","commonSituations":"New agent YAML created with only agent/queue/retry sections; 'input' key misspelled (e.g. 'inputs' or 'source'); YAML indentation placing input under the wrong parent so it does not bind.","solutions":["Add a valid 'input' section to the agent YAML.","Check the key spelling and top-level indentation ('input' must be top-level).","Validate the YAML parses as AgentYamlConfig with a non-null input before calling load."],"exampleFix":"# before\nagent:\n  id: edge-agent-01\n# after\ninput:\n  plugin-name: MQTT\n  ...\nagent:\n  id: edge-agent-01","handlingStrategy":"validation","validationCode":"AgentYamlConfig yaml = AgentYamlLoader.load(configPath);\nif (yaml.getInput() == null) {\n    throw new IllegalArgumentException(\"agent YAML must define a top-level 'input' section\");\n}","typeGuard":null,"tryCatchPattern":"try { EdgeAgentResolvedConfig cfg = EdgeAgentConfigLoader.load(path, root); } catch (IllegalArgumentException e) { log.error(\"Agent config load failed: {}\", e.getMessage()); }","preventionTips":["Always include an 'input' section in agent YAML files.","Validate YAML with a schema/template before deploying.","Watch indentation: 'input' must bind at the expected level."],"tags":["config","yaml","startup"],"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-14T05:17:10.506Z"}