{"record":{"id":"4046d625e348df51","repo":"apache/seatunnel","slug":"input-must-be-defined-4046d6","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/EdgeAgentIdResolver.java","lineNumber":42,"sourceCode":"import java.nio.charset.StandardCharsets;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.util.Objects;\nimport java.util.Properties;\nimport java.util.UUID;\n\npublic class EdgeAgentIdResolver {\n\n    public static final String ID_FILE_NAME = \"edge-agent.id\";\n    static final String KEY_AGENT_ID = \"agent.id\";\n    static final String KEY_INPUT_ID = \"input.id\";\n    static final String KEY_OUTPUT_ID = \"output.id\";\n\n    public static void resolve(AgentYamlConfig yaml, Path installRoot) throws IOException {\n        Objects.requireNonNull(yaml, \"yaml\");\n        Objects.requireNonNull(installRoot, \"installRoot\");\n        if (yaml.getInput() == null) {\n            throw new IllegalArgumentException(\"input must be defined.\");\n        }\n\n        Path idFilePath = resolveIdFilePath(installRoot);\n        Properties properties = loadOrCreate(idFilePath);\n\n        resolveAgentId(yaml, properties);\n        resolveInputId(yaml, properties);\n        resolveOutputId(yaml, properties);\n\n        syncResolvedIdsToProperties(yaml, properties);\n        persist(idFilePath, properties);\n    }\n\n    private static void resolveAgentId(AgentYamlConfig yaml, Properties properties) {\n        AgentYamlConfig.AgentSection agent = yaml.getAgent();\n        if (agent == null) {\n            yaml.setAgent(new AgentYamlConfig.AgentSection());\n            agent = yaml.getAgent();","sourceCodeStart":24,"sourceCodeEnd":60,"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/EdgeAgentIdResolver.java#L24-L60","documentation":"EdgeAgentIdResolver.resolve assigns/resolves the agent identity from the YAML and an id file under the install root. It requires an 'input' section to exist before identity resolution and throws IllegalArgumentException when yaml.getInput() is null.","triggerScenarios":"Calling EdgeAgentIdResolver.resolve(yaml, installRoot) with an AgentYamlConfig whose input section is absent.","commonSituations":"Same as the loader guard: YAML missing the 'input' key, misspelled key, or input nested at the wrong indentation level so it binds to null.","solutions":["Define a top-level 'input' section in the agent YAML.","Fix indentation/spelling so AgentYamlConfig.getInput() returns a value.","If resolving manually, check yaml.getInput() != null before calling resolve."],"exampleFix":"// before\nif (!yaml.containsKey(\"input\")) { /* proceeds anyway */ }\n// after\nif (yaml.getInput() == null) {\n    throw new IllegalArgumentException(\"input must be defined.\");\n}","handlingStrategy":"validation","validationCode":"if (yaml.getInput() == null) {\n    throw new IllegalArgumentException(\"input must be defined before identity resolution\");\n}\nEdgeAgentIdResolver.resolve(yaml, installRoot);","typeGuard":null,"tryCatchPattern":"try { EdgeAgentIdResolver.resolve(yaml, root); } catch (IllegalArgumentException e) { log.error(\"Identity resolution failed: {}\", e.getMessage()); }","preventionTips":["Check yaml.getInput() != null before invoking resolve.","Keep the 'input' section top-level and correctly spelled.","Test YAML parsing (AgentYamlLoader) in CI for agent config files."],"tags":["config","yaml","identity"],"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"}