Skip to content

Fix incompatible addon version activation when Bundler.setup fails after retry#3963

Merged
KaanOzkan merged 1 commit intomainfrom
ko/incompatible-activation
Feb 18, 2026
Merged

Fix incompatible addon version activation when Bundler.setup fails after retry#3963
KaanOzkan merged 1 commit intomainfrom
ko/incompatible-activation

Conversation

@KaanOzkan
Copy link
Contributor

When Bundler.setup raises GemNotFound or GitError and the retry has already been attempted (or install_error is set), the rescue block fell through without setting setup_error. This caused the server to boot thinking setup succeeded, bypassing the load_addons guard. Without Bundler constraining Gem.find_files, every installed version of every addon gem was discovered, leading to version mismatches (e.g., ruby-lsp-rails 0.4.2 loaded with ruby-lsp 0.26.5) and ArgumentError crashes.

The StandardError rescue already handled this correctly - this aligns the GemNotFound/GitError rescue to do the same.

Motivation

Resolves errors that may occur from activating incorrect add-on versions. Instead of getting error reports we can not load the add-ons in the first place.

Implementation

Set setup_error and adjust the LOAD_PATH similar to StandardError case.

Automated Tests

Manual Tests

…ter retry

When Bundler.setup raises GemNotFound or GitError and the retry has
already been attempted (or install_error is set), the rescue block fell
through without setting setup_error. This caused the server to boot
thinking setup succeeded, bypassing the load_addons guard. Without
Bundler constraining Gem.find_files, every installed version of every
addon gem was discovered, leading to version mismatches
(e.g., ruby-lsp-rails 0.4.2 loaded with ruby-lsp 0.26.5) and ArgumentError
crashes.

The StandardError rescue already handled this correctly - this aligns
the GemNotFound/GitError rescue to do the same.
@KaanOzkan KaanOzkan added the bugfix This PR will fix an existing bug label Feb 18, 2026
@KaanOzkan KaanOzkan marked this pull request as ready for review February 18, 2026 13:33
@KaanOzkan KaanOzkan requested a review from a team as a code owner February 18, 2026 13:34
@vinistock vinistock added the server This pull request should be included in the server gem's release notes label Feb 18, 2026
@KaanOzkan KaanOzkan merged commit 0e7c0c3 into main Feb 18, 2026
37 of 39 checks passed
@KaanOzkan KaanOzkan deleted the ko/incompatible-activation branch February 18, 2026 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix This PR will fix an existing bug server This pull request should be included in the server gem's release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants