{"record":{"id":"0ec1594d1a82ad5a","repo":"ankane/searchkick","slug":"no-index-to-resume","errorCode":null,"errorMessage":"No index to resume","messagePattern":"No index to resume","errorType":"exception","errorClass":"Searchkick::Error","httpStatus":null,"severity":"error","filePath":"lib/searchkick/index.rb","lineNumber":369,"sourceCode":"\n    def reindex_records(object, mode: nil, refresh: false, **options)\n      mode ||= Searchkick.callbacks_value || @options[:callbacks] || :inline\n      mode = :inline if mode == :bulk\n\n      result = RecordIndexer.new(self).reindex(object, mode: mode, full: false, **options)\n      self.refresh if refresh\n      result\n    end\n\n    # https://gist.github.com/jarosan/3124884\n    # https://www.elastic.co/blog/changing-mapping-with-zero-downtime/\n    def full_reindex(relation, import: true, resume: false, retain: false, mode: nil, refresh_interval: nil, scope: nil, wait: nil, job_options: nil)\n      raise ArgumentError, \"wait only available in :async mode\" if !wait.nil? && mode != :async\n      raise ArgumentError, \"Full reindex does not support :queue mode - use :async mode instead\" if mode == :queue\n\n      if resume\n        index_name = all_indices.sort.last\n        raise Error, \"No index to resume\" unless index_name\n        index = Index.new(index_name, @options)\n      else\n        clean_indices unless retain\n\n        index_options = relation.searchkick_index_options\n        index_options.deep_merge!(settings: {index: {refresh_interval: refresh_interval}}) if refresh_interval\n        index = create_index(index_options: index_options)\n      end\n\n      import_options = {\n        mode: (mode || :inline),\n        full: true,\n        resume: resume,\n        scope: scope,\n        job_options: job_options\n      }\n\n      uuid = index.uuid","sourceCodeStart":351,"sourceCodeEnd":387,"githubUrl":"https://github.com/ankane/searchkick/blob/93e901a75b11a25101668a616e006b158251b16e/lib/searchkick/index.rb#L351-L387","documentation":"RecordIndexer#reindex accepts only mode: :async, :queue, true, or :inline (true and :inline reindex in the current process). Anything else - unknown symbols, strings, or nil - raises ArgumentError 'Invalid value for mode' before any work starts.","triggerScenarios":"Product.reindex(mode: :background) (a name guessed or carried over from other tooling), mode: :bulk, mode: nil, or mode: 'async' (a string) coming from an interpolated config value.","commonSituations":"Reading the mode from ENV or YAML config that can be nil or a string; renaming modes after a Searchkick upgrade; copying documentation that uses a mode not supported in the installed version.","solutions":["Use one of :async, :queue, :inline (or true)","Normalize the value before calling: mode = mode.presence_in(%w[async queue inline])&.to_sym || :inline","Default the config value explicitly so nil never reaches reindex"],"exampleFix":"# before\nProduct.reindex(mode: ENV['REINDEX_MODE']) # nil or 'background'\n# => ArgumentError: Invalid value for mode\n\n# after\nmode = ENV['REINDEX_MODE'].presence_in(%w[async queue inline])&.to_sym || :inline\nProduct.reindex(mode: mode)","handlingStrategy":"validation","validationCode":"VALID_MODES = %i[async queue inline].freeze\n\nmode = mode.to_s.presence_in(VALID_MODES.map(&:to_s))&.to_sym || :inline\nProduct.reindex(mode: mode)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Normalize configured mode strings to whitelisted symbols in one helper","Default nil config to :inline explicitly","Assert the mode in a boot health check when it comes from ENV"],"tags":["searchkick","reindex","mode","argumenterror"],"backgroundTag":"invalid-enum-value","analyzedSha":"93e901a75b11a25101668a616e006b158251b16e","analyzedAt":"2026-08-21T19:06:23.767Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}