kestra-io/kestra · error · PebbleException

Unable to fetch error logs

Error message

Unable to fetch error logs

What it means

Thrown by 'errorLogs' when the underlying executionLogMetaStore.get().errorLogs(tenantId, executionId) call throws anything that is not a RetryUtils.RetryFailed (which is swallowed and returns an empty list). The retry is configured with exponential backoff and unlimited attempts capped at 5 seconds, so this fires only after retries are exhausted by a non-RetryFailed error or an unexpected Throwable.

Source

Thrown at core/src/main/java/io/kestra/core/runners/pebble/functions/ErrorLogsFunction.java:66

        Map<String, String> flow = (Map<String, String>) context.getVariable("flow");
        Map<String, String> execution = (Map<String, String>) context.getVariable("execution");

        RetryUtils.Instance<List<LogEntry>, Throwable> retry = RetryUtils.of(
            Exponential.builder()
                .delayFactor(2.0)
                .interval(Duration.ofMillis(100))
                .maxInterval(Duration.ofSeconds(1))
                .maxAttempts(-1)
                .maxDuration(Duration.ofSeconds(5))
                .build()
        );

        try {
            return retry.run(logs -> ListUtils.isEmpty(logs), () -> executionLogMetaStore.get().errorLogs(flow.get("tenantId"), execution.get("id")));
        } catch (RetryUtils.RetryFailed e) {
            return Collections.emptyList();
        } catch (Throwable e) {
            throw new PebbleException(e, "Unable to fetch error logs");
        }
    }
}

View on GitHub (pinned to 823fada927)

Solutions

  1. Ensure errorLogs() is called within a worker task that has a valid execution context (see error 144).
  2. Check that the execution actually has error logs and that the log store (DB/indexer) is reachable and healthy.
  3. If the error is transient, re-run the task; if persistent, inspect the worker logs for the wrapped cause to identify the storage/permissions problem.
Defensive patterns

Strategy: fallback

Validate before calling

# The function already falls back to an empty list on RetryFailed; to avoid the PebbleException, ensure a valid worker execution context with 'flow' and 'execution' variables populated before calling errorLogs().

Try / catch

# Pebble has no try/catch. Wrap in a custom task that calls errorLogs and catches Throwable to return an empty list, mirroring the RetryFailed branch.

Prevention

When it happens

Trigger: The 'flow' or 'execution' context variables are missing or malformed (a null tenantId/id from a context where they are not populated), the log store throws an unexpected runtime exception (auth, serialization, storage outage) that is not classified as RetryFailed, or the execution identifier does not resolve.

Common situations: Calling errorLogs() in a context where 'flow'/'execution' map variables are absent; a transient or persistent database/storage failure that the retry policy cannot clear; permissions/tenant mismatch on the log store.

Related errors


AI-assisted analysis of kestra-io/kestra@823fada927 (2026-08-14). Data as JSON: /api/errors/024b4c7734259518. Report an issue: GitHub.