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)
- 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
- NoMethodError: undefined method `release' for Rack:Module error at "rails s" initialization time HOT 5
- Staging environment, request.ENV['HTTP_HOST'] displays 2 urls when it should be a single url HOT 1
- HttpParserError raised when body (chunk) exceeds 4096 bytes does not end with "\r\n" HOT 4
- undefined method `log_writer' for #<Puma::Launcher on usin plugin :solid_queue in puma HOT 1
- `TestWorkerGemIndependence#test_changing_nio4r_version_during_phased_restart` fails in head builds
- Option to restrict cipher suites for TLS1.3
- Requests with a caret (`<` or `>`) in a query parameter raise a `Puma::HttpParserError` HOT 10
- Random freezes in dev mode
- Puma doesn't start the Rails app after run
- "undefined method `on_booted` for nil:NilClass" on "pumactl start" HOT 2
- Large number of workers are booting too long or not booting the first time HOT 4
- What options are not available when using `rails s`? HOT 1
- MAX_CHUNK_HEADER_SIZE = 4096 is too small for podman HOT 6
- Puma config get evaluated twice with pumactl HOT 3
- question about puma architecture
- Windows - Puma compiled without ssl support HOT 7
- Puma plugin in my Rails app
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.