{"record":{"id":"8e385147cf345563","repo":"apache/seatunnel","slug":"agent-id-must-be-non-empty-after-resolution","errorCode":null,"errorMessage":"agent.id must be non-empty after resolution.","messagePattern":"agent\\.id must be non-empty after resolution\\.","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/config/AgentSectionConfig.java","lineNumber":42,"sourceCode":"\nimport java.io.Serializable;\nimport java.util.Objects;\n\n@Getter\npublic class AgentSectionConfig implements Serializable {\n\n    private static final long serialVersionUID = 1L;\n\n    private final String agentId;\n    private final EdgeDeliveryGuarantee deliveryGuarantee;\n\n    public AgentSectionConfig(ReadonlyConfig config) {\n        Objects.requireNonNull(config, \"config\");\n        ConfigValidator.of(config).validate(EdgeAgentRuntimeOptionRules.agentRule());\n\n        String rawId = config.get(EdgeAgentRuntimeOptions.AGENT_ID);\n        if (rawId == null || rawId.trim().isEmpty()) {\n            throw new IllegalArgumentException(\"agent.id must be non-empty after resolution.\");\n        }\n        this.agentId = rawId.trim();\n\n        String rawDeliveryGuarantee = config.get(EdgeAgentRuntimeOptions.DELIVERY_GUARANTEE);\n        EdgeDeliveryGuarantee.validateSupported(rawDeliveryGuarantee);\n        this.deliveryGuarantee = EdgeDeliveryGuarantee.from(rawDeliveryGuarantee);\n    }\n\n    public static AgentSectionConfig from(ReadonlyConfig config) {\n        return new AgentSectionConfig(config);\n    }\n}\n","sourceCodeStart":24,"sourceCodeEnd":55,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-edge-agent/seatunnel-edge-agent-starter/src/main/java/org/apache/seatunnel/edge/agent/starter/config/AgentSectionConfig.java#L24-L55","documentation":"AgentSectionConfig parses the 'agent' section of the edge agent YAML into a typed config. After resolving AGENT_ID from the config, it rejects null or blank values because every agent instance requires a stable identity. This is a fail-fast guard during startup so the agent never runs without an id.","triggerScenarios":"Constructing AgentSectionConfig with a ReadonlyConfig whose EdgeAgentRuntimeOptions.AGENT_ID is absent, null, or whitespace-only after resolution.","commonSituations":"User omits 'agent.id' in the agent YAML; id resolution (e.g. from an id file) failed upstream leaving an empty value; YAML has 'id: \"\"' or 'id:' with no value.","solutions":["Set a non-empty 'agent.id' in the agent YAML config.","Check EdgeAgentIdResolver output/id file to ensure identity resolution produced a value before this config is built.","Trim/verify the resolved id value (raw value must contain non-whitespace characters)."],"exampleFix":"# before\nagent:\n  id: \"\"\n# after\nagent:\n  id: \"edge-agent-01\"","handlingStrategy":"validation","validationCode":"String id = config.get(EdgeAgentRuntimeOptions.AGENT_ID);\nif (id == null || id.trim().isEmpty()) {\n    throw new IllegalArgumentException(\"agent.id must be set before building AgentSectionConfig\");\n}","typeGuard":null,"tryCatchPattern":"try { new AgentSectionConfig(config); } catch (IllegalArgumentException e) { log.error(\"Invalid agent config: {}\", e.getMessage()); }","preventionTips":["Always set agent.id explicitly in the agent YAML.","Verify id-file resolution succeeded before building the section config.","Trim ids at authoring time; avoid whitespace-only values."],"tags":["config","startup","identity"],"backgroundTag":"empty-required-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"}