{"record":{"id":"a54d903bc4ff2001","repo":"bensheldon/good_job","slug":"goodjob-dequeue-query-sortmust-be-one-of-dequeue","errorCode":null,"errorMessage":"GoodJob dequeue query sortmust be one of #{DEQUEUE_QUERY_SORTS.join(', ')}. It was '#{dequeue_query_sort}' which is not valid.","messagePattern":"GoodJob dequeue query sortmust be one of #(.+?)\\. It was '#(.+?)' which is not valid\\.","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/good_job/configuration.rb","lineNumber":56,"sourceCode":"    # Default Dashboard Live Poll button enabled\n    DEFAULT_DASHBOARD_LIVE_POLL_ENABLED = true\n    # Default enqueue_after_transaction_commit\n    DEFAULT_ENQUEUE_AFTER_TRANSACTION_COMMIT = false\n    # Default enable_pauses setting\n    DEFAULT_ENABLE_PAUSES = false\n    # Default number of candidate jobs to query when polling\n    DEFAULT_QUEUE_SELECT_LIMIT = 1_000\n    # Valid dequeue query sorts\n    DEQUEUE_QUERY_SORTS = [:created_at, :scheduled_at].freeze\n    # Valid lock strategies\n    LOCK_STRATEGIES = [:advisory, :skiplocked, :hybrid].freeze\n\n    def self.validate_execution_mode(execution_mode)\n      raise ArgumentError, \"GoodJob execution mode must be one of #{EXECUTION_MODES.join(', ')}. It was '#{execution_mode}' which is not valid.\" unless execution_mode.in?(EXECUTION_MODES)\n    end\n\n    def self.validate_dequeue_query_sort(dequeue_query_sort)\n      raise ArgumentError, \"GoodJob dequeue query sortmust be one of #{DEQUEUE_QUERY_SORTS.join(', ')}. It was '#{dequeue_query_sort}' which is not valid.\" unless dequeue_query_sort.in?(DEQUEUE_QUERY_SORTS)\n    end\n\n    # The options that were explicitly set when initializing +Configuration+.\n    # It is safe to modify this hash in place; be sure to symbolize keys.\n    # @return [Hash]\n    attr_reader :options\n\n    # The environment from which to read GoodJob's environment variables. By\n    # default, this is the current process's environment, but it can be set\n    # to something else in {#initialize}.\n    # @return [Hash]\n    attr_reader :env\n\n    # Returns the maximum number of threads GoodJob might consume\n    # @param warn [Boolean] whether to print a warning when over the limit\n    # @return [Integer]\n    def self.total_estimated_threads(warn: false)\n      utility_threads = GoodJob::SharedExecutor::MAX_THREADS","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/bensheldon/good_job/blob/5fcde48f8765e69901ffa9c5a06122b19c73875f/lib/good_job/configuration.rb#L38-L74","documentation":"Error \"GoodJob dequeue query sortmust be one of #{DEQUEUE_QUERY_SORTS.join(', ')}. It was '#{dequeue_query_sort}' which is not valid.\" thrown in bensheldon/good_job.","triggerScenarios":"Thrown at lib/good_job/configuration.rb:56 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set dequeue_query_sort to one of the listed valid sorts.","Fix the GOOD_JOB_DEQUEUE_QUERY_SORT env var or config value to a supported sort."],"exampleFix":"config.good_job.dequeue_query_sort = :scheduled_at","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5fcde48f8765e69901ffa9c5a06122b19c73875f","analyzedAt":"2026-08-23T14:55:11.399Z","schemaVersion":2},"datasetVersion":"2026-08-23T16:17:53.355Z"}