apache/seatunnel · warning

Log file path is empty, no log file path configured in the c

Error message

Log file path is empty, no log file path configured in the current configuration file

What it means

LogBaseServlet.prepareLogResponse guards every log-file request: if the configured logPath is blank it returns HTTP 400 BAD_REQUEST and logs this warning, because no log directory is configured in the current configuration file, so any log name/path request cannot be served.

Source

Thrown at seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/rest/servlet/LogBaseServlet.java:53

    public LogBaseServlet(NodeEngineImpl nodeEngine) {
        super(nodeEngine);
    }

    /**
     * Prepares the servlet log response after enforcing the configured log directory boundary.
     *
     * <p>The requested log file is resolved to its canonical path before reading so that relative
     * segments and symbolic links cannot escape the canonical log directory.
     *
     * @param resp response used to return status and log content
     * @param logPath configured log directory
     * @param logName requested log file name from the request URI
     */
    protected void prepareLogResponse(HttpServletResponse resp, String logPath, String logName) {
        if (StringUtils.isBlank(logPath)) {
            resp.setStatus(HttpServletResponse.SC_BAD_REQUEST);
            log.warn(
                    "Log file path is empty, no log file path configured in the current configuration file");
            return;
        }
        String logFilePath = new File(logPath, logName).getPath();
        try {
            String canonicalLogDir = new File(logPath).getCanonicalPath();
            String canonicalFilePath = new File(logFilePath).getCanonicalPath();
            if (!canonicalFilePath.startsWith(canonicalLogDir + File.separator)
                    && !canonicalFilePath.equals(canonicalLogDir)) {
                resp.setStatus(HttpServletResponse.SC_BAD_REQUEST);
                log.warn(
                        "Path traversal attempt blocked - Requested: {}, Resolved: {}, LogDir: {}",
                        logName,
                        canonicalFilePath,
                        canonicalLogDir);
                return;
            }
            String logContent = FileUtils.readFileToStr(new File(canonicalFilePath).toPath());

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Configure a file appender with an explicit fileName/directory in the node's log4j2 (or chosen logging) configuration and restart.
  2. Set the log path system property/env (e.g., -Dseatunnel.logs.path=...) when launching the node.
  3. Verify with a GET to the log-name endpoint that the path resolves (see errorIndex 3718).
  4. Avoid blank config values; comment removals in logging config can silently blank the path.

Example fix

// before (log4j2.properties, console only, no file appender)
// rootLogger.appenderRef.stdout.ref = console
// after
// appender.file.type = File
// appender.file.name = file
// appender.file.fileName = ${sys:seatunnel.logs.path}/seatunnel.log
// rootLogger.appenderRef.file.ref = file
Defensive patterns

Strategy: validation

Validate before calling

// before calling log endpoints, verify config
// String logPath = System.getProperty("seatunnel.logs.path");
// if (logPath == null || logPath.isBlank()) {
//     throw new IllegalStateException("log path not configured");
// }
// if (!Files.isDirectory(Paths.get(logPath))) { throw ... }

Try / catch

try {
    Response r = restGet("/log/name");
    if (r.status() == 400) { configureLogPath(); }
} catch (Exception e) { handle(e); }

Prevention

When it happens

Trigger: Any GET to a log-content/log-download endpoint on a node whose logging configuration lacks a file path (blank logPath passed to prepareLogResponse), e.g., console-only logging setup or missing log4j2 file-appender configuration.

Common situations: Deployment using console appender only; log4j2.properties/custom config missing the file appender path; env var like SEATUNNEL_HOME unset so derived log path resolves empty; mis-edited config removing the file path.

Understand the failure class

Background: "missing required config value" errors: why libraries refuse to start when a configuration key is empty, unset, or blank — this error's family across 48 libraries.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/dd3481422cd09d39. Report an issue: GitHub.