Comments (6)
The error is in the line shown below, which indicates that the status being returned by your app is nil. The rack spec states that
"It must be an Integer greater than or equal to 100."
It seems the error is in the lowlevel_error_handler you've shown above. It must return a valid response.
Line 607 in cdb2341
from puma.
By the way, if you use a recent enough version of sentry-ruby, it will automatically monkey-patch Puma to capture the low-level errors.
So you don't need to capture the exception yourself in that case.
from puma.
Yes, since #3094 (Puma v6.4.0) the result of the lowlevel_error_handler
is sent as a response to the client.
By the way, if you use a recent enough version of sentry-ruby, it will automatically monkey-patch Puma to capture the low-level errors.
from puma.
By the way, if you use a recent enough version of sentry-ruby, it will automatically monkey-patch Puma to capture the low-level errors.
So you don't need to capture the exception yourself in that case.
The error is in the line shown below, which indicates that the status being returned by your app is nil. The rack spec states that "It must be an Integer greater than or equal to 100."
It seems the error is in the lowlevel_error_handler you've shown above. It must return a valid response.
Line 607 in cdb2341
Thanks to all :) It was my only experience to upgrade ruby all the way down from 2.5 to 3.2, so I didn't get a notice on what should I do to prepare for the change.
With your advise, I have commented out the lowlevel_error_handler part and this is my final output:
threads_min_count = ENV.fetch('RAILS_MIN_THREADS') { 0 }
threads_max_count = ENV.fetch('RAILS_MAX_THREADS') { 32 }
env = ENV.fetch('RAILS_ENV') { 'development' }
threads threads_min_count, threads_max_count
port ENV.fetch('PORT') { 3030 }
# development / staging / production
environment env
workers ENV.fetch('WEB_CONCURRENCY') { 1 } unless RUBY_PLATFORM =~ /mingw/
pidfile 'tmp/pids/puma.pid'
state_path 'tmp/pids/puma.state'
# lowlevel_error_handler do |ex, env, status|
# Sentry.capture_exception(
# ex,
# :message => ex.message,
# :extra => { :puma => env },
# :transaction => "Puma"
# )
# end
bind 'unix:///tmp/puma.sock' unless RUBY_PLATFORM =~ /mingw/
prune_bundler
# on_worker_boot do
# $hackle_client = Hackle.client(sdk_key: ENV['HACKLE_SDK_KEY'])
# end
Just to check for any misunderstandings that might have arisen from my poor English, could you please verify whether itis correct or if I've did the wrong way?
from puma.
Yes, exactly, that is the suggestion.
You can also still use lowlevel_error_handler
but the last line in it must be a proper response. The README has an example of that: https://github.com/puma/puma#error-handling
from puma.
Okay, I think I got the point.
I will try another if there is any further issues.
Thank you so much 😊😊
from puma.
Related Issues (20)
- `warn_if_in_single_mode` incorrectly triggers when `WEB_CONCURRENCY` >= 1
- Puma bundle error with v6.4 HOT 7
- `fork_worker` changes systemd status to `reloading` when reforking HOT 1
- Windows: puma_http11.so breaking when ruby folder is relocated HOT 16
- `--idle-timeout` should not shut down entire cluster if any single worker is idle HOT 1
- Puma responds with a 501 Server Error when a client sends invalid HTTP methods HOT 6
- Listen for HTTP and HTTPS on the same port, redirecting clients to HTTPS for easier local development HOT 4
- require puma/dsl not on the top HOT 2
- Phased restart & symlinks doesn't change destination folder? HOT 3
- Allow alternative schemes in Binder
- Support Ruby 3.3's `Process.warmup` before fork HOT 14
- Error responses written twice HOT 1
- Specify multiple licences in the gemspec? HOT 17
- Puma cluster not reaping child processes when PID is 1 with Puma 6.4.1 HOT 18
- High latency on puma HOT 2
- Puma and Puma Dev Linux issue
- Phased-Restart Causes Action Cable Connection Loss on Rails App Restart HOT 3
- Add a hook for "before shutdown" HOT 6
- Systemd watchdog kills puma during hot restart. HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from puma.