{"record":{"id":"11734b1762bffbfb","repo":"bensheldon/good_job","slug":"concurrency-key-must-be-a-string-was-a-key-valu","errorCode":null,"errorMessage":"Concurrency key must be a String; was a #{key_value.class}","messagePattern":"Concurrency key must be a String; was a #(.+?)","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"lib/good_job/active_job_extensions/concurrency.rb","lineNumber":66,"sourceCode":"            perform_throttle = resolve_throttle(job, @perform_throttle)\n            return nil unless perform_limit || perform_throttle\n\n            check_perform(perform_limit, perform_throttle, job, resolved_key, resolved_label)\n          end\n        end\n\n        private\n\n        def key_explicit?\n          !@key.equal?(GoodJob::NONE)\n        end\n\n        def resolve_key(job)\n          if key.blank?\n            \"label:#{resolve_label(job)}\"\n          else\n            key_value = @key.respond_to?(:call) ? job.instance_exec(&@key) : @key\n            raise TypeError, \"Concurrency key must be a String; was a #{key_value.class}\" if key_value.present? && VALID_TYPES.none? { |type| key_value.is_a?(type) }\n\n            key_value\n          end\n        end\n\n        def resolve_label(job)\n          return if @label.blank?\n\n          @label.respond_to?(:call) ? job.instance_exec(&@label) : @label\n        end\n\n        def resolve_limit(job, value)\n          return nil if value.nil?\n\n          value = job.instance_exec(&value) if value.respond_to?(:call)\n          value = nil unless value.present? && (0...Float::INFINITY).cover?(value)\n          value\n        end","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/bensheldon/good_job/blob/5fcde48f8765e69901ffa9c5a06122b19c73875f/lib/good_job/active_job_extensions/concurrency.rb#L48-L84","documentation":"Error \"Concurrency key must be a String; was a #{key_value.class}\" thrown in bensheldon/good_job.","triggerScenarios":"Thrown at lib/good_job/active_job_extensions/concurrency.rb:66 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Return a String from the concurrency key lambda in good_job_control_concurrency_with.","Convert the key value to a String, e.g. call .to_s in the key block."],"exampleFix":"good_job_control_concurrency_with key: -> { arguments.first.to_s }","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"}