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

Passenger will not preload rack app after Bundler 2.5.11, if correct bundler is not installed #2567

Open
1 of 7 tasks
madwire opened this issue Oct 2, 2024 · 11 comments · May be fixed by #2576
Open
1 of 7 tasks

Passenger will not preload rack app after Bundler 2.5.11, if correct bundler is not installed #2567

madwire opened this issue Oct 2, 2024 · 11 comments · May be fixed by #2576
Milestone

Comments

@madwire
Copy link

madwire commented Oct 2, 2024

Issue report

Please try with the newest version of Passenger to avoid issues that have already been fixed

Question 1: What is the problem?

I don't know what changed between RubyGems 3.5.11 and 3.5.12. But from 3.5.12 onwards, passenger will not load any rack app, and I've tested most versions, including the latest, 3.5.20. If I switch back to 3.5.11, everything starts working again.

RubyGems v3.5.12 +

App output: /usr/local/bin/ruby: No such file or directory -- Passenger AppPreloader: /app/path (LoadError)

Note: that the app directory had a Gemfile (and lock) in it, but I rewrote the config.ru to remove rails and the app it self from my test.

config.ru:

run do |env|
  [200, {}, ["Hello World"]]
end

Your answer:

Question 2: Passenger version and integration mode:

  • open source 6.0.23 standalone

Your answer:

Question 3: OS or Linux distro, platform (including version):

  • Debian GNU/Linux 12 (bookworm), x86_64 and aarch64

Your answer:

Question 4: Passenger installation method:

Your answer:

  • RubyGems + Gemfile
  • RubyGems, no Gemfile
  • Phusion APT repo
  • Phusion YUM repo
  • OS X Homebrew
  • source tarball
  • Other, please specify:

Question 5: Your app's programming language (including any version managers) and framework (including versions):

  • Ruby 3.3.5, Rails 7.1.x but in my tests I used an hello world rackup app.

Your answer:

Question 6: Are you using a PaaS and/or containerization? If so which one?

  • Docker-based on the official ruby image
@CamJN
Copy link
Member

CamJN commented Oct 2, 2024

This is similar to the issue with the recent versions of bundler. It was discovered in this bug that you have to have a matching version of bundler installed to what your Gemfile.lock says for BUNDLED WITH.

However I see you're not using a Gemfile at all, so that shouldn't be the problem… unless somehow rubygems has developed a dependency on bundler internally and is somehow unable to work without a Gemfile.

@rossholdway
Copy link

Also ran in to this same issue with Phusion Passenger (6.0.23), Ruby (3.3.5) and Rails 7.1.

When using RubyGems 3.5.16, app won't spawn, giving the following:

/usr/local/rvm/rubies/ruby-3.3.5/bin/ruby: No such file or directory -- Passenger AppPreloader: /app/path (LoadError)

Downgrading with gem update --system 3.5.11 as @madwire suggested works, but not ideal.

@CamJN
Copy link
Member

CamJN commented Nov 9, 2024

Can either of you check if an earlier version of Passenger does not exhibit the same behaviour?

@afriqs
Copy link

afriqs commented Nov 12, 2024

Hi,

We encountered a similar issue and here are some tests we performed in order to find out what happens with one of our apps.

Everything is fine 👍 with ruby 3.3.4 (2.5.11 != 2.5.22):

~$ rbenv version
3.3.4
~$ bundle -v
Bundler version 2.5.11
~$ cd apps/my-app/current
~/apps/my-app/current$ grep -A1 'BUNDLED WITH' Gemfile.lock |tail -n1|awk '{print $1}'
2.5.22
~/apps/my-app/current$ bundle -v
Bundler version 2.5.22

App does not start 👎 with ruby 3.3.5 (2.5.16 != 2.5.22):

~$ rbenv version
3.3.5
~$ bundle -v
Bundler version 2.5.16
~$ cd apps/my-app/current
~/apps/my-app/current$ grep -A1 'BUNDLED WITH' Gemfile.lock |tail -n1|awk '{print $1}'
2.5.22
~/apps/my-app/current$ bundle -v
Bundler version 2.5.22

Even if we update rubygems to the latest version 👎 (2.5.23 != 2.5.22):

~/apps/my-app/current$ gem update --system
[...]
~$ rbenv version
3.3.5
~$ bundle -v
Bundler version 2.5.23
~$ cd apps/my-app/current
~/apps/my-app/current$ grep -A1 'BUNDLED WITH' Gemfile.lock |tail -n1|awk '{print $1}'
2.5.22
~/apps/my-app/current$ bundle -v
Bundler version 2.5.22

But it works 👍 if we install the version of bundler specified by BUNDLED WITH:

~$ gem install bundler -v 2.5.22
Fetching bundler-2.5.22.gem
Successfully installed bundler-2.5.22
1 gem installed
~$ gem list|grep bundler
bundler (default: 2.5.23, 2.5.22)

So it seems that since ruby 3.3.5 (tested also with 3.3.6), the version of ruby must have bundler with exact BUNDLED WITH version installed 🤔

ℹ️

$ dpkg -l |grep passenger
ii  libnginx-mod-http-passenger          1:6.0.23-1~bullseye1                 amd64        Nginx integration for Passenger application server
ii  passenger                            1:6.0.23-1~bullseye1                 amd64        Application server for Ruby, Node.js, Python, Meteor
ii  passenger-dev                        1:6.0.23-1~bullseye1                 amd64        Dependencies for compiling an Nginx module
ii  passenger-doc                        1:6.0.23-1~bullseye1                 all          Documentation for Passenger application server

@afriqs
Copy link

afriqs commented Nov 12, 2024

When I keep on using ruby 3.3.4 our app works fine with bundler 2.5.11 but not with 2.5.12.

Hope it helps.

@CamJN
Copy link
Member

CamJN commented Nov 25, 2024

Can this still be reproduced? I created a minimal environment and it didn't reproduce for me:

Dockerfile:

FROM ruby:3.3.6
RUN echo 'run do |env| [200, {}, ["Hello World"]] end' > config.ru
RUN gem install passenger --no-document
CMD passenger start

Test:

docker build -t rubygems_bug .
docker run -p 3000:3000 rubygems_bug
# in another terminal tab:
curl http://localhost:3000/

@jasonperrone
Copy link

Happens to me too. I thought it was Ruby 3.3.6, didn't think about ruby gems.

@jasonperrone
Copy link

So yes, in my case the problem was that my installed bundler gem was a slightly different version than what was specified in Gemfile.lock. I installed the correct bundler and now it's fine. In the past when my bundler versions were out of sync with the Gemfile.lock the error messaged told you so. (you have specified version x.y.z in your Gemfile but have z.y.x installed). Now you get that error about ruby not found.

@CamJN
Copy link
Member

CamJN commented Nov 27, 2024

@afriqs so you are using bundler, that's a known issue with bundler, I'm trying to figure out if anyone can still reproduce this without bundler, just rubygems. @rossholdway and @madwire can you confirm whether you can still reproduce this issue using rubygems but not bundler (no gemfile, no bundle exec, etc)?

@madwire
Copy link
Author

madwire commented Dec 2, 2024

@CamJN I can only reproduce this with a mismatched version of the installed bundler and gemfile.lock reference,

@CamJN
Copy link
Member

CamJN commented Dec 2, 2024

Ok, thanks. Looks like it is related to the bundler change then.

@CamJN CamJN changed the title Passenger will not preload rack app after RubyGems 3.5.11 Passenger will not preload rack app after Bundler 2.5.11, if correct bundler is not installed Dec 2, 2024
@CamJN CamJN linked a pull request Dec 2, 2024 that will close this issue
@CamJN CamJN added this to the 6.0.25 milestone Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants