fix: Fix issue preventing community nodes re-installing when using a custom registry#26599
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
There was a problem hiding this comment.
No issues found across 3 files
Architecture diagram
sequenceDiagram
participant CLI as CLI Command (Start/Worker)
participant License as License Service
participant Community as Community Packages Service
participant Registry as NPM/Custom Registry
Note over CLI,Registry: Startup Process (N8N_REINSTALL_MISSING_PACKAGES=true)
CLI->>CLI: base-command: init()
Note right of CLI: General setup (Config, DB, etc.)
CLI->>License: CHANGED: initLicense()
License-->>CLI: License status & features loaded
alt License is Valid
CLI->>CLI: NEW: initCommunityPackages()
CLI->>Community: init()
Community->>Community: Check license for custom registry support
opt Packages missing locally
Community->>Registry: Fetch package metadata/tarball
Registry-->>Community: Package data
Community->>Community: Install packages to .n8n/nodes
end
Community-->>CLI: Loading complete
else License Invalid / Missing
CLI->>CLI: NEW: initCommunityPackages()
CLI->>Community: init()
Note right of Community: Fails or restricts custom registry access
end
CLI->>CLI: Continue service startup (Auth, Workflow Engine, etc.)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When running n8n with
N8N_REINSTALL_MISSING_PACKAGES=trueandN8N_COMMUNITY_PACKAGES_REGISTRYset to a custom registry, community nodes are not reinstalled on upgrades because the license is not initialized until after community nodes are loaded.This PR changes the startup order so the license is initialized before community node installation is attempted.
Test Plan
Setup
Reproduce the bug (baseline)
Verify the fix
Related Linear tickets, Github issues, and Community forum posts
https://linear.app/n8n/issue/NODE-4553/community-nodes-unavailable-after-instance-restart
https://linear.app/n8n/issue/NODE-4028
https://linear.app/n8n/issue/NODE-4013
Review / Merge checklist
release/backport(if the PR is an urgent fix that needs to be backported)