Skip to content

Bug: Execution history shows incorrect status due to finished flag not being set properly #15848

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
dwillitzer opened this issue May 30, 2025 · 1 comment
Labels
in linear Issue or PR has been created in Linear for internal review

Comments

@dwillitzer
Copy link

Description

Found and resolved a production issue where 72,172 executions were displaying as errors in the UI default view, but showed correct statuses when date filters were applied. Investigation revealed that executions with status='error' had finished=false despite having valid stoppedAt timestamps.

Environment

  • n8n Version: 1.94.1
  • Database: PostgreSQL 15
  • Deployment: Docker
  • Affected Period: April 30, 2025 - May 29, 2025

Problem Details

Symptoms

  • Execution history page shows all executions as errors when no filters applied
  • Applying date filters shows correct mix of success/error statuses
  • Database contains correct execution data with valid timestamps

Root Cause

Database records had inconsistent state:

-- 72,172 executions found with this condition:
status = 'error' AND finished = false AND "stoppedAt" IS NOT NULL

Investigation Findings

  1. Issue started April 30, 2025 (first occurrence: 2025-04-30 20:48:52.035+00)
  2. Primarily affected webhook-triggered workflows
  3. Application logs show n8n intentionally saving with finished=false:
    Save execution data to database for execution ID 1113281 
    {"finished":false,"stoppedAt":"2025-05-29T23:52:17.081Z"}
    

Most Affected Workflows

  • "3️⃣ real-time transcript -> G Docs" - 49,134 errors
  • "2️⃣ meeting bot webhook" - 8,846 errors
  • "(4am) new ticket" - 4,539 errors

Related Issues

This appears related to #15293 which I filed on May 12, 2025. Both issues:

  • Affect execution history display
  • Work correctly when date filters are applied
  • Started around the same time (late April 2025)
  • Suggest a common underlying issue with execution history queries

Temporary Resolution

Fixed by updating database:

UPDATE execution_entity 
SET finished = true 
WHERE status = 'error' 
  AND finished = false 
  AND "stoppedAt" IS NOT NULL;
-- Updated 72,172 records

Expected Behavior

Executions with error status and valid stoppedAt timestamps should have finished=true.

Actual Behavior

Error executions are saved with finished=false despite being completed, causing UI to filter them incorrectly.

Reproduction Steps

  1. Monitor execution_entity table for executions where status='error' AND finished=false AND stoppedAt IS NOT NULL
  2. These executions will appear as errors in default UI view
  3. Apply date filter to see correct statuses
  4. Remove filter to see all as errors again

Additional Context

This issue, combined with #15293, suggests that an n8n update around April 30, 2025 introduced multiple bugs in the execution history system. The unfiltered query path appears to have different behavior than filtered queries, leading to various display issues.

@Joffcom
Copy link
Member

Joffcom commented May 30, 2025

Hey @dwillitzer,

We have created an internal ticket to look into this which we will be tracking as "GHC-2252"

@Joffcom Joffcom added the in linear Issue or PR has been created in Linear for internal review label May 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in linear Issue or PR has been created in Linear for internal review
Projects
None yet
Development

No branches or pull requests

2 participants