# Action Controller: Exception caught

unable to find policy `NilClassPolicy` for `nil`
Extracted source (around line #70):

    68
    69
    70
    71
    72
    73

        # @since v0.1.0
        def policy!
          policy or raise NotDefinedError, "unable to find policy `#{find(object)}` for `#{object.inspect}`"
        end

        # @return [String] the name of the key this object would have in a params hash

Extracted source (around line #160):

    158
    159
    160
    161
    162
    163

        def cached_find(record)
          policy_cache.fetch(user: user, record: record) do
            klass = yield policy_finder(record)
            next unless klass

            model = pundit_model(record)

Extracted source (around line #23):

    21
    22
    23
    24
    25
    26

          def fetch(user:, record:)
            _ = user
            @store[record] ||= yield
          end
        end
      end

Extracted source (around line #159):

    157
    158
    159
    160
    161
    162

        # @since v2.3.2
        def cached_find(record)
          policy_cache.fetch(user: user, record: record) do
            klass = yield policy_finder(record)
            next unless klass

Extracted source (around line #95):

    93
    94
    95
    96
    97
    98

        # @since v2.3.2
        def policy!(record)
          cached_find(record, &:policy!)
        end

        # @!endgroup

Extracted source (around line #67):

    65
    66
    67
    68
    69
    70

            policy_class.new(user, record)
          else
            policy!(possibly_namespaced_record)
          end

          raise NotAuthorizedError, query: query, record: record, policy: policy unless policy.public_send(query)

Extracted source (around line #94):

    92
    93
    94
    95
    96
    97

          @_pundit_policy_authorized = true

          pundit.authorize(record, query: query, policy_class: policy_class)
        end

        # Allow this action not to perform authorization.

Extracted source (around line #130):

    128
    129
    130
    131
    132
    133

      # GET /consolidacoes/:id/gerar_pdf_holerite?motorista=X
      def gerar_pdf_holerite
        authorize @consolidacao, :show?
        motorista = params[:motorista]
        user_mot  = User.motorista.find_by('LOWER(nome) = ?', motorista.to_s.downcase)
        user_mot&.regenerar_login_token! if user_mot&.login_token.blank?

Extracted source (around line #6):

    4
    5
    6
    7
    8
    9

      module BasicImplicitRender # :nodoc:
        def send_action(method, *args)
          ret = super
          default_render unless performed?
          ret
        end

Extracted source (around line #224):

    222
    223
    224
    225
    226
    227

          # which is *not* necessarily the same as the action name.
          def process_action(...)
            send_action(...)
          end

          # Actually call the method associated with the action. Override

Extracted source (around line #165):

    163
    164
    165
    166
    167
    168

          def process_action(*) # :nodoc:
            self.formats = request.formats.filter_map(&:ref)
            super
          end

          def _process_variant(options)

Extracted source (around line #259):

    257
    258
    259
    260
    261
    262

          def process_action(...)
            run_callbacks(:process_action) do
              super
            end
          end
      end

Extracted source (around line #121):

    119
    120
    121
    122
    123
    124

                  current.invoke_before(env)
                  if current.final?
                    env.value = !env.halted && (!block_given? || yield)
                  elsif current.skip?(env)
                    (skipped ||= []) << current
                    next_sequence = next_sequence.nested

Extracted source (around line #24):

    22
    23
    24
    25
    26
    27

        def with_request_id(request_id)
          old_request_id, self.current_request_id = self.current_request_id, request_id
          yield
        ensure
          self.current_request_id = old_request_id
        end

Extracted source (around line #10):

    8
    9
    10
    11
    12

      private
        def turbo_tracking_request_id(&block)
          Turbo.with_request_id(request.headers["X-Turbo-Request-Id"], &block)
        end
    end

Extracted source (around line #130):

    128
    129
    130
    131
    132
    133

                    begin
                      target, block, method, *arguments = current.expand_call_template(env, invoke_sequence)
                      target.send(method, *arguments, &block)
                    ensure
                      next_sequence = current
                    end

Extracted source (around line #23):

    21
    22
    23
    24
    25
    26

            previous_renderer = self.renderer
            self.renderer = renderer
            yield
          ensure
            self.renderer = previous_renderer
          end

Extracted source (around line #69):

    67
    68
    69
    70
    71
    72

            ActiveSupport.on_load(base) do
              around_action do |controller, action|
                ActionText::Content.with_renderer(controller, &action)
              end
            end
          end

Extracted source (around line #130):

    128
    129
    130
    131
    132
    133

                    begin
                      target, block, method, *arguments = current.expand_call_template(env, invoke_sequence)
                      target.send(method, *arguments, &block)
                    ensure
                      next_sequence = current
                    end

Extracted source (around line #130):

    128
    129
    130
    131
    132
    133

                    begin
                      target, block, method, *arguments = current.expand_call_template(env, invoke_sequence)
                      target.send(method, *arguments, &block)
                    ensure
                      next_sequence = current
                    end

Extracted source (around line #141):

    139
    140
    141
    142
    143
    144

              end

              invoke_sequence.call
            end
          end
        end

Extracted source (around line #258):

    256
    257
    258
    259
    260
    261

          # <tt>process_action</tt> callbacks around the normal behavior.
          def process_action(...)
            run_callbacks(:process_action) do
              super
            end
          end

Extracted source (around line #25):

    23
    24
    25
    26
    27
    28

        private
          def process_action(*)
            super
          rescue Exception => exception
            request.env["action_dispatch.show_detailed_exceptions"] ||= show_detailed_exceptions?
            rescue_with_handler(exception) || raise

Extracted source (around line #74):

    72
    73
    74
    75
    76
    77

            ActiveSupport::Notifications.instrument("process_action.action_controller", raw_payload) do |payload|
              result = super
              payload[:response] = response
              payload[:status]   = response.status
              result

Extracted source (around line #206):

    204
    205
    206
    207
    208
    209

          def instrument(name, payload = {})
            if notifier.listening?(name)
              instrumenter.instrument(name, payload) { yield payload if block_given? }
            else
              yield payload if block_given?
            end

Extracted source (around line #58):

    56
    57
    58
    59
    60
    61

            handle.start
            begin
              yield payload if block_given?
            rescue Exception => e
              payload[:exception] = [e.class.name, e.message]
              payload[:exception_object] = e

Extracted source (around line #206):

    204
    205
    206
    207
    208
    209

          def instrument(name, payload = {})
            if notifier.listening?(name)
              instrumenter.instrument(name, payload) { yield payload if block_given? }
            else
              yield payload if block_given?
            end

Extracted source (around line #73):

    71
    72
    73
    74
    75
    76

            ActiveSupport::Notifications.instrument("start_processing.action_controller", raw_payload)

            ActiveSupport::Notifications.instrument("process_action.action_controller", raw_payload) do |payload|
              result = super
              payload[:response] = response
              payload[:status]   = response.status

Extracted source (around line #261):

    259
    260
    261
    262
    263
    264

          def process_action(*)
            _perform_parameter_wrapping if _wrapper_enabled?
            super
          end

          # Returns the wrapper key which will be used to store wrapped parameters.

Extracted source (around line #32):

    30
    31
    32
    33
    34
    35

              # and it won't be cleaned up by the method below.
              ActiveRecord::RuntimeRegistry.reset
              super
            end

            def cleanup_view_runtime

Extracted source (around line #160):

    158
    159
    160
    161
    162
    163

          @_response_body = nil

          process_action(action_name, *args)
        end
        ruby2_keywords(:process)

Extracted source (around line #40):

    38
    39
    40
    41
    42
    43

        def process(...) # :nodoc:
          old_config, I18n.config = I18n.config, I18nProxy.new(I18n.config, lookup_context)
          super
        ensure
          I18n.config = old_config
        end

Extracted source (around line #227):

    225
    226
    227
    228
    229
    230

          set_request!(request)
          set_response!(response)
          process(name)
          request.commit_flash
          to_a
        end

Extracted source (around line #309):

    307
    308
    309
    310
    311
    312

            middleware_stack.build(name) { |env| new.dispatch(name, req, res) }.call req.env
          else
            new.dispatch(name, req, res)
          end
        end
      end

Extracted source (around line #49):

    47
    48
    49
    50
    51
    52

              def dispatch(controller, action, req, res)
                controller.dispatch(action, req, res)
              end
          end

Extracted source (around line #32):

    30
    31
    32
    33
    34
    35

              controller = controller req
              res        = controller.make_response! req
              dispatch(controller, params[:action], req, res)
            rescue ActionController::RoutingError
              if @raise_on_name_error
                raise

Extracted source (around line #51):

    49
    50
    51
    52
    53
    54

              req.route_uri_pattern = route.path.spec.to_s

              _, headers, _ = response = route.app.serve(req)

              if "pass" == headers[Constants::X_CASCADE]
                req.script_name     = script_name

Extracted source (around line #131):

    129
    130
    131
    132
    133
    134

                  path_parameters[name.to_sym] = Utils.unescape_uri(val) if val
                }
                yield [match_data, path_parameters, r]
              }
            end

Extracted source (around line #124):

    122
    123
    124
    125
    126
    127

              routes.sort_by!(&:precedence)

              routes.each { |r|
                match_data = r.path.match(path_info)
                path_parameters = {}
                match_data.names.each_with_index { |name, i|

Extracted source (around line #124):

    122
    123
    124
    125
    126
    127

              routes.sort_by!(&:precedence)

              routes.each { |r|
                match_data = r.path.match(path_info)
                path_parameters = {}
                match_data.names.each_with_index { |name, i|

Extracted source (around line #32):

    30
    31
    32
    33
    34
    35

          def serve(req)
            find_routes(req) do |match, parameters, route|
              set_params  = req.path_parameters
              path_info   = req.path_info
              script_name = req.script_name

Extracted source (around line #882):

    880
    881
    882
    883
    884
    885

            req = make_request(env)
            req.path_info = Journey::Router::Utils.normalize_path(req.path_info)
            @router.serve(req)
          end

          def recognize_path(path, environment = {})

Extracted source (around line #36):

    34
    35
    36
    37
    38
    39

          result = catch(:warden) do
            env['warden'].on_request
            @app.call(env)
          end

          result ||= {}

Extracted source (around line #34):

    32
    33
    34
    35
    36
    37

          env['warden'] = Proxy.new(env, self)
          result = catch(:warden) do
            env['warden'].on_request
            @app.call(env)
          end

Extracted source (around line #34):

    32
    33
    34
    35
    36
    37

          env['warden'] = Proxy.new(env, self)
          result = catch(:warden) do
            env['warden'].on_request
            @app.call(env)
          end

Extracted source (around line #20):

    18
    19
    20
    21
    22
    23

          begin
            _, _, body = response = @app.call(env)
          rescue Exception
            env[RACK_TEMPFILES]&.each(&:close!)
            raise

Extracted source (around line #29):

    27
    28
    29
    30
    31
    32

        def call(env)
          status, headers, body = response = @app.call(env)

          if etag_status?(status) && body.respond_to?(:to_ary) && !skip_caching?(headers)
            body = body.to_ary

Extracted source (around line #31):

    29
    30
    31
    32
    33
    34

          case env[REQUEST_METHOD]
          when "GET", "HEAD"
            status, headers, body = response = @app.call(env)

            if status == 200 && fresh?(env, headers)
              response[0] = 304

Extracted source (around line #15):

    13
    14
    15
    16
    17
    18

        def call(env)
          _, _, body = response = @app.call(env)

          if env[REQUEST_METHOD] == HEAD
            body.close if body.respond_to?(:close)

Extracted source (around line #36):

    34
    35
    36
    37
    38
    39

          def call(env)
            _, headers, _ = response = @app.call(env)

            return response if policy_present?(headers)

Extracted source (around line #36):

    34
    35
    36
    37
    38
    39

          def call(env)
            status, headers, _ = response = @app.call(env)

            # Returning CSP headers with a 304 Not Modified is harmful, since nonces in the new
            # CSP headers might not match nonces in the cached HTML.

Extracted source (around line #274):

    272
    273
    274
    275
    276
    277

              req = make_request env
              prepare_session(req)
              status, headers, body = app.call(req.env)
              res = Rack::Response::Raw.new status, headers
              commit_session(req, res)
              [status, headers, body]

Extracted source (around line #268):

    266
    267
    268
    269
    270
    271

            def call(env)
              context(env)
            end

            def context(env, app = @app)

Extracted source (around line #689):

    687
    688
    689
    690
    691
    692

        def call(env)
          request = ActionDispatch::Request.new(env)
          response = @app.call(env)

          if request.have_cookie_jar?
            cookie_jar = request.cookie_jar

Extracted source (around line #655):

    653
    654
    655
    656
    657
    658

            end

            @app.call(env)
          end

          private

Extracted source (around line #29):

    27
    28
    29
    30
    31
    32

          error = nil
          result = run_callbacks :call do
            @app.call(env)
          rescue => error
          end
          raise error if error

Extracted source (around line #101):

    99
    100
    101
    102
    103
    104

          if callbacks.empty?
            yield if block_given?
          else
            env = Filters::Environment.new(self, false, nil)

Extracted source (around line #28):

    26
    27
    28
    29
    30
    31

        def call(env)
          error = nil
          result = run_callbacks :call do
            @app.call(env)
          rescue => error
          end

Extracted source (around line #14):

    12
    13
    14
    15
    16
    17

          state = @executor.run!(reset: true)
          begin
            response = @app.call(env)

            if env["action_dispatch.report_exception"]
              error = env["action_dispatch.exception"]

Extracted source (around line #16):

    14
    15
    16
    17
    18
    19

        def call(env)
          request = ActionDispatch::Request.new(env)
          return @app.call(env) unless actionable_request?(request)

          ActiveSupport::ActionableError.dispatch(request.params[:error].to_s.safe_constantize, request.params[:action])

Extracted source (around line #29):

    27
    28
    29
    30
    31
    32

        def call(env)
          _, headers, body = response = @app.call(env)

          if headers[Constants::X_CASCADE] == "pass"
            body.close if body.respond_to?(:close)

Extracted source (around line #132):

    130
    131
    132
    133
    134
    135

          def call_app(env)
            @app.call(env)
          rescue => e
            throw :app_exception, e
          end

Extracted source (around line #19):

    17
    18
    19
    20
    21
    22

          app_exception = catch :app_exception do
            request = create_regular_or_whiny_request(env)
            return call_app(env) unless request.permitted?

            if id = id_for_repl_session_update(request)
              return update_repl_session(id, request)

Extracted source (around line #17):

    15
    16
    17
    18
    19
    20

        def call(env)
          app_exception = catch :app_exception do
            request = create_regular_or_whiny_request(env)
            return call_app(env) unless request.permitted?

Extracted source (around line #17):

    15
    16
    17
    18
    19
    20

        def call(env)
          app_exception = catch :app_exception do
            request = create_regular_or_whiny_request(env)
            return call_app(env) unless request.permitted?

Extracted source (around line #31):

    29
    30
    31
    32
    33
    34

        def call(env)
          @app.call(env)
        rescue Exception => exception
          request = ActionDispatch::Request.new env
          backtrace_cleaner = request.get_header("action_dispatch.backtrace_cleaner")

Extracted source (around line #37):

    35
    36
    37
    38
    39
    40

              logger.info { started_request_message(request) }
              status, headers, body = response = @app.call(env)
              body = ::Rack::BodyProxy.new(body, &handle.method(:finish))

              if response.frozen?

Extracted source (around line #24):

    22
    23
    24
    25
    26
    27

            if logger.respond_to?(:tagged)
              logger.tagged(*compute_tags(request)) { call_app(request, env) }
            else
              call_app(request, env)
            end

Extracted source (around line #139):

    137
    138
    139
    140
    141
    142

        def tagged(*tags)
          if block_given?
            formatter.tagged(*tags) { yield self }
          else
            logger = ActiveSupport::TaggedLogging.new(self)
            logger.formatter.extend LocalTagStorage

Extracted source (around line #39):

    37
    38
    39
    40
    41
    42

          def tagged(*tags)
            pushed_count = tag_stack.push_tags(tags).size
            yield self
          ensure
            pop_tags(pushed_count)
          end

Extracted source (around line #139):

    137
    138
    139
    140
    141
    142

        def tagged(*tags)
          if block_given?
            formatter.tagged(*tags) { yield self }
          else
            logger = ActiveSupport::TaggedLogging.new(self)
            logger.formatter.extend LocalTagStorage

Extracted source (around line #241):

    239
    240
    241
    242
    243
    244

              super(name, *args, **kwargs, &block)
            elsif loggers.one?
              loggers.first.send(name, *args, **kwargs, &block)
            else
              loggers.map { |logger| logger.send(name, *args, **kwargs, &block) }
            end

Extracted source (around line #24):

    22
    23
    24
    25
    26
    27

            if logger.respond_to?(:tagged)
              logger.tagged(*compute_tags(request)) { call_app(request, env) }
            else
              call_app(request, env)
            end

Extracted source (around line #11):

    9
    10
    11
    12
    13
    14

          ::Rails.logger.silence { @app.call(env) }
        else
          @app.call(env)
        end
      end
    end

Extracted source (around line #92):

    90
    91
    92
    93
    94
    95

          req = ActionDispatch::Request.new env
          req.remote_ip = GetIp.new(req, check_ip, proxies)
          @app.call(req.env)
        end

        # The GetIp class exists as a way to defer processing of the request data

Extracted source (around line #28):

    26
    27
    28
    29
    30
    31

          req = ActionDispatch::Request.new env
          req.request_id = make_request_id(req.headers[@header])
          @app.call(env).tap { |_status, headers, _body| headers[@header] = req.request_id }
        end

        private

Extracted source (around line #28):

    26
    27
    28
    29
    30
    31

          end

          @app.call(env)
        end

        def method_override(env)

Extracted source (around line #24):

    22
    23
    24
    25
    26
    27

        def call(env)
          start_time = Utils.clock_time
          _, headers, _ = response = @app.call(env)

          request_time = Utils.clock_time - start_time

Extracted source (around line #59):

    57
    58
    59
    60
    61
    62

          response = nil
          events = @subscriber.collect_events do
            response = @app.call(env)
          end

          headers = response[1]

Extracted source (around line #24):

    22
    23
    24
    25
    26
    27

            events = []
            ActiveSupport::IsolatedExecutionState[KEY] = events
            yield
            events
          ensure
            ActiveSupport::IsolatedExecutionState.delete(KEY)

Extracted source (around line #58):

    56
    57
    58
    59
    60
    61

        def call(env)
          response = nil
          events = @subscriber.collect_events do
            response = @app.call(env)
          end

Extracted source (around line #14):

    12
    13
    14
    15
    16
    17

          state = @executor.run!(reset: true)
          begin
            response = @app.call(env)

            if env["action_dispatch.report_exception"]
              error = env["action_dispatch.exception"]

Extracted source (around line #37):

    35
    36
    37
    38
    39
    40

          end
        else
          @app.call(env)
        end
      end

Extracted source (around line #25):

    23
    24
    25
    26
    27
    28

        def call(env)
          @file_handler.attempt(env) || @app.call(env)
        end
      end

Extracted source (around line #131):

    129
    130
    131
    132
    133
    134

        def call(env)
          _, headers, body = response = @app.call(env)

          if body.respond_to?(:to_path)
            case type = variation(env)

Extracted source (around line #334):

    332
    333
    334
    335
    336
    337

              status, headers, body = [200, { Rack::CONTENT_TYPE => 'text/html' }, [blank_page_html.dup]] # important to dup here!
            else
              status, headers, body = @app.call(env)
            end
          ensure
            trace.disable if trace

Extracted source (around line #536):

    534
    535
    536
    537
    538
    539

        def call(env)
          req = build_request env
          app.call req.env
        end

        # Defines additional Rack env configuration that is added on each call.

Extracted source (around line #279):

    277
    278
    279
    280
    281
    282

          def call(env)
            env[Const::PUMA_CONFIG] = @config
            @app.call(env)
          end
        end

Extracted source (around line #99):

    97
    98
    99
    100
    101
    102

            if @supported_http_methods == :any || @supported_http_methods.key?(env[REQUEST_METHOD])
              status, headers, app_body = @thread_pool.with_force_shutdown do
                @app.call(env)
              end
            else
              @log_writer.log "Unsupported HTTP method used: #{env[REQUEST_METHOD]}"

Extracted source (around line #390):

    388
    389
    390
    391
    392
    393

            t[:with_force_shutdown] = true
          end
          yield
        ensure
          t[:with_force_shutdown] = false
        end

Extracted source (around line #98):

    96
    97
    98
    99
    100
    101

          begin
            if @supported_http_methods == :any || @supported_http_methods.key?(env[REQUEST_METHOD])
              status, headers, app_body = @thread_pool.with_force_shutdown do
                @app.call(env)
              end
            else

Extracted source (around line #472):

    470
    471
    472
    473
    474
    475

            while true
              @requests_count += 1
              case handle_request(client, requests + 1)
              when false
                break
              when :async

Extracted source (around line #254):

    252
    253
    254
    255
    256
    257

          @status = :run

          @thread_pool = ThreadPool.new(thread_name, options) { |client| process_client client }

          if @queue_requests
            @reactor = Reactor.new(@io_selector_backend) { |c| reactor_wakeup c }

Extracted source (around line #167):

    165
    166
    167
    168
    169
    170

              begin
                @out_of_band_pending = true if block.call(work)
              rescue Exception => e
                STDERR.puts "Error reached top of thread-pool: #{e.message} (#{e.class})"
              end

`Rails.root: /app`

Application Trace | Framework Trace | Full Trace
`app/controllers/consolidacoes_controller.rb:130:in `gerar_pdf_holerite'
`
`pundit (2.5.2) lib/pundit/policy_finder.rb:70:in `policy!'
pundit (2.5.2) lib/pundit/context.rb:160:in `block in cached_find'
pundit (2.5.2) lib/pundit/cache_store/legacy_store.rb:23:in `fetch'
pundit (2.5.2) lib/pundit/context.rb:159:in `cached_find'
pundit (2.5.2) lib/pundit/context.rb:95:in `policy!'
pundit (2.5.2) lib/pundit/context.rb:67:in `authorize'
pundit (2.5.2) lib/pundit/authorization.rb:94:in `authorize'
actionpack (7.1.6) lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
actionpack (7.1.6) lib/abstract_controller/base.rb:224:in `process_action'
actionpack (7.1.6) lib/action_controller/metal/rendering.rb:165:in `process_action'
actionpack (7.1.6) lib/abstract_controller/callbacks.rb:259:in `block in process_action'
activesupport (7.1.6) lib/active_support/callbacks.rb:121:in `block in run_callbacks'
turbo-rails (2.0.23) lib/turbo-rails.rb:24:in `with_request_id'
turbo-rails (2.0.23) app/controllers/concerns/turbo/request_id_tracking.rb:10:in `turbo_tracking_request_id'
activesupport (7.1.6) lib/active_support/callbacks.rb:130:in `block in run_callbacks'
actiontext (7.1.6) lib/action_text/rendering.rb:23:in `with_renderer'
actiontext (7.1.6) lib/action_text/engine.rb:69:in `block (4 levels) in <class:Engine>'
activesupport (7.1.6) lib/active_support/callbacks.rb:130:in `instance_exec'
activesupport (7.1.6) lib/active_support/callbacks.rb:130:in `block in run_callbacks'
activesupport (7.1.6) lib/active_support/callbacks.rb:141:in `run_callbacks'
actionpack (7.1.6) lib/abstract_controller/callbacks.rb:258:in `process_action'
actionpack (7.1.6) lib/action_controller/metal/rescue.rb:25:in `process_action'
actionpack (7.1.6) lib/action_controller/metal/instrumentation.rb:74:in `block in process_action'
activesupport (7.1.6) lib/active_support/notifications.rb:206:in `block in instrument'
activesupport (7.1.6) lib/active_support/notifications/instrumenter.rb:58:in `instrument'
activesupport (7.1.6) lib/active_support/notifications.rb:206:in `instrument'
actionpack (7.1.6) lib/action_controller/metal/instrumentation.rb:73:in `process_action'
actionpack (7.1.6) lib/action_controller/metal/params_wrapper.rb:261:in `process_action'
activerecord (7.1.6) lib/active_record/railties/controller_runtime.rb:32:in `process_action'
actionpack (7.1.6) lib/abstract_controller/base.rb:160:in `process'
actionview (7.1.6) lib/action_view/rendering.rb:40:in `process'
actionpack (7.1.6) lib/action_controller/metal.rb:227:in `dispatch'
actionpack (7.1.6) lib/action_controller/metal.rb:309:in `dispatch'
actionpack (7.1.6) lib/action_dispatch/routing/route_set.rb:49:in `dispatch'
actionpack (7.1.6) lib/action_dispatch/routing/route_set.rb:32:in `serve'
actionpack (7.1.6) lib/action_dispatch/journey/router.rb:51:in `block in serve'
actionpack (7.1.6) lib/action_dispatch/journey/router.rb:131:in `block in find_routes'
actionpack (7.1.6) lib/action_dispatch/journey/router.rb:124:in `each'
actionpack (7.1.6) lib/action_dispatch/journey/router.rb:124:in `find_routes'
actionpack (7.1.6) lib/action_dispatch/journey/router.rb:32:in `serve'
actionpack (7.1.6) lib/action_dispatch/routing/route_set.rb:882:in `call'
warden (1.2.9) lib/warden/manager.rb:36:in `block in call'
warden (1.2.9) lib/warden/manager.rb:34:in `catch'
warden (1.2.9) lib/warden/manager.rb:34:in `call'
rack (3.2.6) lib/rack/tempfile_reaper.rb:20:in `call'
rack (3.2.6) lib/rack/etag.rb:29:in `call'
rack (3.2.6) lib/rack/conditional_get.rb:31:in `call'
rack (3.2.6) lib/rack/head.rb:15:in `call'
actionpack (7.1.6) lib/action_dispatch/http/permissions_policy.rb:36:in `call'
actionpack (7.1.6) lib/action_dispatch/http/content_security_policy.rb:36:in `call'
rack-session (2.1.2) lib/rack/session/abstract/id.rb:274:in `context'
rack-session (2.1.2) lib/rack/session/abstract/id.rb:268:in `call'
actionpack (7.1.6) lib/action_dispatch/middleware/cookies.rb:689:in `call'
activerecord (7.1.6) lib/active_record/migration.rb:655:in `call'
actionpack (7.1.6) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (7.1.6) lib/active_support/callbacks.rb:101:in `run_callbacks'
actionpack (7.1.6) lib/action_dispatch/middleware/callbacks.rb:28:in `call'
actionpack (7.1.6) lib/action_dispatch/middleware/executor.rb:14:in `call'
actionpack (7.1.6) lib/action_dispatch/middleware/actionable_exceptions.rb:16:in `call'
actionpack (7.1.6) lib/action_dispatch/middleware/debug_exceptions.rb:29:in `call'
web-console (4.2.1) lib/web_console/middleware.rb:132:in `call_app'
web-console (4.2.1) lib/web_console/middleware.rb:19:in `block in call'
web-console (4.2.1) lib/web_console/middleware.rb:17:in `catch'
web-console (4.2.1) lib/web_console/middleware.rb:17:in `call'
actionpack (7.1.6) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
railties (7.1.6) lib/rails/rack/logger.rb:37:in `call_app'
railties (7.1.6) lib/rails/rack/logger.rb:24:in `block in call'
activesupport (7.1.6) lib/active_support/tagged_logging.rb:139:in `block in tagged'
activesupport (7.1.6) lib/active_support/tagged_logging.rb:39:in `tagged'
activesupport (7.1.6) lib/active_support/tagged_logging.rb:139:in `tagged'
activesupport (7.1.6) lib/active_support/broadcast_logger.rb:241:in `method_missing'
railties (7.1.6) lib/rails/rack/logger.rb:24:in `call'
propshaft (1.3.2) lib/propshaft/quiet_assets.rb:11:in `call'
actionpack (7.1.6) lib/action_dispatch/middleware/remote_ip.rb:92:in `call'
actionpack (7.1.6) lib/action_dispatch/middleware/request_id.rb:28:in `call'
rack (3.2.6) lib/rack/method_override.rb:28:in `call'
rack (3.2.6) lib/rack/runtime.rb:24:in `call'
actionpack (7.1.6) lib/action_dispatch/middleware/server_timing.rb:59:in `block in call'
actionpack (7.1.6) lib/action_dispatch/middleware/server_timing.rb:24:in `collect_events'
actionpack (7.1.6) lib/action_dispatch/middleware/server_timing.rb:58:in `call'
actionpack (7.1.6) lib/action_dispatch/middleware/executor.rb:14:in `call'
propshaft (1.3.2) lib/propshaft/server.rb:37:in `call'
actionpack (7.1.6) lib/action_dispatch/middleware/static.rb:25:in `call'
rack (3.2.6) lib/rack/sendfile.rb:131:in `call'
rack-mini-profiler (4.0.1) lib/mini_profiler.rb:334:in `call'
railties (7.1.6) lib/rails/engine.rb:536:in `call'
puma (6.6.1) lib/puma/configuration.rb:279:in `call'
puma (6.6.1) lib/puma/request.rb:99:in `block in handle_request'
puma (6.6.1) lib/puma/thread_pool.rb:390:in `with_force_shutdown'
puma (6.6.1) lib/puma/request.rb:98:in `handle_request'
puma (6.6.1) lib/puma/server.rb:472:in `process_client'
puma (6.6.1) lib/puma/server.rb:254:in `block in run'
puma (6.6.1) lib/puma/thread_pool.rb:167:in `block in spawn_thread'
`
`pundit (2.5.2) lib/pundit/policy_finder.rb:70:in `policy!'
pundit (2.5.2) lib/pundit/context.rb:160:in `block in cached_find'
pundit (2.5.2) lib/pundit/cache_store/legacy_store.rb:23:in `fetch'
pundit (2.5.2) lib/pundit/context.rb:159:in `cached_find'
pundit (2.5.2) lib/pundit/context.rb:95:in `policy!'
pundit (2.5.2) lib/pundit/context.rb:67:in `authorize'
pundit (2.5.2) lib/pundit/authorization.rb:94:in `authorize'
app/controllers/consolidacoes_controller.rb:130:in `gerar_pdf_holerite'
actionpack (7.1.6) lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
actionpack (7.1.6) lib/abstract_controller/base.rb:224:in `process_action'
actionpack (7.1.6) lib/action_controller/metal/rendering.rb:165:in `process_action'
actionpack (7.1.6) lib/abstract_controller/callbacks.rb:259:in `block in process_action'
activesupport (7.1.6) lib/active_support/callbacks.rb:121:in `block in run_callbacks'
turbo-rails (2.0.23) lib/turbo-rails.rb:24:in `with_request_id'
turbo-rails (2.0.23) app/controllers/concerns/turbo/request_id_tracking.rb:10:in `turbo_tracking_request_id'
activesupport (7.1.6) lib/active_support/callbacks.rb:130:in `block in run_callbacks'
actiontext (7.1.6) lib/action_text/rendering.rb:23:in `with_renderer'
actiontext (7.1.6) lib/action_text/engine.rb:69:in `block (4 levels) in <class:Engine>'
activesupport (7.1.6) lib/active_support/callbacks.rb:130:in `instance_exec'
activesupport (7.1.6) lib/active_support/callbacks.rb:130:in `block in run_callbacks'
activesupport (7.1.6) lib/active_support/callbacks.rb:141:in `run_callbacks'
actionpack (7.1.6) lib/abstract_controller/callbacks.rb:258:in `process_action'
actionpack (7.1.6) lib/action_controller/metal/rescue.rb:25:in `process_action'
actionpack (7.1.6) lib/action_controller/metal/instrumentation.rb:74:in `block in process_action'
activesupport (7.1.6) lib/active_support/notifications.rb:206:in `block in instrument'
activesupport (7.1.6) lib/active_support/notifications/instrumenter.rb:58:in `instrument'
activesupport (7.1.6) lib/active_support/notifications.rb:206:in `instrument'
actionpack (7.1.6) lib/action_controller/metal/instrumentation.rb:73:in `process_action'
actionpack (7.1.6) lib/action_controller/metal/params_wrapper.rb:261:in `process_action'
activerecord (7.1.6) lib/active_record/railties/controller_runtime.rb:32:in `process_action'
actionpack (7.1.6) lib/abstract_controller/base.rb:160:in `process'
actionview (7.1.6) lib/action_view/rendering.rb:40:in `process'
actionpack (7.1.6) lib/action_controller/metal.rb:227:in `dispatch'
actionpack (7.1.6) lib/action_controller/metal.rb:309:in `dispatch'
actionpack (7.1.6) lib/action_dispatch/routing/route_set.rb:49:in `dispatch'
actionpack (7.1.6) lib/action_dispatch/routing/route_set.rb:32:in `serve'
actionpack (7.1.6) lib/action_dispatch/journey/router.rb:51:in `block in serve'
actionpack (7.1.6) lib/action_dispatch/journey/router.rb:131:in `block in find_routes'
actionpack (7.1.6) lib/action_dispatch/journey/router.rb:124:in `each'
actionpack (7.1.6) lib/action_dispatch/journey/router.rb:124:in `find_routes'
actionpack (7.1.6) lib/action_dispatch/journey/router.rb:32:in `serve'
actionpack (7.1.6) lib/action_dispatch/routing/route_set.rb:882:in `call'
warden (1.2.9) lib/warden/manager.rb:36:in `block in call'
warden (1.2.9) lib/warden/manager.rb:34:in `catch'
warden (1.2.9) lib/warden/manager.rb:34:in `call'
rack (3.2.6) lib/rack/tempfile_reaper.rb:20:in `call'
rack (3.2.6) lib/rack/etag.rb:29:in `call'
rack (3.2.6) lib/rack/conditional_get.rb:31:in `call'
rack (3.2.6) lib/rack/head.rb:15:in `call'
actionpack (7.1.6) lib/action_dispatch/http/permissions_policy.rb:36:in `call'
actionpack (7.1.6) lib/action_dispatch/http/content_security_policy.rb:36:in `call'
rack-session (2.1.2) lib/rack/session/abstract/id.rb:274:in `context'
rack-session (2.1.2) lib/rack/session/abstract/id.rb:268:in `call'
actionpack (7.1.6) lib/action_dispatch/middleware/cookies.rb:689:in `call'
activerecord (7.1.6) lib/active_record/migration.rb:655:in `call'
actionpack (7.1.6) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (7.1.6) lib/active_support/callbacks.rb:101:in `run_callbacks'
actionpack (7.1.6) lib/action_dispatch/middleware/callbacks.rb:28:in `call'
actionpack (7.1.6) lib/action_dispatch/middleware/executor.rb:14:in `call'
actionpack (7.1.6) lib/action_dispatch/middleware/actionable_exceptions.rb:16:in `call'
actionpack (7.1.6) lib/action_dispatch/middleware/debug_exceptions.rb:29:in `call'
web-console (4.2.1) lib/web_console/middleware.rb:132:in `call_app'
web-console (4.2.1) lib/web_console/middleware.rb:19:in `block in call'
web-console (4.2.1) lib/web_console/middleware.rb:17:in `catch'
web-console (4.2.1) lib/web_console/middleware.rb:17:in `call'
actionpack (7.1.6) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
railties (7.1.6) lib/rails/rack/logger.rb:37:in `call_app'
railties (7.1.6) lib/rails/rack/logger.rb:24:in `block in call'
activesupport (7.1.6) lib/active_support/tagged_logging.rb:139:in `block in tagged'
activesupport (7.1.6) lib/active_support/tagged_logging.rb:39:in `tagged'
activesupport (7.1.6) lib/active_support/tagged_logging.rb:139:in `tagged'
activesupport (7.1.6) lib/active_support/broadcast_logger.rb:241:in `method_missing'
railties (7.1.6) lib/rails/rack/logger.rb:24:in `call'
propshaft (1.3.2) lib/propshaft/quiet_assets.rb:11:in `call'
actionpack (7.1.6) lib/action_dispatch/middleware/remote_ip.rb:92:in `call'
actionpack (7.1.6) lib/action_dispatch/middleware/request_id.rb:28:in `call'
rack (3.2.6) lib/rack/method_override.rb:28:in `call'
rack (3.2.6) lib/rack/runtime.rb:24:in `call'
actionpack (7.1.6) lib/action_dispatch/middleware/server_timing.rb:59:in `block in call'
actionpack (7.1.6) lib/action_dispatch/middleware/server_timing.rb:24:in `collect_events'
actionpack (7.1.6) lib/action_dispatch/middleware/server_timing.rb:58:in `call'
actionpack (7.1.6) lib/action_dispatch/middleware/executor.rb:14:in `call'
propshaft (1.3.2) lib/propshaft/server.rb:37:in `call'
actionpack (7.1.6) lib/action_dispatch/middleware/static.rb:25:in `call'
rack (3.2.6) lib/rack/sendfile.rb:131:in `call'
rack-mini-profiler (4.0.1) lib/mini_profiler.rb:334:in `call'
railties (7.1.6) lib/rails/engine.rb:536:in `call'
puma (6.6.1) lib/puma/configuration.rb:279:in `call'
puma (6.6.1) lib/puma/request.rb:99:in `block in handle_request'
puma (6.6.1) lib/puma/thread_pool.rb:390:in `with_force_shutdown'
puma (6.6.1) lib/puma/request.rb:98:in `handle_request'
puma (6.6.1) lib/puma/server.rb:472:in `process_client'
puma (6.6.1) lib/puma/server.rb:254:in `block in run'
puma (6.6.1) lib/puma/thread_pool.rb:167:in `block in spawn_thread'
`

## Request

Parameters:

    {"motorista"=>"Bruno Corgozinho", "id"=>"3"}

Toggle session dump

    _csrf_token: "5gp9GSGXtkcowZwum9G8lo4PfrqgU6k5QOTqGibFw2g"
    session_id: "5b30872b26fbe71a6e42fd31083d905e"
    user_return_to: "/"
    warden.user.user.key: [[1], "$2a$12$OItHogL1JMQsM3o7sAh5SO"]

Toggle env dump

    GATEWAY_INTERFACE: "CGI/1.2"
    HTTP_ACCEPT: "text/html, application/xhtml+xml"
    HTTP_ACCEPT_ENCODING: "gzip, deflate"
    HTTP_ACCEPT_LANGUAGE: "pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7"
    HTTP_VERSION: "HTTP/1.1"
    ORIGINAL_SCRIPT_NAME: ""
    REMOTE_ADDR: "192.168.144.1"
    SERVER_NAME: "100.75.222.23"
    SERVER_PROTOCOL: "HTTP/1.1"

## Response

Headers:

    None