Getting Workflow Error after upgrading n8n version

Describe the issue/error/question

How upgrade n8n version without Sql contraint error

What is the error message (if any)?

Error - After upgrading we import old workflows and credentials while we deploy into n8n where it throws an sqlite constraint error.

Please share the workflow

Share the output returned by the last node

Information on your n8n setup

  • n8n version: 0.161.0
  • Database you’re using (default: SQLite): SQLite
  • Running n8n with the execution process [own(default), main]:
  • Running n8n via [Docker, npm, n8n.cloud, desktop app]:

Hey @Abarno,

Welcome to the community :cake:

How are you running n8n is it Docker, npm, cloud, desktop or something else? Can you also let me know what version you are upgrading to I assume 0.161.0 is the version you are coming from. Could you also share the full error message you are seeing and how you are importing the workflows, In theory you shouldn’t need to import them as the database would be upgraded.

@Jon Thanks for the welcome.
When running the below command:
❯ n8n import:workflow --separate --input=seed/workflows

Getting the below error:
An error occurred while importing workflows. See log messages for details. SQLITE_CONSTRAINT: NOT NULL constraint failed: workflow_entity.name

Hey @Abarno,

What version of n8n did you export the workflows from and do the workflows already exist?

@Jon Upon looking more closely got the issue. When we are trying to import the workflows that are created in local using the browser , they have a json format as follows:
[{"name": "Test Workflow", ....}]
But the expected json format for import command is:
{"name": "Test Workflow",....}
Now till n8n version: 0.161.0 the n8n import command supported both the formats. post that it only supports the latter.
Interestingly when we use the following export command:
n8n export:credentials --id=1 --output=/home/n8n/seed/credentials/1_test.json
It always exports the json file in following format:
[{"name":"Test 1 Credentials", ....}]
upon modifying the above json to :
{"name": "Test 1 Credentials", ...}
The import commands works fine

@Jon I would request if the n8n team can resolve the issue in export command to format the output file json correctly

Hey @Abarno,

I will take a look at this one shortly.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.