apache/seatunnel · error · FileNotFoundException
Agent config file not found: ${normalized}
Error message
Agent config file not found: ${normalized} What it means
EdgeAgentConfigLocator.requireRegularFile() normalizes the candidate path and throws FileNotFoundException when it exists but is not a regular file (or does not exist). resolve() calls this after picking up a user-supplied path from --config or the environment variable.
Source
Thrown at seatunnel-edge-agent/seatunnel-edge-agent-starter/src/main/java/org/apache/seatunnel/edge/agent/starter/command/EdgeAgentConfigLocator.java:60
Path cwd = Paths.get("").toAbsolutePath();
for (String candidate : new String[] {"config/agent.yaml", "agent.yaml"}) {
Path path = cwd.resolve(candidate).normalize();
if (Files.isRegularFile(path)) {
LOG.debug("Using agent config: {}", path);
return path;
}
}
throw new FileNotFoundException(
"No agent.yaml found. Use --config /path/to/agent.yaml, set "
+ EdgeAgentEnvConstants.ENV_EDGE_AGENT_CONFIG
+ ", or place config/agent.yaml under the working directory.");
}
private static Path requireRegularFile(Path path) throws FileNotFoundException {
Path normalized = path.toAbsolutePath().normalize();
if (!Files.isRegularFile(normalized)) {
throw new FileNotFoundException("Agent config file not found: " + normalized);
}
LOG.debug("Using agent config: {}", normalized);
return normalized;
}
}
View on GitHub (pinned to cf67b549a7)
Solutions
- Correct the path so it names the agent.yaml file itself, not a directory
- Verify with ls -l that the target exists and is a regular file
- Fix or remove the broken symlink and redeploy the config file
- Check ENV_EDGE_AGENT_CONFIG is not set to a stale path in the deployment environment
Example fix
// before --config /opt/agent/config/ // after --config /opt/agent/config/agent.yaml
Defensive patterns
Strategy: validation
Validate before calling
Path p = Paths.get(userSupplied);
if (!Files.isRegularFile(p.toAbsolutePath().normalize())) {
throw new IllegalArgumentException("Not a regular file: " + userSupplied);
} Type guard
boolean isConfigFile(Path p) { return p != null && Files.isRegularFile(p.toAbsolutePath().normalize()); } Try / catch
try {
locator.resolve(args);
} catch (FileNotFoundException e) {
LOG.error("Check --config points to the file itself, not a directory: {}", e.getMessage());
} Prevention
- Point --config at agent.yaml, never at a directory
- Check symlinks resolve to real files after deployment
- Audit env vars for stale config paths in images
When it happens
Trigger: Passing --config or ENV_EDGE_AGENT_CONFIG pointing to a path that is a directory, a symlink to nothing, or a nonexistent file.
Common situations: Pointing --config at the config/ directory instead of agent.yaml; a broken symlink after redeployment; a stale env var left from a previous container image; typo in the file name.
Understand the failure class
Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.
Related errors
- No agent.yaml found. Use --config /path/to/agent.yaml, set E
- deploy mode not support : ${MODE}
- AmazonDocumentDB TLS CA bundle is not a readable file:
- Server property {} must contain at least one absolute execut
- python.script.path does not point to a readable file: {}
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/cd209b69b0037d74.
Report an issue: GitHub.