apache/seatunnel · warning

Log file content is empty, get log path

Error message

Log file content is empty, get log path : %s

What it means

Logged when the servlet attempts to read a log file and a SeaTunnelRuntimeException with empty content is thrown, meaning the resolved log file exists at the path but has no readable content. The servlet responds with HTTP 400.

Solutions

  1. Wait until the node has written output and retry the log request
  2. Verify the correct node name — request logs from the specific worker that ran the job
  3. Check the log file on disk directly (ls -la on the log dir) to confirm whether it is 0 bytes
  4. Inspect the actual cause in server logs; this message hides the underlying error detail
Defensive patterns

Strategy: retry

Validate before calling

// give a freshly started node time to write logs before requesting
await new Promise(r => setTimeout(r, 5000));

Try / catch

try {
  const resp = await fetch(baseUrl + '/log/' + node);
  if (resp.status === 400) {
    const body = await resp.text();
    if (body.includes('empty')) { /* retry later or read file on disk */ }
  }
} catch (e) { /* handle network errors */ }

Prevention

When it happens

Trigger: Requesting a log endpoint for a log file that is empty (0 bytes) — e.g. a worker log created but nothing written yet, or a read returning empty content wrapped in SeaTunnelRuntimeException.

Common situations: Requesting a freshly started node's log before any output; a log rotated/truncated to zero; requesting a log file that was created on a node whose log path differs from the master's.

Understand the failure class

Background: "failed to read file", EACCES, ENOENT and "could not read <path>" errors: when a program can't read a file from disk — this error's family across 49 libraries.

Related errors


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

Appendix: source

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

            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());
            write(resp, logContent);
        } catch (IOException e) {
            resp.setStatus(HttpServletResponse.SC_BAD_REQUEST);
            log.warn("Failed to resolve log file path: {}, error: {}", logFilePath, e.getMessage());
        } catch (SeaTunnelRuntimeException e) {
            resp.setStatus(HttpServletResponse.SC_BAD_REQUEST);
            log.warn(String.format("Log file content is empty, get log path : %s", logFilePath));
        }
    }
}

View on GitHub (pinned to cf67b549a7)