{"record":{"id":"ecb9d2907060b589","repo":"apache/seatunnel","slug":"missing-key-after-identity-resolution","errorCode":null,"errorMessage":"Missing ${key} after identity resolution.","messagePattern":"Missing (.+?) after identity resolution\\.","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"seatunnel-edge-agent/seatunnel-edge-agent-starter/src/main/java/org/apache/seatunnel/edge/agent/starter/parse/EdgeAgentIdResolver.java","lineNumber":138,"sourceCode":"                KEY_AGENT_ID\n                        + '='\n                        + requireProperty(properties, KEY_AGENT_ID)\n                        + '\\n'\n                        + KEY_INPUT_ID\n                        + '='\n                        + requireProperty(properties, KEY_INPUT_ID)\n                        + '\\n'\n                        + KEY_OUTPUT_ID\n                        + '='\n                        + requireProperty(properties, KEY_OUTPUT_ID)\n                        + '\\n';\n        Files.write(idFilePath, content.getBytes(StandardCharsets.UTF_8));\n    }\n\n    private static String requireProperty(Properties properties, String key) {\n        String value = properties.getProperty(key);\n        if (!hasText(value)) {\n            throw new IllegalStateException(\"Missing \" + key + \" after identity resolution.\");\n        }\n        return value.trim();\n    }\n\n    private static boolean hasText(String value) {\n        return value != null && !value.trim().isEmpty();\n    }\n}\n","sourceCodeStart":120,"sourceCodeEnd":147,"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#L120-L147","documentation":"EdgeAgentIdResolver.requireProperty reads a key from the identity Properties file (e.g. output.id) after identity resolution and throws IllegalStateException if the value is missing or blank. This indicates the internal identity resolution wrote/kept an id file lacking an expected key — an invariant violation rather than user input error.","triggerScenarios":"Calling requireProperty on a Properties object loaded from the install root id file where the requested key (e.g. output.id) is absent or whitespace-only, right after resolveAgentId ran.","commonSituations":"Corrupted or hand-edited id properties file under the install root; partial/failed prior write leaving an empty file; read/write permission issues causing a stale empty file to be loaded; concurrent agents racing on the same id file.","solutions":["Delete the id properties file under the install root and let identity resolution regenerate it.","Inspect the id file and add the missing key (e.g. output.id=<value>) if regeneration is not possible.","Ensure the agent process has write permission to the install root so the file is written fully."],"exampleFix":"// before (corrupted id file)\n# empty file\n// after\noutput.id=edge-agent-01","handlingStrategy":"try-catch","validationCode":"Properties props = loadOrCreate(idFilePath);\nif (!props.containsKey(\"output.id\") || props.getProperty(\"output.id\").trim().isEmpty()) {\n    Files.deleteIfExists(idFilePath); // force regeneration\n}","typeGuard":null,"tryCatchPattern":"try {\n    resolverOutput = requireProperty(properties, \"output.id\");\n} catch (IllegalStateException e) {\n    Files.deleteIfExists(idFilePath); // regenerate and retry once\n    properties = loadOrCreate(idFilePath);\n    resolverOutput = requireProperty(properties, \"output.id\");\n}","preventionTips":["Do not hand-edit the identity properties file under the install root.","Ensure the agent user owns write access to the install root.","Avoid running multiple agents against the same install root concurrently.","Delete the id file after failed/interrupted startups to force clean regeneration."],"tags":["identity","state","properties-file"],"backgroundTag":"missing-config-key","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"}