phusion / passenger

A fast and robust web server and application server for Ruby, Python and Node.js
https://www.phusionpassenger.com/
MIT License
5k stars 547 forks source link

params are empty upon proper form submission #2534

Closed daBee closed 6 months ago

daBee commented 6 months ago

Issue report

Are you sure this is a bug in Passenger? It seems something in this stack is keeping params from being received. Chrome is reporting a proper form submission with good data, result 200.

Question 1: What is the problem? I'm expecting params to get to a post route.

<form method="post" class="form" name="carrier" id="form1" action="/login">
    <div class="row align-items-center">
        <div class="col-auto">
            <label for="s_uname" class="col-form-label">Username</label>
        </div>
        <div class="col-auto">
            <input type="text" class="form-control" id="s_uname" name="s_uname" required="" value="">
        </div>

        <div class="col-auto">
            <label for="s_pw" class="col-form-label">Password</label>
        </div>
        <div class="col-auto">
            <input type="password" class="form-control" id="s_pw" name="s_pw" required="" value="">
        </div>

                <input type="hidden" class="form-control" name="s_type" value="carrier">

        <div class="col-auto">
            <button type="submit" id="mybutton1" class="btn btn-primary">Log in</button>
        </div>
    </div>
</form>

post "/login" do
  puts '/login here'
  puts params
  (other logic)
  erb :"account/login"
end

I expect params to present in my route.

params are always empty.

Not even sure how I produced it. I have some other middleware in my configure block that might be a culprit.

RF: My Passenger Standalone Info Script brew info nginx --with-passenger

==> nginx: stable 1.25.4 (bottled), HEAD HTTP(S) server and reverse proxy, and IMAP/POP3 proxy server https://nginx.org/ /opt/homebrew/Cellar/nginx/1.25.4 (26 files, 2.4MB) * Poured from bottle using the formulae.brew.sh API on 2024-03-17 at 06:50:31 From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/n/nginx.rb License: BSD-2-Clause ==> Dependencies Required: openssl@3 ✔, pcre2 ✔ ==> Options --HEAD Install HEAD version ==> Caveats Docroot is: /opt/homebrew/var/www

The default port has been set in /opt/homebrew/etc/nginx/nginx.conf to 8080 so that nginx can run without sudo.

nginx will load all files in /opt/homebrew/etc/nginx/servers/.

To restart nginx after an upgrade: brew services restart nginx Or, if you don't want/need a background service you can just run: /opt/homebrew/opt/nginx/bin/nginx -g daemon\ off\; ==> Analytics install: 13,766 (30 days), 34,402 (90 days), 179,574 (365 days) install-on-request: 13,748 (30 days), 34,296 (90 days), 179,202 (365 days) build-error: 5 (30 days)

brew info passenger

==> passenger: stable 6.0.20 (bottled), HEAD Server for Ruby, Python, and Node.js apps via Apache/NGINX https://www.phusionpassenger.com/ /opt/homebrew/Cellar/passenger/6.0.20_1 (5,207 files, 209.8MB) * Poured from bottle using the formulae.brew.sh API on 2024-03-17 at 06:50:46 From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/p/passenger.rb License: MIT ==> Dependencies Build: httpd ✘, nginx ✔ Required: apr ✔, apr-util ✔, openssl@3 ✔, pcre ✔, pcre2 ✔ ==> Options --HEAD Install HEAD version ==> Caveats To activate Phusion Passenger for Nginx, run: brew install nginx And add the following to /opt/homebrew/etc/nginx/nginx.conf at the top scope (outside http{}): load_module /opt/homebrew/opt/passenger/libexec/modules/ngx_http_passenger_module.so; And add the following to /opt/homebrew/etc/nginx/nginx.conf in the http scope: passenger_root /opt/homebrew/opt/passenger/libexec/src/ruby_supportlib/phusion_passenger/locations.ini; passenger_ruby /usr/bin/ruby;

To activate Phusion Passenger for Apache, create /etc/apache2/other/passenger.conf: LoadModule passenger_module /opt/homebrew/opt/passenger/libexec/buildout/apache2/mod_passenger.so PassengerRoot /opt/homebrew/opt/passenger/libexec/src/ruby_supportlib/phusion_passenger/locations.ini PassengerDefaultRuby /usr/bin/ruby ==> Analytics install: 117 (30 days), 537 (90 days), 2,046 (365 days) install-on-request: 116 (30 days), 529 (90 days), 2,002 (365 days) build-error: 0 (30 days)

Homebrew installation passenger_files_comparator.rb

Suggested / current / suggested exists?: load_module /opt/homebrew/opt/passenger/libexec/modules/ngx_http_passenger_module.so; load_module /opt/homebrew/opt/passenger/libexec/modules/ngx_http_passenger_module.so; Suggested load_module exists: true

passenger_root /opt/homebrew/opt/passenger/libexec/src/ruby_supportlib/phusion_passenger/locations.ini; passenger_root /opt/homebrew/opt/passenger/libexec/src/ruby_supportlib/phusion_passenger/locations.ini; Suggested passenger_root exists: true

passenger_ruby /usr/bin/ruby; passenger_ruby /Users/rich/.rbenv/shims/ruby; # passinfo in terminal DIFFERENT Suggested passenger_ruby exists: true

Ruby Info (programming language):

/Users/rich/.rbenv/shims/ruby ruby 3.2.2 (2023-03-30 revision e51014f9c0) [arm64-darwin22] nginx version:

nginx version: nginx/1.25.4 OS Version:

ProductName: macOS ProductVersion: 14.4 BuildVersion: 23E214 Software:

System Software Overview:

  System Version: macOS 14.4 (23E214)
  Kernel Version: Darwin 23.4.0
  Boot Volume: Primer
  Boot Mode: Normal
  Computer Name: HQ3
  User Name: Rich (rich)
  Secure Virtual Memory: Enabled
  System Integrity Protection: Enabled
  Time since boot: 1 day, 1 hour, 10 minutes

Question 4: Passenger installation method:** ( X ) OS X Homebrew

Question 5: Your app's programming language (including any version managers) and framework (including versions): ruby 3.2.2 (2023-03-30 revision e51014f9c0) [arm64-darwin22]

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

Question 7: Anything else about your setup that we should know? Nothing that I know of at this point.

daBee commented 6 months ago

Rack::Lint was the culprit which threw no errors. Turned it off and it worked.