scoutapp / scout_apm_ruby

ScoutAPM Ruby Agent. Supports Rails, Sinatra, Grape, Rack, and many other frameworks
https://scoutapm.com
Other
201 stars 97 forks source link

Exception in Grape instruments #510

Closed curtis closed 1 week ago

curtis commented 1 month ago

We're seeing an exception with one of our Grape endpoints after adding Scout APM. This exception does not happen in the development environment, when SCOUT_MONITOR is false, or when Grape instruments are disabled in scout_apm.yml. For now, we have followed the instructions to disable Grape instrumentation as noted in this issue.

Gem Versions

Rails 6.1.7.8 Grape 2.1.3 Scout 5.3.8

Backtrace

/gems/grape-2.1.3/lib/grape/middleware/error.rb:82 in rescue_handler_for_base_only_class
/gems/grape-2.1.3/lib/grape/middleware/error.rb:59 in find_handler
/gems/grape-2.1.3/lib/grape/middleware/error.rb:36 in rescue in call!
/gems/grape-2.1.3/lib/grape/middleware/error.rb:32 in call!
/gems/grape-2.1.3/lib/grape/middleware/base.rb:27 in call
/gems/rack-2.2.9/lib/rack/head.rb:12 in call
/gems/grape-2.1.3/lib/grape/endpoint.rb:225 in call!
/gems/grape-2.1.3/lib/grape/endpoint.rb:219 in call
/gems/grape-2.1.3/lib/grape/router/route.rb:19 in exec
/gems/grape-2.1.3/lib/grape/router.rb:121 in process_route
/gems/grape-2.1.3/lib/grape/router.rb:68 in block in identity
/gems/grape-2.1.3/lib/grape/router.rb:101 in transaction
/gems/grape-2.1.3/lib/grape/router.rb:66 in identity
/gems/grape-2.1.3/lib/grape/router.rb:50 in block in call
/gems/grape-2.1.3/lib/grape/router.rb:137 in with_optimization
/gems/grape-2.1.3/lib/grape/router.rb:49 in call
/gems/grape-2.1.3/lib/grape/api/instance.rb:164 in call
/gems/grape-2.1.3/lib/grape/api/instance.rb:68 in call!
/gems/grape-2.1.3/lib/grape/api/instance.rb:63 in call
/gems/grape-2.1.3/lib/grape/api.rb:78 in call
/gems/actionpack-6.1.7.8/lib/action_dispatch/routing/mapper.rb:20 in block in <class:Constraints>
/gems/actionpack-6.1.7.8/lib/action_dispatch/routing/mapper.rb:49 in serve
/gems/actionpack-6.1.7.8/lib/action_dispatch/journey/router.rb:50 in block in serve
/gems/actionpack-6.1.7.8/lib/action_dispatch/journey/router.rb:32 in each
/gems/actionpack-6.1.7.8/lib/action_dispatch/journey/router.rb:32 in serve
/gems/actionpack-6.1.7.8/lib/action_dispatch/routing/route_set.rb:842 in call
/gems/scout_apm-5.3.8/lib/scout_apm/instruments/rails_router.rb:29 in call_with_scout_instruments
/gems/omniauth-2.1.2/lib/omniauth/strategy.rb:202 in call!
/gems/omniauth-2.1.2/lib/omniauth/strategy.rb:169 in call
/gems/omniauth-2.1.2/lib/omniauth/strategy.rb:202 in call!
/gems/omniauth-2.1.2/lib/omniauth/strategy.rb:169 in call
/gems/omniauth-2.1.2/lib/omniauth/strategy.rb:202 in call!
/gems/omniauth-2.1.2/lib/omniauth/strategy.rb:169 in call
/gems/dragonfly-1.4.0/lib/dragonfly/middleware.rb:14 in call
/gems/scout_apm-5.3.8/lib/scout_apm/middleware.rb:17 in call
/gems/rack-attack-6.7.0/lib/rack/attack.rb:103 in call
/gems/warden-1.2.9/lib/warden/manager.rb:36 in block in call
/gems/warden-1.2.9/lib/warden/manager.rb:34 in catch
/gems/warden-1.2.9/lib/warden/manager.rb:34 in call
/gems/rack-2.2.9/lib/rack/tempfile_reaper.rb:15 in call
/gems/rack-2.2.9/lib/rack/etag.rb:27 in call
/gems/rack-2.2.9/lib/rack/conditional_get.rb:27 in call
/gems/rack-2.2.9/lib/rack/head.rb:12 in call
/gems/actionpack-6.1.7.8/lib/action_dispatch/http/permissions_policy.rb:22 in call
/gems/actionpack-6.1.7.8/lib/action_dispatch/http/content_security_policy.rb:19 in call
/gems/rack-2.2.9/lib/rack/session/abstract/id.rb:266 in context
/gems/rack-2.2.9/lib/rack/session/abstract/id.rb:260 in call
/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/cookies.rb:697 in call
/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/callbacks.rb:27 in block in call
/gems/activesupport-6.1.7.8/lib/active_support/callbacks.rb:98 in run_callbacks
/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/callbacks.rb:26 in call
/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/actionable_exceptions.rb:18 in call
/gems/airbrake-13.0.4/lib/airbrake/rack/middleware.rb:34 in call!
/gems/airbrake-13.0.4/lib/airbrake/rack/middleware.rb:23 in call
/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/debug_exceptions.rb:29 in call
/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/show_exceptions.rb:33 in call
/gems/turbolinks_render-0.9.21/lib/turbolinks_render/middleware.rb:81 in call
/gems/lograge-0.13.0/lib/lograge/rails_ext/rack/logger.rb:18 in call_app
/gems/railties-6.1.7.8/lib/rails/rack/logger.rb:26 in block in call
/gems/activesupport-6.1.7.8/lib/active_support/tagged_logging.rb:99 in block in tagged
/gems/activesupport-6.1.7.8/lib/active_support/tagged_logging.rb:37 in tagged
/gems/activesupport-6.1.7.8/lib/active_support/tagged_logging.rb:99 in tagged
/gems/railties-6.1.7.8/lib/rails/rack/logger.rb:26 in call
/gems/sprockets-rails-3.5.2/lib/sprockets/rails/quiet_assets.rb:17 in call
/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/remote_ip.rb:81 in call
/gems/request_store-1.7.0/lib/request_store/middleware.rb:19 in call
/gems/rack-timeout-0.6.3/lib/rack/timeout/core.rb:148 in block in call
/gems/rack-timeout-0.6.3/lib/rack/timeout/support/timeout.rb:19 in timeout
/gems/rack-timeout-0.6.3/lib/rack/timeout/core.rb:147 in call
/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/request_id.rb:26 in call
/gems/rack-2.2.9/lib/rack/method_override.rb:24 in call
/gems/rack-2.2.9/lib/rack/runtime.rb:22 in call
/gems/activesupport-6.1.7.8/lib/active_support/cache/strategy/local_cache_middleware.rb:29 in call
/gems/rack-rewrite-1.5.1/lib/rack/rewrite.rb:24 in call
/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/executor.rb:14 in call
/gems/rack-cache-1.14.0/lib/rack/cache/context.rb:141 in forward
/gems/rack-cache-1.14.0/lib/rack/cache/context.rb:267 in fetch
/gems/rack-cache-1.14.0/lib/rack/cache/context.rb:196 in lookup
/gems/rack-cache-1.14.0/lib/rack/cache/context.rb:67 in call!
/gems/rack-cache-1.14.0/lib/rack/cache/context.rb:52 in call
/gems/rack-2.2.9/lib/rack/deflater.rb:44 in call
/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/static.rb:24 in call
/gems/dragonfly-1.4.0/lib/dragonfly/cookie_monster.rb:9 in call
/gems/rack-2.2.9/lib/rack/sendfile.rb:110 in call
/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/ssl.rb:77 in call
/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/host_authorization.rb:142 in call
/gems/scout_apm-5.3.8/lib/scout_apm/instruments/middleware_summary.rb:58 in call
/gems/railties-6.1.7.8/lib/rails/engine.rb:539 in call
/gems/puma-6.4.2/lib/puma/configuration.rb:272 in call
/gems/puma-6.4.2/lib/puma/request.rb:100 in block in handle_request
/gems/puma-6.4.2/lib/puma/thread_pool.rb:378 in with_force_shutdown
/gems/puma-6.4.2/lib/puma/request.rb:99 in handle_request
/gems/puma-6.4.2/lib/puma/server.rb:464 in process_client
/gems/puma-6.4.2/lib/puma/server.rb:245 in block in run
/gems/puma-6.4.2/lib/puma/thread_pool.rb:155 in block in spawn_thread
Caused by NameError: undefined local variable or method `logger' for #<Class:0x000055b3ccd8dfd0> in `/api/:version/static_options' endpoint
/gems/scout_apm-5.3.8/lib/scout_apm/instruments/grape.rb:56 in rescue in run_with_scout_instruments
/gems/scout_apm-5.3.8/lib/scout_apm/instruments/grape.rb:48 in run_with_scout_instruments
/gems/grape-2.1.3/lib/grape/endpoint.rb:317 in block in build_stack
/gems/grape-2.1.3/lib/grape/middleware/base.rb:34 in call!
/gems/grape-2.1.3/lib/grape/middleware/base.rb:27 in call
/gems/grape-2.1.3/lib/grape/middleware/base.rb:34 in call!
/gems/grape-2.1.3/lib/grape/middleware/base.rb:27 in call
/gems/grape-2.1.3/lib/grape/middleware/error.rb:34 in block in call!
/gems/grape-2.1.3/lib/grape/middleware/error.rb:34 in catch
/gems/grape-2.1.3/lib/grape/middleware/error.rb:34 in call!
/gems/grape-2.1.3/lib/grape/middleware/base.rb:27 in call
/gems/rack-2.2.9/lib/rack/head.rb:12 in call
/gems/grape-2.1.3/lib/grape/endpoint.rb:225 in call!
/gems/grape-2.1.3/lib/grape/endpoint.rb:219 in call
/gems/grape-2.1.3/lib/grape/router/route.rb:19 in exec
/gems/grape-2.1.3/lib/grape/router.rb:121 in process_route
/gems/grape-2.1.3/lib/grape/router.rb:68 in block in identity
/gems/grape-2.1.3/lib/grape/router.rb:101 in transaction
/gems/grape-2.1.3/lib/grape/router.rb:66 in identity
/gems/grape-2.1.3/lib/grape/router.rb:50 in block in call
/gems/grape-2.1.3/lib/grape/router.rb:137 in with_optimization
/gems/grape-2.1.3/lib/grape/router.rb:49 in call
/gems/grape-2.1.3/lib/grape/api/instance.rb:164 in call
/gems/grape-2.1.3/lib/grape/api/instance.rb:68 in call!
/gems/grape-2.1.3/lib/grape/api/instance.rb:63 in call
/gems/grape-2.1.3/lib/grape/api.rb:78 in call
/gems/actionpack-6.1.7.8/lib/action_dispatch/routing/mapper.rb:20 in block in <class:Constraints>
/gems/actionpack-6.1.7.8/lib/action_dispatch/routing/mapper.rb:49 in serve
/gems/actionpack-6.1.7.8/lib/action_dispatch/journey/router.rb:50 in block in serve
/gems/actionpack-6.1.7.8/lib/action_dispatch/journey/router.rb:32 in each
/gems/actionpack-6.1.7.8/lib/action_dispatch/journey/router.rb:32 in serve
/gems/actionpack-6.1.7.8/lib/action_dispatch/routing/route_set.rb:842 in call
/gems/scout_apm-5.3.8/lib/scout_apm/instruments/rails_router.rb:29 in call_with_scout_instruments
/gems/omniauth-2.1.2/lib/omniauth/strategy.rb:202 in call!
/gems/omniauth-2.1.2/lib/omniauth/strategy.rb:169 in call
/gems/omniauth-2.1.2/lib/omniauth/strategy.rb:202 in call!
/gems/omniauth-2.1.2/lib/omniauth/strategy.rb:169 in call
/gems/omniauth-2.1.2/lib/omniauth/strategy.rb:202 in call!
/gems/omniauth-2.1.2/lib/omniauth/strategy.rb:169 in call
/gems/dragonfly-1.4.0/lib/dragonfly/middleware.rb:14 in call
/gems/scout_apm-5.3.8/lib/scout_apm/middleware.rb:17 in call
/gems/rack-attack-6.7.0/lib/rack/attack.rb:103 in call
/gems/warden-1.2.9/lib/warden/manager.rb:36 in block in call
/gems/warden-1.2.9/lib/warden/manager.rb:34 in catch
/gems/warden-1.2.9/lib/warden/manager.rb:34 in call
/gems/rack-2.2.9/lib/rack/tempfile_reaper.rb:15 in call
/gems/rack-2.2.9/lib/rack/etag.rb:27 in call
/gems/rack-2.2.9/lib/rack/conditional_get.rb:27 in call
/gems/rack-2.2.9/lib/rack/head.rb:12 in call
/gems/actionpack-6.1.7.8/lib/action_dispatch/http/permissions_policy.rb:22 in call
/gems/actionpack-6.1.7.8/lib/action_dispatch/http/content_security_policy.rb:19 in call
/gems/rack-2.2.9/lib/rack/session/abstract/id.rb:266 in context
/gems/rack-2.2.9/lib/rack/session/abstract/id.rb:260 in call
/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/cookies.rb:697 in call
/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/callbacks.rb:27 in block in call
/gems/activesupport-6.1.7.8/lib/active_support/callbacks.rb:98 in run_callbacks
/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/callbacks.rb:26 in call
/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/actionable_exceptions.rb:18 in call
/gems/airbrake-13.0.4/lib/airbrake/rack/middleware.rb:34 in call!
/gems/airbrake-13.0.4/lib/airbrake/rack/middleware.rb:23 in call
/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/debug_exceptions.rb:29 in call
/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/show_exceptions.rb:33 in call
/gems/turbolinks_render-0.9.21/lib/turbolinks_render/middleware.rb:81 in call
/gems/lograge-0.13.0/lib/lograge/rails_ext/rack/logger.rb:18 in call_app
/gems/railties-6.1.7.8/lib/rails/rack/logger.rb:26 in block in call
/gems/activesupport-6.1.7.8/lib/active_support/tagged_logging.rb:99 in block in tagged
/gems/activesupport-6.1.7.8/lib/active_support/tagged_logging.rb:37 in tagged
/gems/activesupport-6.1.7.8/lib/active_support/tagged_logging.rb:99 in tagged
/gems/railties-6.1.7.8/lib/rails/rack/logger.rb:26 in call
/gems/sprockets-rails-3.5.2/lib/sprockets/rails/quiet_assets.rb:17 in call
/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/remote_ip.rb:81 in call
/gems/request_store-1.7.0/lib/request_store/middleware.rb:19 in call
/gems/rack-timeout-0.6.3/lib/rack/timeout/core.rb:148 in block in call
/gems/rack-timeout-0.6.3/lib/rack/timeout/support/timeout.rb:19 in timeout
/gems/rack-timeout-0.6.3/lib/rack/timeout/core.rb:147 in call
/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/request_id.rb:26 in call
/gems/rack-2.2.9/lib/rack/method_override.rb:24 in call
/gems/rack-2.2.9/lib/rack/runtime.rb:22 in call
/gems/activesupport-6.1.7.8/lib/active_support/cache/strategy/local_cache_middleware.rb:29 in call
/gems/rack-rewrite-1.5.1/lib/rack/rewrite.rb:24 in call
/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/executor.rb:14 in call
/gems/rack-cache-1.14.0/lib/rack/cache/context.rb:141 in forward
/gems/rack-cache-1.14.0/lib/rack/cache/context.rb:267 in fetch
/gems/rack-cache-1.14.0/lib/rack/cache/context.rb:196 in lookup
/gems/rack-cache-1.14.0/lib/rack/cache/context.rb:67 in call!
/gems/rack-cache-1.14.0/lib/rack/cache/context.rb:52 in call
/gems/rack-2.2.9/lib/rack/deflater.rb:44 in call
/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/static.rb:24 in call
/gems/dragonfly-1.4.0/lib/dragonfly/cookie_monster.rb:9 in call
/gems/rack-2.2.9/lib/rack/sendfile.rb:110 in call
/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/ssl.rb:77 in call
/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/host_authorization.rb:142 in call
/gems/scout_apm-5.3.8/lib/scout_apm/instruments/middleware_summary.rb:58 in call
/gems/railties-6.1.7.8/lib/rails/engine.rb:539 in call
/gems/puma-6.4.2/lib/puma/configuration.rb:272 in call
/gems/puma-6.4.2/lib/puma/request.rb:100 in block in handle_request
/gems/puma-6.4.2/lib/puma/thread_pool.rb:378 in with_force_shutdown
/gems/puma-6.4.2/lib/puma/request.rb:99 in handle_request
/gems/puma-6.4.2/lib/puma/server.rb:464 in process_client
/gems/puma-6.4.2/lib/puma/server.rb:245 in block in run
/gems/puma-6.4.2/lib/puma/thread_pool.rb:155 in block in spawn_thread
Caused by NoMethodError: undefined method `first' for nil:NilClass
/gems/scout_apm-5.3.8/lib/scout_apm/instruments/grape.rb:50 in run_with_scout_instruments
/gems/grape-2.1.3/lib/grape/endpoint.rb:317 in block in build_stack
/gems/grape-2.1.3/lib/grape/middleware/base.rb:34 in call!
/gems/grape-2.1.3/lib/grape/middleware/base.rb:27 in call
/gems/grape-2.1.3/lib/grape/middleware/base.rb:34 in call!
/gems/grape-2.1.3/lib/grape/middleware/base.rb:27 in call
/gems/grape-2.1.3/lib/grape/middleware/error.rb:34 in block in call!
/gems/grape-2.1.3/lib/grape/middleware/error.rb:34 in catch
/gems/grape-2.1.3/lib/grape/middleware/error.rb:34 in call!
/gems/grape-2.1.3/lib/grape/middleware/base.rb:27 in call
/gems/rack-2.2.9/lib/rack/head.rb:12 in call
/gems/grape-2.1.3/lib/grape/endpoint.rb:225 in call!
/gems/grape-2.1.3/lib/grape/endpoint.rb:219 in call
/gems/grape-2.1.3/lib/grape/router/route.rb:19 in exec
/gems/grape-2.1.3/lib/grape/router.rb:121 in process_route
/gems/grape-2.1.3/lib/grape/router.rb:68 in block in identity
/gems/grape-2.1.3/lib/grape/router.rb:101 in transaction
/gems/grape-2.1.3/lib/grape/router.rb:66 in identity
/gems/grape-2.1.3/lib/grape/router.rb:50 in block in call
/gems/grape-2.1.3/lib/grape/router.rb:137 in with_optimization
/gems/grape-2.1.3/lib/grape/router.rb:49 in call
/gems/grape-2.1.3/lib/grape/api/instance.rb:164 in call
/gems/grape-2.1.3/lib/grape/api/instance.rb:68 in call!
/gems/grape-2.1.3/lib/grape/api/instance.rb:63 in call
/gems/grape-2.1.3/lib/grape/api.rb:78 in call
/gems/actionpack-6.1.7.8/lib/action_dispatch/routing/mapper.rb:20 in block in <class:Constraints>
/gems/actionpack-6.1.7.8/lib/action_dispatch/routing/mapper.rb:49 in serve
/gems/actionpack-6.1.7.8/lib/action_dispatch/journey/router.rb:50 in block in serve
/gems/actionpack-6.1.7.8/lib/action_dispatch/journey/router.rb:32 in each
/gems/actionpack-6.1.7.8/lib/action_dispatch/journey/router.rb:32 in serve
/gems/actionpack-6.1.7.8/lib/action_dispatch/routing/route_set.rb:842 in call
/gems/scout_apm-5.3.8/lib/scout_apm/instruments/rails_router.rb:29 in call_with_scout_instruments
/gems/omniauth-2.1.2/lib/omniauth/strategy.rb:202 in call!
/gems/omniauth-2.1.2/lib/omniauth/strategy.rb:169 in call
/gems/omniauth-2.1.2/lib/omniauth/strategy.rb:202 in call!
/gems/omniauth-2.1.2/lib/omniauth/strategy.rb:169 in call
/gems/omniauth-2.1.2/lib/omniauth/strategy.rb:202 in call!
/gems/omniauth-2.1.2/lib/omniauth/strategy.rb:169 in call
/gems/dragonfly-1.4.0/lib/dragonfly/middleware.rb:14 in call
/gems/scout_apm-5.3.8/lib/scout_apm/middleware.rb:17 in call
/gems/rack-attack-6.7.0/lib/rack/attack.rb:103 in call
/gems/warden-1.2.9/lib/warden/manager.rb:36 in block in call
/gems/warden-1.2.9/lib/warden/manager.rb:34 in catch
/gems/warden-1.2.9/lib/warden/manager.rb:34 in call
/gems/rack-2.2.9/lib/rack/tempfile_reaper.rb:15 in call
/gems/rack-2.2.9/lib/rack/etag.rb:27 in call
/gems/rack-2.2.9/lib/rack/conditional_get.rb:27 in call
/gems/rack-2.2.9/lib/rack/head.rb:12 in call
/gems/actionpack-6.1.7.8/lib/action_dispatch/http/permissions_policy.rb:22 in call
/gems/actionpack-6.1.7.8/lib/action_dispatch/http/content_security_policy.rb:19 in call
/gems/rack-2.2.9/lib/rack/session/abstract/id.rb:266 in context
/gems/rack-2.2.9/lib/rack/session/abstract/id.rb:260 in call
/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/cookies.rb:697 in call
/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/callbacks.rb:27 in block in call
/gems/activesupport-6.1.7.8/lib/active_support/callbacks.rb:98 in run_callbacks
/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/callbacks.rb:26 in call
/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/actionable_exceptions.rb:18 in call
/gems/airbrake-13.0.4/lib/airbrake/rack/middleware.rb:34 in call!
/gems/airbrake-13.0.4/lib/airbrake/rack/middleware.rb:23 in call
/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/debug_exceptions.rb:29 in call
/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/show_exceptions.rb:33 in call
/gems/turbolinks_render-0.9.21/lib/turbolinks_render/middleware.rb:81 in call
/gems/lograge-0.13.0/lib/lograge/rails_ext/rack/logger.rb:18 in call_app
/gems/railties-6.1.7.8/lib/rails/rack/logger.rb:26 in block in call
/gems/activesupport-6.1.7.8/lib/active_support/tagged_logging.rb:99 in block in tagged
/gems/activesupport-6.1.7.8/lib/active_support/tagged_logging.rb:37 in tagged
/gems/activesupport-6.1.7.8/lib/active_support/tagged_logging.rb:99 in tagged
/gems/railties-6.1.7.8/lib/rails/rack/logger.rb:26 in call
/gems/sprockets-rails-3.5.2/lib/sprockets/rails/quiet_assets.rb:17 in call
/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/remote_ip.rb:81 in call
/gems/request_store-1.7.0/lib/request_store/middleware.rb:19 in call
/gems/rack-timeout-0.6.3/lib/rack/timeout/core.rb:148 in block in call
/gems/rack-timeout-0.6.3/lib/rack/timeout/support/timeout.rb:19 in timeout
/gems/rack-timeout-0.6.3/lib/rack/timeout/core.rb:147 in call
/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/request_id.rb:26 in call
/gems/rack-2.2.9/lib/rack/method_override.rb:24 in call
/gems/rack-2.2.9/lib/rack/runtime.rb:22 in call
/gems/activesupport-6.1.7.8/lib/active_support/cache/strategy/local_cache_middleware.rb:29 in call
/gems/rack-rewrite-1.5.1/lib/rack/rewrite.rb:24 in call
/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/executor.rb:14 in call
/gems/rack-cache-1.14.0/lib/rack/cache/context.rb:141 in forward
/gems/rack-cache-1.14.0/lib/rack/cache/context.rb:267 in fetch
/gems/rack-cache-1.14.0/lib/rack/cache/context.rb:196 in lookup
/gems/rack-cache-1.14.0/lib/rack/cache/context.rb:67 in call!
/gems/rack-cache-1.14.0/lib/rack/cache/context.rb:52 in call
/gems/rack-2.2.9/lib/rack/deflater.rb:44 in call
/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/static.rb:24 in call
/gems/dragonfly-1.4.0/lib/dragonfly/cookie_monster.rb:9 in call
/gems/rack-2.2.9/lib/rack/sendfile.rb:110 in call
/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/ssl.rb:77 in call
/gems/actionpack-6.1.7.8/lib/action_dispatch/middleware/host_authorization.rb:142 in call
/gems/scout_apm-5.3.8/lib/scout_apm/instruments/middleware_summary.rb:58 in call
/gems/railties-6.1.7.8/lib/rails/engine.rb:539 in call
/gems/puma-6.4.2/lib/puma/configuration.rb:272 in call
/gems/puma-6.4.2/lib/puma/request.rb:100 in block in handle_request
/gems/puma-6.4.2/lib/puma/thread_pool.rb:378 in with_force_shutdown
/gems/puma-6.4.2/lib/puma/request.rb:99 in handle_request
/gems/puma-6.4.2/lib/puma/server.rb:464 in process_client
/gems/puma-6.4.2/lib/puma/server.rb:245 in block in run
/gems/puma-6.4.2/lib/puma/thread_pool.rb:155 in block in spawn_thread
lancetarn commented 1 month ago

Sorry for the trouble. I think I see the issue, which looks like it is masking another issue, so this will be a double bonus. Thanks for the library info; we'll try to get a repro going.

lancetarn commented 1 week ago

@curtis The first fix to properly handle this exception is now on master. If it is reasonable to pull the gem from there, I invite you to give it a try. Otherwise we will cut a release shortly.

I could not reproduce the issue with getting the endpoint name, unfortunately, but this should at least log more information related to the request so that we can diagnose and fix that issue as well. We can take another look with additional information from those logs.