sahil kumar
sahil kumar

Reputation: 1

facing issue after updating rails from 4.2.10 to 6.1.7.3

Below is my stacktrace, and I was facing this issue after rails upgrade.
and this issue was happening after deploying my code.
I updated the params structure aswell by using params.permit! but still somehow this is happening.
it might be related to some middleware but not able to figure it out

Error occurred while parsing request parameters.

I, [2024-06-30T17:02:30.371538 #5204]  INFO -- :  Processing by ReportsController#create as JSON
I, [2024-06-30T17:02:30.372102 #5204]  INFO -- :  Completed 400 Bad Request in 0ms (Allocations: 174)
F, [2024-06-30T17:02:30.373534 #5204] FATAL -- : 
 ActionDispatch::Http::Parameters::ParseError (wrong number of arguments (given 2, expected 1)):

 actionpack (6.1.7.3) lib/action_dispatch/http/parameters.rb:96:in `rescue in parse_formatted_parameters'
 actionpack (6.1.7.3) lib/action_dispatch/http/parameters.rb:92:in `parse_formatted_parameters'
 actionpack (6.1.7.3) lib/action_dispatch/http/request.rb:399:in `block in POST'
 rack (2.2.9) lib/rack/request.rb:69:in `fetch'
 rack (2.2.9) lib/rack/request.rb:69:in `fetch_header'
 actionpack (6.1.7.3) lib/action_dispatch/http/request.rb:398:in `POST'
 actionpack (6.1.7.3) lib/action_dispatch/http/parameters.rb:55:in `parameters'
 actionpack (6.1.7.3) lib/action_controller/metal/strong_parameters.rb:1187:in `params'
 actionpack (6.1.7.3) lib/action_controller/metal/request_forgery_protection.rb:436:in `form_authenticity_param'
 actionpack (6.1.7.3) lib/action_controller/metal/request_forgery_protection.rb:303:in `request_authenticity_tokens'
 actionpack (6.1.7.3) lib/action_controller/metal/request_forgery_protection.rb:296:in `any_authenticity_token_valid?'
 actionpack (6.1.7.3) lib/action_controller/metal/request_forgery_protection.rb:291:in `verified_request?'
 actionpack (6.1.7.3) lib/action_controller/metal/request_forgery_protection.rb:230:in `verify_authenticity_token'
 activesupport (6.1.7.3) lib/active_support/callbacks.rb:427:in `block in make_lambda'
 activesupport (6.1.7.3) lib/active_support/callbacks.rb:198:in `block (2 levels) in halting'
 actionpack (6.1.7.3) lib/abstract_controller/callbacks.rb:34:in `block (2 levels) in <module:Callbacks>'
 activesupport (6.1.7.3) lib/active_support/callbacks.rb:199:in `block in halting'
 activesupport (6.1.7.3) lib/active_support/callbacks.rb:512:in `block in invoke_before'
 activesupport (6.1.7.3) lib/active_support/callbacks.rb:512:in `each'
 activesupport (6.1.7.3) lib/active_support/callbacks.rb:512:in `invoke_before'
 activesupport (6.1.7.3) lib/active_support/callbacks.rb:105:in `run_callbacks'
 actionpack (6.1.7.3) lib/abstract_controller/callbacks.rb:41:in `process_action'
 actionpack (6.1.7.3) lib/action_controller/metal/rescue.rb:22:in `process_action'
 actionpack (6.1.7.3) lib/action_controller/metal/instrumentation.rb:34:in `block in process_action'
 activesupport (6.1.7.3) lib/active_support/notifications.rb:203:in `block in instrument'
 activesupport (6.1.7.3) lib/active_support/notifications/instrumenter.rb:24:in `instrument'
 activesupport (6.1.7.3) lib/active_support/notifications.rb:203:in `instrument'
 actionpack (6.1.7.3) lib/action_controller/metal/instrumentation.rb:33:in `process_action'
 actionpack (6.1.7.3) lib/action_controller/metal/params_wrapper.rb:249:in `process_action'
 actionpack (6.1.7.3) lib/abstract_controller/base.rb:165:in `process'
 actionview (6.1.7.3) lib/action_view/rendering.rb:39:in `process'
 actionpack (6.1.7.3) lib/action_controller/metal.rb:190:in `dispatch'
 actionpack (6.1.7.3) lib/action_controller/metal.rb:254:in `dispatch'
 actionpack (6.1.7.3) lib/action_dispatch/routing/route_set.rb:50:in `dispatch'
 actionpack (6.1.7.3) lib/action_dispatch/routing/route_set.rb:33:in `serve'
 actionpack (6.1.7.3) lib/action_dispatch/journey/router.rb:50:in `block in serve'
 actionpack (6.1.7.3) lib/action_dispatch/journey/router.rb:32:in `each'
 actionpack (6.1.7.3) lib/action_dispatch/journey/router.rb:32:in `serve'
 actionpack (6.1.7.3) lib/action_dispatch/routing/route_set.rb:842:in `call'
 newrelic_rpm (9.11.0) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call'
 newrelic_rpm (9.11.0) lib/new_relic/rack/browser_monitoring.rb:38:in `traced_call'
 newrelic_rpm (9.11.0) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call'
 rack (2.2.9) lib/rack/tempfile_reaper.rb:15:in `call'
 newrelic_rpm (9.11.0) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call'
 rack (2.2.9) lib/rack/etag.rb:27:in `call'
 newrelic_rpm (9.11.0) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call'
 rack (2.2.9) lib/rack/conditional_get.rb:40:in `call'
 newrelic_rpm (9.11.0) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call'
 rack (2.2.9) lib/rack/head.rb:12:in `call'
 newrelic_rpm (9.11.0) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call'
 actionpack (6.1.7.3) lib/action_dispatch/http/permissions_policy.rb:22:in `call'
 newrelic_rpm (9.11.0) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call'
 actionpack (6.1.7.3) lib/action_dispatch/http/content_security_policy.rb:19:in `call'
 newrelic_rpm (9.11.0) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call'
 rack (2.2.9) lib/rack/session/abstract/id.rb:266:in `context'
 rack (2.2.9) lib/rack/session/abstract/id.rb:260:in `call'
 newrelic_rpm (9.11.0) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call'
 actionpack (6.1.7.3) lib/action_dispatch/middleware/cookies.rb:697:in `call'
 newrelic_rpm (9.11.0) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call'
 actionpack (6.1.7.3) lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'
 activesupport (6.1.7.3) lib/active_support/callbacks.rb:98:in `run_callbacks'
 actionpack (6.1.7.3) lib/action_dispatch/middleware/callbacks.rb:26:in `call'
 newrelic_rpm (9.11.0) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call'
 actionpack (6.1.7.3) lib/action_dispatch/middleware/actionable_exceptions.rb:18:in `call'
 newrelic_rpm (9.11.0) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call'
 actionpack (6.1.7.3) lib/action_dispatch/middleware/debug_exceptions.rb:29:in `call'
 newrelic_rpm (9.11.0) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call'
 actionpack (6.1.7.3) lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
 newrelic_rpm (9.11.0) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call'
 railties (6.1.7.3) lib/rails/rack/logger.rb:37:in `call_app'
 railties (6.1.7.3) lib/rails/rack/logger.rb:26:in `block in call'
 activesupport (6.1.7.3) lib/active_support/tagged_logging.rb:99:in `block in tagged'
 activesupport (6.1.7.3) lib/active_support/tagged_logging.rb:37:in `tagged'
 activesupport (6.1.7.3) lib/active_support/tagged_logging.rb:99:in `tagged'
 railties (6.1.7.3) lib/rails/rack/logger.rb:26:in `call'
 newrelic_rpm (9.11.0) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call'
 actionpack (6.1.7.3) lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
 newrelic_rpm (9.11.0) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call'
 actionpack (6.1.7.3) lib/action_dispatch/middleware/request_id.rb:26:in `call'
 newrelic_rpm (9.11.0) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call'
 rack (2.2.9) lib/rack/method_override.rb:24:in `call'
 newrelic_rpm (9.11.0) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call'
 rack (2.2.9) lib/rack/runtime.rb:22:in `call'
 newrelic_rpm (9.11.0) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call'
 activesupport (6.1.7.3) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
 newrelic_rpm (9.11.0) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call'
 actionpack (6.1.7.3) lib/action_dispatch/middleware/executor.rb:14:in `call'
 newrelic_rpm (9.11.0) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call'
 actionpack (6.1.7.3) lib/action_dispatch/middleware/static.rb:24:in `call'
 newrelic_rpm (9.11.0) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call'
 rack (2.2.9) lib/rack/sendfile.rb:110:in `call'
 newrelic_rpm (9.11.0) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call'
 actionpack (6.1.7.3) lib/action_dispatch/middleware/host_authorization.rb:142:in `call'
 newrelic_rpm (9.11.0) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call'
 railties (6.1.7.3) lib/rails/engine.rb:539:in `call'
 newrelic_rpm (9.11.0) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call'
 /usr/local/rvm/gems/ruby-3.1.3/gems/passenger-enterprise-server-6.0.17/src/ruby_supportlib/phusion_passenger/rack/thread_handler_extension.rb:91:in `block in process_request'
 /usr/local/rvm/gems/ruby-3.1.3/gems/passenger-enterprise-server-6.0.17/src/ruby_supportlib/phusion_passenger/rack/active_support_tagged_logger_support.rb:15:in `block in maybe_tag_logger'
 activesupport (6.1.7.3) lib/active_support/tagged_logging.rb:99:in `block in tagged'
 activesupport (6.1.7.3) lib/active_support/tagged_logging.rb:37:in `tagged'
 activesupport (6.1.7.3) lib/active_support/tagged_logging.rb:99:in `tagged'
 /usr/local/rvm/gems/ruby-3.1.3/gems/passenger-enterprise-server-6.0.17/src/ruby_supportlib/phusion_passenger/rack/active_support_tagged_logger_support.rb:15:in `maybe_tag_logger'
 /usr/local/rvm/gems/ruby-3.1.3/gems/passenger-enterprise-server-6.0.17/src/ruby_supportlib/phusion_passenger/rack/thread_handler_extension.rb:91:in `process_request'
 /usr/local/rvm/gems/ruby-3.1.3/gems/passenger-enterprise-server-6.0.17/src/ruby_supportlib/phusion_passenger/request_handler/thread_handler.rb:142:in `accept_and_process_next_request'
 /usr/local/rvm/gems/ruby-3.1.3/gems/passenger-enterprise-server-6.0.17/src/ruby_supportlib/phusion_passenger/request_handler/thread_handler.rb:95:in `main_loop'
 /usr/local/rvm/gems/ruby-3.1.3/gems/passenger-enterprise-server-6.0.17/src/ruby_supportlib/phusion_passenger/request_handler.rb:449:in `block (3 levels) in start_threads'
 /usr/local/rvm/gems/ruby-3.1.3/gems/passenger-enterprise-server-6.0.17/src/ruby_supportlib/phusion_passenger/utils.rb:97:in `block in create_thread_and_abort_on_exception'
 newrelic_rpm (9.11.0) lib/new_relic/agent/tracer.rb:434:in `block (2 levels) in thread_block_with_current_transaction'
 newrelic_rpm (9.11.0) lib/new_relic/agent/tracer.rb:357:in `capture_segment_error'
 newrelic_rpm (9.11.0) lib/new_relic/agent/tracer.rb:433:in `block in thread_block_with_current_transaction'

params format:

params.require(:data).permit(
      :template,
      report_data: [
        :id, :status, :activity_id, :meeting_with, :created_at, :updated_at, :sequence, :checkin, :quick_meeting,
        :number_of_attendees_required, :topic_uuid, :meeting_time_zone, :location_uuid, :meeting_updated, :container_uuid,
        :location_preference, :meeting_type_updated, :meeting_time_zone_city, :meeting_uid, :cancel_comments, :no_show,
        :internal_attendees_names, :external_attendees_names, :start_time, :end_time, :dates, :start_date, :end_date,
        :location, :location_address,
        requestor: [
          :email, :first_name, :last_name, :title, :company_name, :contact_no, :uuid, :user_name, :role_name, :role_display_name,
          :consent, :consent_given_time, :internal_requestor, :external_requestor, :host, :invite_status, custom_fields: {}
        ],
        external_attendees: [
          :email, :first_name, :last_name, :title, :company_name, :contact_no, :uuid, :company_role_id, :show_in_meeting,
          :sfdc_enabled, :cis_enabled, :double_booking_enabled, :mapped_to_all, :created_at, :updated_at, :task_manager,
          :cis_email, :unmapped, :endorsed, :access_granted, :last_sync_time, :user_name, :mm_only, :is_scanned, :logged_in_time_last,
          :welcome_email_sent_at, :show_in_all_activities, :integration_external_id, :partial_participation, :additional_info,
          :consent_given, :consent_given_time, :personal_url_token, :avatar_url, :role_name, :role, :invite_status, :host, :optional,
          alias_users: { email: [] }, custom_fields: {}
        ],
        internal_attendees: [
          :email, :first_name, :last_name, :title, :company_name, :contact_no, :uuid, :company_role_id, :show_in_meeting,
          :sfdc_enabled, :cis_enabled, :double_booking_enabled, :mapped_to_all, :created_at, :updated_at, :task_manager,
          :cis_email, :unmapped, :endorsed, :access_granted, :last_sync_time, :user_name, :mm_only, :is_scanned, :logged_in_time_last,
          :welcome_email_sent_at, :show_in_all_activities, :integration_external_id, :partial_participation, :additional_info,
          :consent_given, :consent_given_time, :personal_url_token, :avatar_url, :role_name, :role, :invite_status, :host, :optional,
          alias_users: { email: [] }, custom_fields: {}
        ],
        custom_data: []
      ],
      custom_fields: {}
    )

gemfile:

ruby '3.1.3'
source 'https://rubygems.org'

gem 'rails', '6.1.7.3'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'pdfkit', '~> 0.6.2'
gem 'sablon', '~> 0.3.0'
gem 'pry'
gem 'newrelic_rpm'
gem 'rake'

gem 'web-console', group: :development

gem 'nokogiri'
gem 'bigdecimal', '1.3.5'

group :development, :test do
  gem 'rspec', '~> 3.10.0'
  gem 'rspec-rails', '~> 5.0'
  gem 'shoulda-matchers', '~> 4.0.1'
  gem 'turn', '< 0.9.7', require: false
  gem 'simplecov', '~> 0.9.2', require: false
  gem 'simplecov-rcov', '~> 0.2.3', require: false
end

gemfile.lock:

GEM
  remote: https://rubygems.org/
  specs:
    actioncable (6.1.7.3)
      actionpack (= 6.1.7.3)
      activesupport (= 6.1.7.3)
      nio4r (~> 2.0)
      websocket-driver (>= 0.6.1)
    actionmailbox (6.1.7.3)
      actionpack (= 6.1.7.3)
      activejob (= 6.1.7.3)
      activerecord (= 6.1.7.3)
      activestorage (= 6.1.7.3)
      activesupport (= 6.1.7.3)
      mail (>= 2.7.1)
    actionmailer (6.1.7.3)
      actionpack (= 6.1.7.3)
      actionview (= 6.1.7.3)
      activejob (= 6.1.7.3)
      activesupport (= 6.1.7.3)
      mail (~> 2.5, >= 2.5.4)
      rails-dom-testing (~> 2.0)
    actionpack (6.1.7.3)
      actionview (= 6.1.7.3)
      activesupport (= 6.1.7.3)
      rack (~> 2.0, >= 2.0.9)
      rack-test (>= 0.6.3)
      rails-dom-testing (~> 2.0)
      rails-html-sanitizer (~> 1.0, >= 1.2.0)
    actiontext (6.1.7.3)
      actionpack (= 6.1.7.3)
      activerecord (= 6.1.7.3)
      activestorage (= 6.1.7.3)
      activesupport (= 6.1.7.3)
      nokogiri (>= 1.8.5)
    actionview (6.1.7.3)
      activesupport (= 6.1.7.3)
      builder (~> 3.1)
      erubi (~> 1.4)
      rails-dom-testing (~> 2.0)
      rails-html-sanitizer (~> 1.1, >= 1.2.0)
    activejob (6.1.7.3)
      activesupport (= 6.1.7.3)
      globalid (>= 0.3.6)
    activemodel (6.1.7.3)
      activesupport (= 6.1.7.3)
    activerecord (6.1.7.3)
      activemodel (= 6.1.7.3)
      activesupport (= 6.1.7.3)
    activestorage (6.1.7.3)
      actionpack (= 6.1.7.3)
      activejob (= 6.1.7.3)
      activerecord (= 6.1.7.3)
      activesupport (= 6.1.7.3)
      marcel (~> 1.0)
      mini_mime (>= 1.1.0)
    activesupport (6.1.7.3)
      concurrent-ruby (~> 1.0, >= 1.0.2)
      i18n (>= 1.6, < 2)
      minitest (>= 5.1)
      tzinfo (~> 2.0)
      zeitwerk (~> 2.3)
    ansi (1.5.0)
    bigdecimal (1.3.5)
    bindex (0.8.1)
    builder (3.3.0)
    coderay (1.1.3)
    concurrent-ruby (1.3.3)
    crass (1.0.6)
    date (3.3.4)
    diff-lcs (1.5.1)
    docile (1.1.5)
    erubi (1.13.0)
    globalid (1.2.1)
      activesupport (>= 6.1)
    i18n (1.14.5)
      concurrent-ruby (~> 1.0)
    jbuilder (2.12.0)
      actionview (>= 5.0.0)
      activesupport (>= 5.0.0)
    json (1.8.6)
    loofah (2.22.0)
      crass (~> 1.0.2)
      nokogiri (>= 1.12.0)
    mail (2.8.1)
      mini_mime (>= 0.1.1)
      net-imap
      net-pop
      net-smtp
    marcel (1.0.4)
    method_source (1.1.0)
    mini_mime (1.1.5)
    mini_portile2 (2.8.7)
    minitest (5.24.0)
    multi_json (1.15.0)
    net-imap (0.4.14)
      date
      net-protocol
    net-pop (0.1.2)
      net-protocol
    net-protocol (0.2.2)
      timeout
    net-smtp (0.5.0)
      net-protocol
    newrelic_rpm (9.11.0)
    nio4r (2.7.3)
    nokogiri (1.16.6)
      mini_portile2 (~> 2.8.2)
      racc (~> 1.4)
    pdfkit (0.6.2)
    pry (0.14.2)
      coderay (~> 1.1)
      method_source (~> 1.0)
    racc (1.8.0)
    rack (2.2.9)
    rack-test (2.1.0)
      rack (>= 1.3)
    rails (6.1.7.3)
      actioncable (= 6.1.7.3)
      actionmailbox (= 6.1.7.3)
      actionmailer (= 6.1.7.3)
      actionpack (= 6.1.7.3)
      actiontext (= 6.1.7.3)
      actionview (= 6.1.7.3)
      activejob (= 6.1.7.3)
      activemodel (= 6.1.7.3)
      activerecord (= 6.1.7.3)
      activestorage (= 6.1.7.3)
      activesupport (= 6.1.7.3)
      bundler (>= 1.15.0)
      railties (= 6.1.7.3)
      sprockets-rails (>= 2.0.0)
    rails-dom-testing (2.2.0)
      activesupport (>= 5.0.0)
      minitest
      nokogiri (>= 1.6)
    rails-html-sanitizer (1.6.0)
      loofah (~> 2.21)
      nokogiri (~> 1.14)
    railties (6.1.7.3)
      actionpack (= 6.1.7.3)
      activesupport (= 6.1.7.3)
      method_source
      rake (>= 12.2)
      thor (~> 1.0)
    rake (13.2.1)
    rdoc (4.3.0)
    rspec (3.10.0)
      rspec-core (~> 3.10.0)
      rspec-expectations (~> 3.10.0)
      rspec-mocks (~> 3.10.0)
    rspec-core (3.10.2)
      rspec-support (~> 3.10.0)
    rspec-expectations (3.10.2)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.10.0)
    rspec-mocks (3.10.3)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.10.0)
    rspec-rails (5.1.2)
      actionpack (>= 5.2)
      activesupport (>= 5.2)
      railties (>= 5.2)
      rspec-core (~> 3.10)
      rspec-expectations (~> 3.10)
      rspec-mocks (~> 3.10)
      rspec-support (~> 3.10)
    rspec-support (3.10.3)
    rubyzip (2.3.2)
    sablon (0.3.2)
      nokogiri (>= 1.8.5)
      rubyzip (>= 1.1.1)
    sdoc (0.4.2)
      json (~> 1.7, >= 1.7.7)
      rdoc (~> 4.0)
    shoulda-matchers (4.0.1)
      activesupport (>= 4.2.0)
    simplecov (0.9.2)
      docile (~> 1.1.0)
      multi_json (~> 1.0)
      simplecov-html (~> 0.9.0)
    simplecov-html (0.9.0)
    simplecov-rcov (0.2.3)
      simplecov (>= 0.4.1)
    sprockets (4.2.1)
      concurrent-ruby (~> 1.0)
      rack (>= 2.2.4, < 4)
    sprockets-rails (3.5.1)
      actionpack (>= 6.1)
      activesupport (>= 6.1)
      sprockets (>= 3.0.0)
    thor (1.3.1)
    timeout (0.4.1)
    turn (0.9.6)
      ansi
    tzinfo (2.0.6)
      concurrent-ruby (~> 1.0)
    web-console (4.2.1)
      actionview (>= 6.0.0)
      activemodel (>= 6.0.0)
      bindex (>= 0.4.0)
      railties (>= 6.0.0)
    websocket-driver (0.7.6)
      websocket-extensions (>= 0.1.0)
    websocket-extensions (0.1.5)
    zeitwerk (2.6.16)

PLATFORMS
  ruby

DEPENDENCIES
  bigdecimal (= 1.3.5)
  jbuilder (~> 2.0)
  newrelic_rpm
  nokogiri
  pdfkit (~> 0.6.2)
  pry
  rails (= 6.1.7.3)
  rake
  rspec (~> 3.10.0)
  rspec-rails (~> 5.0)
  sablon (~> 0.3.0)
  sdoc (~> 0.4.0)
  shoulda-matchers (~> 4.0.1)
  simplecov (~> 0.9.2)
  simplecov-rcov (~> 0.2.3)
  turn (< 0.9.7)
  web-console

RUBY VERSION
   ruby 3.1.3p185

BUNDLED WITH
   2.1.4

Upvotes: 0

Views: 61

Answers (0)

Related Questions