Skip to content
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

fix(core): Prevent backend from loading duplicate copies of nodes packages #10979

Merged
merged 1 commit into from
Sep 26, 2024

Conversation

netroy
Copy link
Member

@netroy netroy commented Sep 26, 2024

Summary

Right now it's possible for someone to install n8n-nodes-base or @n8n/n8n-nodes-langchain as a community nodes, which starts messing up the n8n instance after they upgrade n8n, but older version of these packages are still around and being loaded into the app.

This PR

  1. Updates PackageDirectoryLoader to read the package name in the constructor, so that loader.packageName is available before we load any nodes/modules
  2. Updates LoadNodesAndCredentials to never load a package if a loader for the same package name is already in memory.

Related Linear tickets, Github issues, and Community forum posts

https://community.n8n.io/t/webhook-errors-after-updating/55083

Review / Merge checklist

  • PR title and summary are descriptive

@n8n-assistant n8n-assistant bot added core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team labels Sep 26, 2024
Copy link

cypress bot commented Sep 26, 2024

n8n    Run #7065

Run Properties:  status check passed Passed #7065  •  git commit 85fc3c0745: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 netroy 🗃️ e2e/*
Project n8n
Branch Review prevent-nodes-package-second-copies
Run status status check passed Passed #7065
Run duration 04m 22s
Commit git commit 85fc3c0745: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 netroy 🗃️ e2e/*
Committer कारतोफ्फेलस्क्रिप्ट™
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 1
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 433
View all changes introduced in this branch ↗︎

Copy link
Contributor

✅ All Cypress E2E specs passed

@netroy netroy merged commit 4584f22 into master Sep 26, 2024
35 checks passed
@netroy netroy deleted the prevent-nodes-package-second-copies branch September 26, 2024 18:29
This was referenced Oct 2, 2024
@janober
Copy link
Member

janober commented Oct 2, 2024

Got released with n8n@1.62.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team Released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants