Coder Social home page Coder Social logo

Comments (6)

MSP-Greg avatar MSP-Greg commented on May 9, 2024 2

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.

resp_info[:no_body] ||= status < 200 || STATUS_WITH_NO_ENTITY_BODY[status]

from puma.

dentarg avatar dentarg commented on May 9, 2024 2

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.

dentarg avatar dentarg commented on May 9, 2024

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.

taeyeob avatar taeyeob commented on May 9, 2024

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.

resp_info[:no_body] ||= status < 200 || STATUS_WITH_NO_ENTITY_BODY[status]

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.

dentarg avatar dentarg commented on May 9, 2024

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.

taeyeob avatar taeyeob commented on May 9, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.