OpenMetadata icon indicating copy to clipboard operation
OpenMetadata copied to clipboard

[Bug]: Ingestion log viewer always displays logs from the most recent run regardless of historical selection

Open DanielReynoso47 opened this issue 3 months ago • 1 comments

Affected module

UI

Describe the bug

Description

There is a bug in the log viewer UI hook where selecting any historical, completed ingestion pipeline execution from the UI persistently displays the logs of the most recent execution instead of the selected historical record.

Root Cause

In useIngestionLogSource.ts, when viewing a completed or inactive pipeline execution (runActive == false), the hook disables live streaming and activates the paginated loader (paginatedEnabled === true).

The paginated loader relies on the fetchPage function to fetch logs from the backend. However, fetchPage invokes the API client getIngestionPipelineLogById using only (ingestionFqn, cursor), completely omitting the runId state variable representing the selected run.

Because runId is missing, the backend API implicitly defaults to fetching data for the most recent execution record. This causes the UI to show identical, recent log data no matter which older execution block the user inspects.

To Reproduce

Steps to Reproduce

  1. Navigate to an Ingestion Pipeline with multiple historical runs.
  2. Select an older, completed run from the execution history.
  3. Observe the rendered log content.
  4. Select a different, more recent completed run.
  5. Notice that the log viewer displays the exact same logs (the most recent execution's logs) across both selections.

Expected behavior

Expected Behavior

The frontend should be able to request logs specific to the selected historical run by passing down the active runId parameter to the backend API client.

OS

MacOS 26.6.1

Python version

3.12

OpenMetadata version

2.0.0

OpenMetadata Ingestion package version

openmetadata-ingestion=2.0.0

Additional context

Visual Proof / Code Location

  • File: openmetadata-ui/src/main/resources/ui/src/hooks/useIngestionLogSource.ts
  • Target Block: fetchPage definition (Lines 83–93)

Suggested Fix

Update the fetchPage function within the hook to explicitly include the current runId state variable in the API lookup call, and append runId to the hook's dependency array:

// BEFORE
const fetchPage = useCallback(
  (cursor?: string) =>
    getIngestionPipelineLogById(ingestionFqn, cursor).then((res) => ({
      content: ingestionType
        ? getLogTaskFieldForType(res.data, ingestionType)
        : '',
      after: res.data.after,
      total: res.data.total,
    })),
  [ingestionFqn, ingestionType]
);

// AFTER
const fetchPage = useCallback(
  (cursor?: string) =>
    getIngestionPipelineLogById(ingestionFqn, runId, cursor).then((res) => ({
      content: ingestionType
        ? getLogTaskFieldForType(res.data, ingestionType)
        : '',
      after: res.data.after,
      total: res.data.total,
    })),
  [ingestionFqn, ingestionType, runId] // Included runId to prevent stale closures
);

Pre-submission checklist

  • [x] I searched for duplicate issues.
  • [x] I removed credentials, hostnames, emails, and other sensitive data from logs and config.

DanielReynoso47 avatar Aug 31 '26 20:08 DanielReynoso47

@DanielReynoso47 "Hi! I would love to work on this issue. I have my local environment set up. Could you please assign it to me?"

Arpit2singh avatar Sep 01 '26 17:09 Arpit2singh