EntityMetadataNotFoundError: No metadata for "InstalledPackages" was found

Describe the problem/error/question

Trying to upgrade to either version 1.123.23 or 1.123.24 and I keep getting this same error on both upgrades.
If I downgrade and stay at 1.123.22 it works and runs absolutely fine.

What is the error message (if any)?

Initializing n8n process
n8n ready on ::, port 5678
EntityMetadataNotFoundError: No metadata for "InstalledPackages" was found.
    at DataSource.getMetadata (/usr/local/lib/node_modules/n8n/node_modules/src/data-source/DataSource.ts:417:30)
    at InstalledPackagesRepository.get metadata [as metadata] (/usr/local/lib/node_modules/n8n/node_modules/src/repository/Repository.ts:52:40)
    at InstalledPackagesRepository.find (/usr/local/lib/node_modules/n8n/node_modules/src/repository/Repository.ts:535:39)
    at CommunityPackagesService.getAllInstalledPackages (/usr/local/lib/node_modules/n8n/src/modules/community-packages/community-packages.service.ts:115:48)
    at CommunityPackagesService.checkForMissingPackages (/usr/local/lib/node_modules/n8n/src/modules/community-packages/community-packages.service.ts:305:40)
    at CommunityPackagesService.init (/usr/local/lib/node_modules/n8n/src/modules/community-packages/community-packages.service.ts:96:14)
    at Start.init (/usr/local/lib/node_modules/n8n/src/commands/base-command.ts:147:4)
    at Start.init (/usr/local/lib/node_modules/n8n/src/commands/start.ts:202:3)
    at CommandRegistry.execute (/usr/local/lib/node_modules/n8n/src/command-registry.ts:66:4)
    at /usr/local/lib/node_modules/n8n/bin/n8n:63:2
Exiting due to an error.
No metadata for "InstalledPackages" was found.

Information on your n8n setup

  • n8n version: 1.123.22
  • Database (default: SQLite): SQLite
  • n8n EXECUTIONS_PROCESS setting (default: own, main): default
  • Running n8n via (Docker, npm, n8n cloud, desktop app): npm
  • Operating system: Debian 12

I’ve tried removing the node_modules as the Docs AI suggested.
I’ve tried completely removing n8n and fresh installing 1.123.24 and just keep hitting the same problem.

1 Like

This is a database migration conflict – the InstalledPackages table schema changed between 1.123.22 and 1.123.23/24, and the migration is failing to register the entity metadata before n8n tries to use it.

What’s happening: n8n uses TypeORM, and when it upgrades the DB schema, if a migration partially runs or the entity registration order is wrong, you get that “No metadata found” error even though the table might physically exist.

Fix steps:

  1. Check for a failed migration in your DB. Connect to your database and look at the migrations table:

    SELECT * FROM migrations ORDER BY timestamp DESC LIMIT 10;
    

    If the latest n8n migration has a failed/partial state, that’s the culprit.

  2. Try a clean upgrade path:

    • Stop n8n
    • Back up your database first (important)
    • Delete the n8n process cleanly, then start fresh with 1.123.24
    • n8n will attempt to re-run any pending migrations on startup
  3. If you’re on SQLite: The database file can get corrupted or locked during version upgrades. Run sqlite3 your-db.sqlite "PRAGMA integrity_check;" to verify.

  4. Nuclear option (if you don’t care about installed community packages): Drop and recreate the installed_packages and installed_nodes tables, then let n8n rebuild them. Your workflows won’t be affected, but you’ll need to reinstall community nodes.

What database are you using (SQLite, Postgres, MySQL)? That’ll narrow down the exact fix.

Hi @Lopalos Welcome!
I am not very sure but you can try preventing community nodes from loading at startup using this env variable:
N8N_COMMUNITY_PACKAGES_PREVENT_LOADING=true
Like ofc this is designed to prevent any corrupt node from failing the instance, although if the issue persists you can consider upgrading to 2.x.x versions.

So, I’m running SQLite as stated.

I already attempted a Clean Start, deleting n8n and reinstalling 1.123.24. I didn’t start with a Fresh Database. I did both the “npm uninstall -g n8n", reinstall and nuclear rm -rf /usr/local/lib/node_modules/n8n rm -f /usr/local/bin/n8n cache clean and reinstall.

Both failed with the "InstalledPackages”

:sqlite3 database.sqlite "PRAGMA integrity_check;"
ok

I downloaded my SQLite database and grabbed an Editor.

I checked both those tables “installed_packages” and “installed_nodes” which were both Empty. I deleted them anyway and uploaded that back to the server.

I ran the upgrade and got with the same issue.

I am not running any Community Packages in my build.

I am wanting to upgrade to 2.x.x but I’m not ready as of yet.

Compatibility report for version 2.0.0
6 of your 22 workflows are already compatible with version 2.0.0. Review the details below to understand and resolve any compatibility problems. Learn more about all breaking changes in our documentation ↗

So I’m working on those compatibility problems.

Downgraded to 1.123.22.

Last session crashed
Initializing n8n process
n8n ready on ::, port 5678
QueryFailedError: SQLITE_ERROR: no such table: installed_packages
    at handler (/usr/local/lib/node_modules/n8n/node_modules/src/driver/sqlite-pooled/SqliteLibrary.ts:147:29)
    at replacement (/usr/local/lib/node_modules/n8n/node_modules/sqlite3/lib/trace.js:25:27)
    at Statement.errBack (/usr/local/lib/node_modules/n8n/node_modules/sqlite3/lib/sqlite3.js:15:21)
Exiting due to an error.
SQLITE_ERROR: no such table: installed_packages

So, restored my database and I’m back up and running with 1.123.22

So, I’ve attempted to upgrade to…

1.123.25 & 1.123.26

npm install -g [email protected] && n8n start

Initializing n8n process
n8n ready on ::, port 5678
EntityMetadataNotFoundError: No metadata for “InstalledPackages” was found.
at DataSource.getMetadata (/usr/local/lib/node_modules/n8n/node_modules/src/data-source/DataSource.ts:417:30)
at InstalledPackagesRepository.get metadata [as metadata] (/usr/local/lib/node_modules/n8n/node_modules/src/repository/Repository.ts:52:40)
at InstalledPackagesRepository.find (/usr/local/lib/node_modules/n8n/node_modules/src/repository/Repository.ts:535:39)
at CommunityPackagesService.getAllInstalledPackages (/usr/local/lib/node_modules/n8n/src/modules/community-packages/community-packages.service.ts:115:48)
at CommunityPackagesService.checkForMissingPackages (/usr/local/lib/node_modules/n8n/src/modules/community-packages/community-packages.service.ts:305:40)
at CommunityPackagesService.init (/usr/local/lib/node_modules/n8n/src/modules/community-packages/community-packages.service.ts:96:14)
at Start.init (/usr/local/lib/node_modules/n8n/src/commands/base-command.ts:147:4)
at Start.init (/usr/local/lib/node_modules/n8n/src/commands/start.ts:202:3)
at CommandRegistry.execute (/usr/local/lib/node_modules/n8n/src/command-registry.ts:66:4)
at /usr/local/lib/node_modules/n8n/bin/n8n:63:2
Exiting due to an error.
No metadata for “InstalledPackages” was found.

I’ve then tried jumping from 1.123.22 to 1.123.26

npm install -g [email protected] && n8n start

Last session crashed
Initializing n8n process
n8n ready on ::, port 5678
EntityMetadataNotFoundError: No metadata for “InstalledPackages” was found.
at DataSource.getMetadata (/usr/local/lib/node_modules/n8n/node_modules/src/data-source/DataSource.ts:417:30)
at InstalledPackagesRepository.get metadata [as metadata] (/usr/local/lib/node_modules/n8n/node_modules/src/repository/Repository.ts:52:40)
at InstalledPackagesRepository.find (/usr/local/lib/node_modules/n8n/node_modules/src/repository/Repository.ts:535:39)
at CommunityPackagesService.getAllInstalledPackages (/usr/local/lib/node_modules/n8n/src/modules/community-packages/community-packages.service.ts:115:48)
at CommunityPackagesService.checkForMissingPackages (/usr/local/lib/node_modules/n8n/src/modules/community-packages/community-packages.service.ts:305:40)
at CommunityPackagesService.init (/usr/local/lib/node_modules/n8n/src/modules/community-packages/community-packages.service.ts:96:14)
at Start.init (/usr/local/lib/node_modules/n8n/src/commands/base-command.ts:147:4)
at Start.init (/usr/local/lib/node_modules/n8n/src/commands/start.ts:202:3)
at CommandRegistry.execute (/usr/local/lib/node_modules/n8n/src/command-registry.ts:66:4)
at /usr/local/lib/node_modules/n8n/bin/n8n:63:2
Exiting due to an error.
No metadata for “InstalledPackages” was found.

I honestly don’t want to delete my database, import my workflows and credentials and basically do what I’m thinking to upgrade to 2.0.

So, I started writing a GitHub issue because I’ve just been ignored which is a bit rude. But I clicked a link which opened in the ticket window and lost everything I was doing so I gave up with that.

I’ve just been waiting for new version to come out and 1.123.27 seems to have worked!

Initializing n8n process
n8n ready on ::, port 5678
n8n Task Broker ready on 127.0.0.1, port 5679

[license SDK] Skipping renewal on init: license cert is not due for renewal
Registered runner "JS Task Runner" (rNVur1tEmGfzztbz9YWRG)
Version: 1.123.27

I am now upgrading to 1.123.28 and see if that’s the same or not.

Initializing n8n process
n8n ready on ::, port 5678
n8n Task Broker ready on 127.0.0.1, port 5679

[license SDK] Skipping renewal on init: license cert is not due for renewal
Registered runner "JS Task Runner" (DwKp91SNN6BYzwycuyClp)
Version: 1.123.28

So… Whatever they did to 1.123.23/1.123.24/1.123.25 & 1.123.26. It’s fixed in 1.123.27 & 1.123.28

1 Like

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