rmosolgo / graphql-ruby

Ruby implementation of GraphQL
http://graphql-ruby.org
MIT License
5.38k stars 1.39k forks source link

Intermittent bug with new Visibility code #5146

Closed sealabcore closed 2 weeks ago

sealabcore commented 2 weeks ago

Describe the bug

We are seeing intermittent issues in the latest version of the graphql gem. Our app was raising on this error

GraphQL::Schema::DuplicateNamesError · Found two visible definitions for `Query.eventSchedules.userIds`: #<Types::BaseArgument Query.eventSchedules.userIds: [ID!]! @description="The user ids of the people to query for their event schedules">, #<Types::BaseArgument Query.eventSchedules.userIds: [ID!]! @description="The user ids of the people to query for their event schedules">

This was raising on every graphql request, even ones that didn't even have Query.eventSchedules.userIds in the query. So it seems like some weird caching issue in the new visiblity code.

We also get this error with the latest graphql code, but it's only once or twice a day right after deploy

FrozenError · can't modify frozen GraphQL::Schema::Field::ScopeExtension: #<GraphQL::Schema::Field::ScopeExtension:0x00007efdcc627408 @field=#<Types::BaseField Query.eventSchedules(...): EventScheduleConnection!>, @options={:call_after_define=>false}, @added_default_arguments=nil, @added_extras=nil>

These actually seem related, we got the FrozenError first when we deployed, and then started seeing the first error on every request after that.

Versions

graphql version: 2.4.1 rails (or other framework): Rails 7.2.2 other applicable versions (graphql-batch, etc)

Steps to reproduce

This would happen intermittently when deploying our app with the latest graphql gem.

Expected behavior

App should not raise on every graphql request.

Actual behavior

What specifically went wrong?

Place full backtrace here (if a Ruby exception is involved):

Click to view first frozen exception backtrace ``` vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/schema/field_extension.rb:111:in `after_define_apply': can't modify frozen GraphQL::Schema::Field::ScopeExtension: #, @options={:call_after_define=>false}, @added_default_arguments=nil, @added_extras=nil> (FrozenError) from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/schema/field.rb:374:in `each' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/schema/field.rb:374:in `ensure_loaded' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/schema/visibility/profile.rb:460:in `block in visit_type' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/schema/visibility/profile.rb:459:in `each' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/schema/visibility/profile.rb:459:in `visit_type' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/schema/visibility/profile.rb:418:in `load_all_types' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/schema/visibility/profile.rb:170:in `type' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/static_validation/rules/variables_are_input_types.rb:7:in `on_variable_definition' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/language/static_visitor.rb:103:in `block in on_operation_definition_children' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/language/static_visitor.rb:102:in `each' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/language/static_visitor.rb:102:in `on_operation_definition_children' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/language/static_visitor.rb:41:in `on_operation_definition' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/static_validation/definition_dependencies.rb:47:in `on_operation_definition' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/static_validation/rules/subscription_root_exists.rb:12:in `on_operation_definition' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/static_validation/rules/query_root_exists.rb:12:in `on_operation_definition' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/static_validation/rules/mutation_root_exists.rb:12:in `on_operation_definition' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/static_validation/rules/variable_usages_are_allowed.rb:13:in `on_operation_definition' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/static_validation/rules/variables_are_used_and_defined.rb:44:in `on_operation_definition' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/static_validation/rules/variable_names_are_unique.rb:20:in `on_operation_definition' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/static_validation/rules/fields_have_appropriate_selections.rb:18:in `on_operation_definition' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/static_validation/rules/fields_will_merge.rb:26:in `on_operation_definition' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/static_validation/rules/operation_names_are_valid.rb:12:in `on_operation_definition' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/static_validation/rules/unique_directives_per_location.rb:27:in `block (2 levels) in ' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/static_validation/base_visitor.rb:60:in `on_operation_definition' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/language/static_visitor.rb:61:in `public_send' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/language/static_visitor.rb:61:in `block in on_document_children' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/language/static_visitor.rb:59:in `each' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/language/static_visitor.rb:59:in `on_document_children' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/language/static_visitor.rb:41:in `on_document' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/static_validation/definition_dependencies.rb:38:in `on_document' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/static_validation/rules/variables_are_used_and_defined.rb:79:in `on_document' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/static_validation/rules/fragment_spreads_are_possible.rb:26:in `on_document' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/static_validation/rules/fragments_are_used.rb:6:in `on_document' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/static_validation/rules/fragments_are_finite.rb:6:in `on_document' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/static_validation/rules/fragment_names_are_unique.rb:17:in `on_document' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/static_validation/rules/operation_names_are_valid.rb:16:in `on_document' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/static_validation/rules/no_definitions_are_present.rb:34:in `on_document' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/language/static_visitor.rb:16:in `public_send' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/language/static_visitor.rb:16:in `visit' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/static_validation/validator.rb:45:in `block (3 levels) in validate' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/static_validation/validator.rb:44:in `catch' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/static_validation/validator.rb:44:in `block (2 levels) in validate' from vendor/ruby-3.3.3/lib/ruby/3.3.0/timeout.rb:170:in `timeout' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/static_validation/validator.rb:43:in `block in validate' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/tracing/trace.rb:28:in `validate' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/tracing/new_relic_trace.rb:37:in `block in validate' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/method_tracer_helpers.rb:37:in `block in trace_execution_scoped' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/tracer.rb:357:in `capture_segment_error' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/method_tracer_helpers.rb:37:in `trace_execution_scoped' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/tracing/new_relic_trace.rb:36:in `validate' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/static_validation/validator.rb:30:in `validate' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/query/validation_pipeline.rb:72:in `ensure_has_validated' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/query/validation_pipeline.rb:33:in `valid?' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/query.rb:349:in `valid?' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/analysis.rb:27:in `block (2 levels) in analyze_multiplex' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/analysis.rb:26:in `map' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/analysis.rb:26:in `block in analyze_multiplex' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/tracing/trace.rb:32:in `analyze_multiplex' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/tracing/new_relic_trace.rb:37:in `block in analyze_multiplex' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/method_tracer_helpers.rb:37:in `block in trace_execution_scoped' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/tracer.rb:357:in `capture_segment_error' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/method_tracer_helpers.rb:37:in `trace_execution_scoped' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/tracing/new_relic_trace.rb:36:in `analyze_multiplex' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/analysis.rb:25:in `analyze_multiplex' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/execution/interpreter.rb:47:in `block in run_all' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/tracing/trace.rb:40:in `execute_multiplex' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/tracing/new_relic_trace.rb:37:in `block in execute_multiplex' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/method_tracer_helpers.rb:37:in `block in trace_execution_scoped' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/tracer.rb:357:in `capture_segment_error' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/method_tracer_helpers.rb:37:in `trace_execution_scoped' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/tracing/new_relic_trace.rb:36:in `execute_multiplex' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/execution/interpreter.rb:38:in `run_all' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/schema.rb:1492:in `multiplex' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/schema.rb:1468:in `execute' from app/controllers/graphql_controller.rb:60:in `execute' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/action_controller/metal/basic_implicit_render.rb:8:in `send_action' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/abstract_controller/base.rb:226:in `process_action' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/action_controller/metal/rendering.rb:193:in `process_action' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/abstract_controller/callbacks.rb:261:in `block in process_action' from vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2/lib/active_support/callbacks.rb:121:in `block in run_callbacks' from vendor/bundle/ruby/3.3.0/gems/actiontext-7.2.2/lib/action_text/rendering.rb:25:in `with_renderer' from vendor/bundle/ruby/3.3.0/gems/actiontext-7.2.2/lib/action_text/engine.rb:71:in `block (4 levels) in ' from vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2/lib/active_support/callbacks.rb:130:in `instance_exec' from vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2/lib/active_support/callbacks.rb:130:in `block in run_callbacks' from vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2/lib/active_support/callbacks.rb:141:in `run_callbacks' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/abstract_controller/callbacks.rb:260:in `process_action' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/action_controller/metal/rescue.rb:27:in `process_action' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/action_controller/metal/instrumentation.rb:77:in `block in process_action' from vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2/lib/active_support/notifications.rb:210:in `block in instrument' from vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2/lib/active_support/notifications/instrumenter.rb:58:in `instrument' from vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2/lib/active_support/notifications.rb:210:in `instrument' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/action_controller/metal/instrumentation.rb:76:in `process_action' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/action_controller/metal/params_wrapper.rb:259:in `process_action' from vendor/bundle/ruby/3.3.0/gems/searchkick-5.4.0/lib/searchkick/controller_runtime.rb:15:in `process_action' from vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2/lib/active_record/railties/controller_runtime.rb:39:in `process_action' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/abstract_controller/base.rb:163:in `process' from vendor/bundle/ruby/3.3.0/gems/actionview-7.2.2/lib/action_view/rendering.rb:40:in `process' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/action_controller/metal.rb:252:in `dispatch' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/action_controller/metal.rb:335:in `dispatch' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/action_dispatch/routing/route_set.rb:67:in `dispatch' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/action_dispatch/routing/route_set.rb:50:in `serve' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/action_dispatch/journey/router.rb:53:in `block in serve' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/action_dispatch/journey/router.rb:133:in `block in find_routes' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/action_dispatch/journey/router.rb:126:in `each' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/action_dispatch/journey/router.rb:126:in `find_routes' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/action_dispatch/journey/router.rb:34:in `serve' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/action_dispatch/routing/route_set.rb:896:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/omniauth-2.1.2/lib/omniauth/strategy.rb:202:in `call!' from vendor/bundle/ruby/3.3.0/gems/omniauth-2.1.2/lib/omniauth/strategy.rb:169:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/omniauth-2.1.2/lib/omniauth/strategy.rb:202:in `call!' from vendor/bundle/ruby/3.3.0/gems/omniauth-2.1.2/lib/omniauth/strategy.rb:169:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/omniauth-2.1.2/lib/omniauth/strategy.rb:202:in `call!' from vendor/bundle/ruby/3.3.0/gems/omniauth-2.1.2/lib/omniauth/strategy.rb:169:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/omniauth-2.1.2/lib/omniauth/builder.rb:44:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/crawler_detect-1.2.5/lib/rack/crawler_detect.rb:23:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/warden-1.2.9/lib/warden/manager.rb:36:in `block in call' from vendor/bundle/ruby/3.3.0/gems/warden-1.2.9/lib/warden/manager.rb:34:in `catch' from vendor/bundle/ruby/3.3.0/gems/warden-1.2.9/lib/warden/manager.rb:34:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/rack-3.1.8/lib/rack/tempfile_reaper.rb:20:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/rack-3.1.8/lib/rack/etag.rb:29:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/rack-3.1.8/lib/rack/conditional_get.rb:43:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/rack-3.1.8/lib/rack/head.rb:15:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/action_dispatch/http/permissions_policy.rb:38:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/action_dispatch/http/content_security_policy.rb:35:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/rack-session-2.0.0/lib/rack/session/abstract/id.rb:272:in `context' from vendor/bundle/ruby/3.3.0/gems/rack-session-2.0.0/lib/rack/session/abstract/id.rb:266:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/action_dispatch/middleware/cookies.rb:704:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/action_dispatch/middleware/callbacks.rb:31:in `block in call' from vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2/lib/active_support/callbacks.rb:101:in `run_callbacks' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/action_dispatch/middleware/callbacks.rb:30:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/bugsnag-6.27.1/lib/bugsnag/integrations/rack.rb:51:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/action_dispatch/middleware/debug_exceptions.rb:31:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/action_dispatch/middleware/show_exceptions.rb:32:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/railties-7.2.2/lib/rails/rack/logger.rb:41:in `call_app' from vendor/bundle/ruby/3.3.0/gems/railties-7.2.2/lib/rails/rack/logger.rb:29:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/action_dispatch/middleware/remote_ip.rb:96:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/rack-timeout-0.7.0/lib/rack/timeout/core.rb:154:in `block in call' from vendor/bundle/ruby/3.3.0/gems/rack-timeout-0.7.0/lib/rack/timeout/support/timeout.rb:19:in `timeout' from vendor/bundle/ruby/3.3.0/gems/rack-timeout-0.7.0/lib/rack/timeout/core.rb:153:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/action_dispatch/middleware/request_id.rb:33:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/rack-3.1.8/lib/rack/method_override.rb:28:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/rack-3.1.8/lib/rack/runtime.rb:24:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/action_dispatch/middleware/executor.rb:16:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/action_dispatch/middleware/static.rb:27:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/rack-3.1.8/lib/rack/sendfile.rb:114:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/action_dispatch/middleware/ssl.rb:82:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/rack-cors-2.0.2/lib/rack/cors.rb:102:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/railties-7.2.2/lib/rails/engine.rb:535:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/puma-6.4.3/lib/puma/configuration.rb:272:in `call' from vendor/bundle/ruby/3.3.0/gems/puma-6.4.3/lib/puma/request.rb:100:in `block in handle_request' from vendor/bundle/ruby/3.3.0/gems/puma-6.4.3/lib/puma/thread_pool.rb:378:in `with_force_shutdown' from vendor/bundle/ruby/3.3.0/gems/puma-6.4.3/lib/puma/request.rb:99:in `handle_request' from vendor/bundle/ruby/3.3.0/gems/puma-6.4.3/lib/puma/server.rb:464:in `process_client' from vendor/bundle/ruby/3.3.0/gems/puma-6.4.3/lib/puma/server.rb:245:in `block in run' from vendor/bundle/ruby/3.3.0/gems/puma-6.4.3/lib/puma/thread_pool.rb:155:in `block in spawn_thread' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/tracer.rb:434:in `block (2 levels) in thread_block_with_current_transaction' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/tracer.rb:357:in `capture_segment_error' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/tracer.rb:433:in `block in thread_block_with_current_transaction' ```
Click to view second exception backtrace that crashed every following request ``` vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/schema/visibility/profile.rb:373:in `raise_duplicate_definition': Found two visible definitions for `Query.eventSchedules.userIds`: #, # (GraphQL::Schema::DuplicateNamesError) from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/schema/visibility/profile.rb:364:in `block in non_duplicate_items' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/schema/visibility/profile.rb:361:in `each' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/schema/visibility/profile.rb:361:in `non_duplicate_items' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/schema/visibility/profile.rb:138:in `block in initialize' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/schema/visibility/profile.rb:231:in `arguments' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/schema/visibility/profile.rb:470:in `block in visit_type' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/schema/visibility/profile.rb:459:in `each' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/schema/visibility/profile.rb:459:in `visit_type' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/schema/visibility/profile.rb:418:in `load_all_types' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/schema/visibility/profile.rb:170:in `type' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/static_validation/rules/variables_are_input_types.rb:7:in `on_variable_definition' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/language/static_visitor.rb:103:in `block in on_operation_definition_children' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/language/static_visitor.rb:102:in `each' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/language/static_visitor.rb:102:in `on_operation_definition_children' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/language/static_visitor.rb:41:in `on_operation_definition' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/static_validation/definition_dependencies.rb:47:in `on_operation_definition' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/static_validation/rules/subscription_root_exists.rb:12:in `on_operation_definition' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/static_validation/rules/query_root_exists.rb:12:in `on_operation_definition' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/static_validation/rules/mutation_root_exists.rb:12:in `on_operation_definition' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/static_validation/rules/variable_usages_are_allowed.rb:13:in `on_operation_definition' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/static_validation/rules/variables_are_used_and_defined.rb:44:in `on_operation_definition' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/static_validation/rules/variable_names_are_unique.rb:20:in `on_operation_definition' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/static_validation/rules/fields_have_appropriate_selections.rb:18:in `on_operation_definition' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/static_validation/rules/fields_will_merge.rb:26:in `on_operation_definition' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/static_validation/rules/operation_names_are_valid.rb:12:in `on_operation_definition' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/static_validation/rules/unique_directives_per_location.rb:27:in `block (2 levels) in ' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/static_validation/base_visitor.rb:60:in `on_operation_definition' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/language/static_visitor.rb:61:in `public_send' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/language/static_visitor.rb:61:in `block in on_document_children' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/language/static_visitor.rb:59:in `each' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/language/static_visitor.rb:59:in `on_document_children' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/language/static_visitor.rb:41:in `on_document' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/static_validation/definition_dependencies.rb:38:in `on_document' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/static_validation/rules/variables_are_used_and_defined.rb:79:in `on_document' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/static_validation/rules/fragment_spreads_are_possible.rb:26:in `on_document' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/static_validation/rules/fragments_are_used.rb:6:in `on_document' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/static_validation/rules/fragments_are_finite.rb:6:in `on_document' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/static_validation/rules/fragment_names_are_unique.rb:17:in `on_document' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/static_validation/rules/operation_names_are_valid.rb:16:in `on_document' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/static_validation/rules/no_definitions_are_present.rb:34:in `on_document' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/language/static_visitor.rb:16:in `public_send' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/language/static_visitor.rb:16:in `visit' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/static_validation/validator.rb:45:in `block (3 levels) in validate' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/static_validation/validator.rb:44:in `catch' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/static_validation/validator.rb:44:in `block (2 levels) in validate' from vendor/ruby-3.3.3/lib/ruby/3.3.0/timeout.rb:170:in `timeout' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/static_validation/validator.rb:43:in `block in validate' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/tracing/trace.rb:28:in `validate' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/tracing/new_relic_trace.rb:37:in `block in validate' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/method_tracer_helpers.rb:37:in `block in trace_execution_scoped' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/tracer.rb:357:in `capture_segment_error' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/method_tracer_helpers.rb:37:in `trace_execution_scoped' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/tracing/new_relic_trace.rb:36:in `validate' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/static_validation/validator.rb:30:in `validate' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/query/validation_pipeline.rb:72:in `ensure_has_validated' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/query/validation_pipeline.rb:33:in `valid?' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/query.rb:349:in `valid?' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/analysis.rb:27:in `block (2 levels) in analyze_multiplex' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/analysis.rb:26:in `map' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/analysis.rb:26:in `block in analyze_multiplex' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/tracing/trace.rb:32:in `analyze_multiplex' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/tracing/new_relic_trace.rb:37:in `block in analyze_multiplex' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/method_tracer_helpers.rb:37:in `block in trace_execution_scoped' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/tracer.rb:357:in `capture_segment_error' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/method_tracer_helpers.rb:37:in `trace_execution_scoped' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/tracing/new_relic_trace.rb:36:in `analyze_multiplex' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/analysis.rb:25:in `analyze_multiplex' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/execution/interpreter.rb:47:in `block in run_all' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/tracing/trace.rb:40:in `execute_multiplex' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/tracing/new_relic_trace.rb:37:in `block in execute_multiplex' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/method_tracer_helpers.rb:37:in `block in trace_execution_scoped' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/tracer.rb:357:in `capture_segment_error' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/method_tracer_helpers.rb:37:in `trace_execution_scoped' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/tracing/new_relic_trace.rb:36:in `execute_multiplex' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/execution/interpreter.rb:38:in `run_all' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/schema.rb:1492:in `multiplex' from vendor/bundle/ruby/3.3.0/gems/graphql-2.4.1/lib/graphql/schema.rb:1468:in `execute' from app/controllers/graphql_controller.rb:60:in `execute' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/action_controller/metal/basic_implicit_render.rb:8:in `send_action' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/abstract_controller/base.rb:226:in `process_action' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/action_controller/metal/rendering.rb:193:in `process_action' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/abstract_controller/callbacks.rb:261:in `block in process_action' from vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2/lib/active_support/callbacks.rb:121:in `block in run_callbacks' from vendor/bundle/ruby/3.3.0/gems/actiontext-7.2.2/lib/action_text/rendering.rb:25:in `with_renderer' from vendor/bundle/ruby/3.3.0/gems/actiontext-7.2.2/lib/action_text/engine.rb:71:in `block (4 levels) in ' from vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2/lib/active_support/callbacks.rb:130:in `instance_exec' from vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2/lib/active_support/callbacks.rb:130:in `block in run_callbacks' from vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2/lib/active_support/callbacks.rb:141:in `run_callbacks' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/abstract_controller/callbacks.rb:260:in `process_action' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/action_controller/metal/rescue.rb:27:in `process_action' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/action_controller/metal/instrumentation.rb:77:in `block in process_action' from vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2/lib/active_support/notifications.rb:210:in `block in instrument' from vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2/lib/active_support/notifications/instrumenter.rb:58:in `instrument' from vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2/lib/active_support/notifications.rb:210:in `instrument' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/action_controller/metal/instrumentation.rb:76:in `process_action' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/action_controller/metal/params_wrapper.rb:259:in `process_action' from vendor/bundle/ruby/3.3.0/gems/searchkick-5.4.0/lib/searchkick/controller_runtime.rb:15:in `process_action' from vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2/lib/active_record/railties/controller_runtime.rb:39:in `process_action' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/abstract_controller/base.rb:163:in `process' from vendor/bundle/ruby/3.3.0/gems/actionview-7.2.2/lib/action_view/rendering.rb:40:in `process' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/action_controller/metal.rb:252:in `dispatch' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/action_controller/metal.rb:335:in `dispatch' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/action_dispatch/routing/route_set.rb:67:in `dispatch' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/action_dispatch/routing/route_set.rb:50:in `serve' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/action_dispatch/journey/router.rb:53:in `block in serve' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/action_dispatch/journey/router.rb:133:in `block in find_routes' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/action_dispatch/journey/router.rb:126:in `each' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/action_dispatch/journey/router.rb:126:in `find_routes' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/action_dispatch/journey/router.rb:34:in `serve' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/action_dispatch/routing/route_set.rb:896:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/omniauth-2.1.2/lib/omniauth/strategy.rb:202:in `call!' from vendor/bundle/ruby/3.3.0/gems/omniauth-2.1.2/lib/omniauth/strategy.rb:169:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/omniauth-2.1.2/lib/omniauth/strategy.rb:202:in `call!' from vendor/bundle/ruby/3.3.0/gems/omniauth-2.1.2/lib/omniauth/strategy.rb:169:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/omniauth-2.1.2/lib/omniauth/strategy.rb:202:in `call!' from vendor/bundle/ruby/3.3.0/gems/omniauth-2.1.2/lib/omniauth/strategy.rb:169:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/omniauth-2.1.2/lib/omniauth/builder.rb:44:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/crawler_detect-1.2.5/lib/rack/crawler_detect.rb:23:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/warden-1.2.9/lib/warden/manager.rb:36:in `block in call' from vendor/bundle/ruby/3.3.0/gems/warden-1.2.9/lib/warden/manager.rb:34:in `catch' from vendor/bundle/ruby/3.3.0/gems/warden-1.2.9/lib/warden/manager.rb:34:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/rack-3.1.8/lib/rack/tempfile_reaper.rb:20:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/rack-3.1.8/lib/rack/etag.rb:29:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/rack-3.1.8/lib/rack/conditional_get.rb:43:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/rack-3.1.8/lib/rack/head.rb:15:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/action_dispatch/http/permissions_policy.rb:38:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/action_dispatch/http/content_security_policy.rb:35:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/rack-session-2.0.0/lib/rack/session/abstract/id.rb:272:in `context' from vendor/bundle/ruby/3.3.0/gems/rack-session-2.0.0/lib/rack/session/abstract/id.rb:266:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/action_dispatch/middleware/cookies.rb:704:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/action_dispatch/middleware/callbacks.rb:31:in `block in call' from vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2/lib/active_support/callbacks.rb:101:in `run_callbacks' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/action_dispatch/middleware/callbacks.rb:30:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/bugsnag-6.27.1/lib/bugsnag/integrations/rack.rb:51:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/action_dispatch/middleware/debug_exceptions.rb:31:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/action_dispatch/middleware/show_exceptions.rb:32:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/railties-7.2.2/lib/rails/rack/logger.rb:41:in `call_app' from vendor/bundle/ruby/3.3.0/gems/railties-7.2.2/lib/rails/rack/logger.rb:29:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/action_dispatch/middleware/remote_ip.rb:96:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/rack-timeout-0.7.0/lib/rack/timeout/core.rb:154:in `block in call' from vendor/bundle/ruby/3.3.0/gems/rack-timeout-0.7.0/lib/rack/timeout/support/timeout.rb:19:in `timeout' from vendor/bundle/ruby/3.3.0/gems/rack-timeout-0.7.0/lib/rack/timeout/core.rb:153:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/action_dispatch/middleware/request_id.rb:33:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/rack-3.1.8/lib/rack/method_override.rb:28:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/rack-3.1.8/lib/rack/runtime.rb:24:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/action_dispatch/middleware/executor.rb:16:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/action_dispatch/middleware/static.rb:27:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/rack-3.1.8/lib/rack/sendfile.rb:114:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/actionpack-7.2.2/lib/action_dispatch/middleware/ssl.rb:82:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/rack-cors-2.0.2/lib/rack/cors.rb:102:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/railties-7.2.2/lib/rails/engine.rb:535:in `call' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call' from vendor/bundle/ruby/3.3.0/gems/puma-6.4.3/lib/puma/configuration.rb:272:in `call' from vendor/bundle/ruby/3.3.0/gems/puma-6.4.3/lib/puma/request.rb:100:in `block in handle_request' from vendor/bundle/ruby/3.3.0/gems/puma-6.4.3/lib/puma/thread_pool.rb:378:in `with_force_shutdown' from vendor/bundle/ruby/3.3.0/gems/puma-6.4.3/lib/puma/request.rb:99:in `handle_request' from vendor/bundle/ruby/3.3.0/gems/puma-6.4.3/lib/puma/server.rb:464:in `process_client' from vendor/bundle/ruby/3.3.0/gems/puma-6.4.3/lib/puma/server.rb:245:in `block in run' from vendor/bundle/ruby/3.3.0/gems/puma-6.4.3/lib/puma/thread_pool.rb:155:in `block in spawn_thread' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/tracer.rb:434:in `block (2 levels) in thread_block_with_current_transaction' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/tracer.rb:357:in `capture_segment_error' from vendor/bundle/ruby/3.3.0/gems/newrelic_rpm-9.15.0/lib/new_relic/agent/tracer.rb:433:in `block in thread_block_with_current_transaction' ```

Additional context

Add any other context about the problem here.

With these details, we can efficiently hunt down the bug!

rmosolgo commented 2 weeks ago

Hey, I'm so sorry for the trouble! Thanks for such a detailed report.

App should not raise on every graphql request.

I'm going to go ahead and agree with you on that expectation 😅

My first hunch is that it's a multi-threading issue in loading schema files. Does this error ever occur in development? (I'm guessing not...)

The system is supposed to make sure all files are loaded at boot time in Production: https://github.com/rmosolgo/graphql-ruby/blob/700fc49e39e8a8d8e75c18ebfda129853d34c263/lib/graphql/schema/visibility.rb#L14

But I see that ensure_loaded is being called at runtime in the stack trace of the FrozenError. That means that ensure_loaded wasn't already called -- or at least that the call hadn't already finished. (I think what would happen with a bunch of threads calling it at once, it could start running on all those different threads, then they'd clash when loading field extensions like this, since they'd be adding the extension more than once.)

One possibility is to put a real lock on this code so that it only runs once.

Another issue is that I guess it only actually preloads if there are any named preloads:

https://github.com/rmosolgo/graphql-ruby/blob/700fc49e39e8a8d8e75c18ebfda129853d34c263/lib/graphql/schema/visibility.rb#L28-L29

(If profiles is empty, .each will iterate zero times 😖 .)

I'm going to take a look at both of these things and I'll follow up back here.

sealabcore commented 2 weeks ago

Hey, I'm so sorry for the trouble! Thanks for such a detailed report.

App should not raise on every graphql request.

I'm going to go ahead and agree with you on that expectation 😅

My first hunch is that it's a multi-threading issue in loading schema files. Does this error ever occur in development? (I'm guessing not...)

We have not seen this issue in development environments, and out of about 10 deploys to our production environment, only two deploys showed the Frozen error, and one showed the two visible definitions error on every request.

The system is supposed to make sure all files are loaded at boot time in Production:

https://github.com/rmosolgo/graphql-ruby/blob/700fc49e39e8a8d8e75c18ebfda129853d34c263/lib/graphql/schema/visibility.rb#L14

But I see that ensure_loaded is being called at runtime in the stack trace of the FrozenError. That means that ensure_loaded wasn't already called -- or at least that the call hadn't already finished. (I think what would happen with a bunch of threads calling it at once, it could start running on all those different threads, then they'd clash when loading field extensions like this, since they'd be adding the extension more than once.)

We do run 12 threads with 2 workers via Puma in our production environment so it's possible the higher number of threads the more chance that this occurs. As we did not see this in our staging environment that only runs 2 threads on 1 worker.

One possibility is to put a real lock on this code so that it only runs once.

Another issue is that I guess it only actually preloads if there are any named preloads:

https://github.com/rmosolgo/graphql-ruby/blob/700fc49e39e8a8d8e75c18ebfda129853d34c263/lib/graphql/schema/visibility.rb#L28-L29

(If profiles is empty, .each will iterate zero times 😖 .)

I'm going to take a look at both of these things and I'll follow up back here.

Thank for looking into this! We've downgraded to 2.3.19 for now.

rmosolgo commented 2 weeks ago

Thanks again for the detailed report. I just improved the preloading behavior and released it in 2.4.2. If you get a chance to try that new version, please let me know how it goes for you!

sealabcore commented 2 weeks ago

Thank you! I'll test this in our staging environment with more threads and a lot of test deploys before going back to production and get back to you on if I see either error again.

Thanks for the quick turnaround! 🎉