n8n-io / n8n

Free and source-available fair-code licensed workflow automation tool. Easily automate tasks across different services.
https://n8n.io
Other
49.11k stars 7.84k forks source link

Workflow Randomly Stops Running and Blocks Access, Resulting in Workflow Loss #11699

Open 7Beeai opened 1 week ago

7Beeai commented 1 week ago

Bug Description

Occasionally, a workflow in n8n unexpectedly stops running, and my access to the workflow becomes restricted. As a result, I lose access to the workflow entirely, making it impossible to manage or recover it. This issue disrupts processes and results in the permanent loss of the workflow if not restored.

To Reproduce

1- Set up and activate a workflow in n8n. 2- Allow the workflow to run for an extended period, or configure it to run intermittently. 3- Observe the workflow over time; it may randomly stop running. 4- Attempt to access the workflow after it stops running. 5- Receives message: Could not delete the workflow - you can only access workflows owned by you

Expected behavior

The workflow should run continuously without unexpected interruptions. If a workflow stops, access should remain available so it can be reviewed, restarted, or managed without being permanently lost.

Operating System

Ubuntu 24.04.1 LTS

n8n Version

1.66.0

Node.js Version

20.17.0

Database

PostgreSQL

Execution mode

main (default)

Joffcom commented 1 week ago

Hey @7Beeai,

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

despairblue commented 1 week ago

Allow the workflow to run for an extended period, or configure it to run intermittently.

  1. Do you mean that the workflow is active for an extended period of time or that an execution runs for extended period of time?
  2. What is an "extended period". Does that mean 5 minutes, 2 hours or even days?

Observe the workflow over time; it may randomly stop running.

  1. Does that mean the workflow is not shown as active anymore or that no executions are triggered anymore or that a continuously running execution (e.g. with an infinite loop) stops?

Attempt to access the workflow after it stops running.

  1. With "accessing" you mean opening the editor?

Receives message: Could not delete the workflow - you can only access workflows owned by you

  1. Where does it show that message?
  2. Can you share a screen shot?

Strange that you see this delete error when trying to "access" the workflow.

  1. Can you share your workflow or even better a minimal version that exhibits the same behavior?

Thanks for reporting this issue. Answering the questions allows us to reproduce and fix this 🙏🏾

7Beeai commented 1 week ago
  1. The workflow itself is active for an extended period of time, meaning it remains available and set to run based on triggers or schedules. It’s not continuously executing, but rather it stays active and ready to run. This issue only affects certain workflows, while others continue to run without any problems.

  2. By "extended period," I mean hours to days. Some workflows operate fine for days or even longer before the issue occurs, while others may run normally for just a few hours. The timing is random, and I haven’t identified a consistent timeframe. Importantly, this does not happen with all workflows.

  3. For the affected workflows, they are no longer shown as active in n8n, and no further executions are triggered, even though they should still be available. There is no infinite loop in these workflows; they only trigger based on certain conditions or schedules. After a random period, these specific workflows stop being available and no longer execute, while others continue functioning as expected.

  4. Yes, by "accessing," I mean trying to open the editor to view or edit the workflow. For the affected workflows, when I try to access them after they stop, I receive an error that blocks me from opening them.

  5. This message appears in a popup within the n8n UI when I try to open the affected workflows in the editor. Instead of allowing me to open them, it’s as if I’m being denied access as though I’m not the owner.

  6. Screenshot

    Captura de Tela 2024-11-12 às 15 52 47
  7. The issue does not occur with all workflows. Some workflows run normally for days or hours without any issues, while specific workflows may suddenly block my access, even though I created them. I haven’t observed any clear pattern among the affected workflows; the message says I don’t have permission to access them because they belong to another user, even though I am the original owner.

despairblue commented 1 week ago

Thanks for the structured answers and the screenshot, makes debugging this much easier 🙏🏾

  1. Are there any trigger nodes that only the disappearing workflows use or vice versa trigger nodes that only the workflows use that are not disappearing?

  2. Can you still see them in the home section's workflow list or do you have them bookmarked?

    • Wondering how you get to them if you lost the access.
  3. Are you the only use on this instance?

  4. Are you an instance owner or instance member?

image

  1. Do you have access to the database? If so we can check who's owning them now.