n8n-io / n8n

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

Saving a workflow with non-existing tag will raise an Error #9132

Open barn4k opened 5 months ago

barn4k commented 5 months ago

Bug Description

If I choose a non-existing tag (don't ask) and try to save a workflow, I will get an error SQLITE_CONSTRAINT: FOREIGN KEY constraint failed for SQLight or insert or update on table "workflows_tags" violates foreign key constraint "fk_workflows_tags_tag_id" for Postgres.

To Reproduce

  1. Create any Workflow (just to not mess with the existing workflow tags).
  2. Save it
  3. Go to the tags section
  4. Enter anything new
  5. Click on the first dropdown entry
  6. Save the workflow or click inside the workflow to loose the focus from tag section

Examples:

image image

Expected behavior

The new tag will be created or there won't be a dropdown entry with the "ghost" tag

Operating System

Cloud / Docker

n8n Version

1.36.1

Node.js Version

docker

Database

PostgreSQL

Execution mode

main (default)

Joffcom commented 5 months ago

Cheers @barn4k,

I have created ADO-2150 as the internal ticket to resolve this.