-
Notifications
You must be signed in to change notification settings - Fork 126
Description
Description
When filtering in_progress jobs by queue name in Mission Control UI, an error occurs because the code attempts to access queue_name column directly on solid_queue_claimed_executions table, which doesn't have this column.
Environment
- mission_control-jobs: 1.1.0
- solid_queue: 1.2.4
- Rails: 8.0
- PostgreSQL: 16
Error
ActiveRecord::StatementInvalid: PG::UndefinedColumn: ERROR: column solid_queue_claimed_executions.queue_name does not exist
LINE 1: ...NT(*) FROM "solid_queue_claimed_executions" WHERE "solid_que...
^
Analysis
Looking at lib/active_job/queue_adapters/solid_queue_ext.rb, the filter_executions_by_queue method (lines 239-246):
def filter_executions_by_queue(executions)
return executions unless queue_name.present?
if solid_queue_status.ready?
executions.where(queue_name: queue_name)
else
executions.where(job: { queue_name: queue_name })
end
endThe logic correctly uses where(job: { queue_name: ... }) for non-ready statuses (including claimed). However, the error suggests that in some scenario, a direct queue_name query is being executed against claimed_executions.
Solid Queue Schema
The solid_queue_claimed_executions table by design does NOT have a queue_name column:
create_table :solid_queue_claimed_executions do |t|
t.bigint :job_id, null: false
t.bigint :process_id
t.datetime :created_at, null: false
# Note: no queue_name column here
endThis is intentional - queue_name is stored in the solid_queue_jobs table and should be accessed via JOIN.
Steps to Reproduce
- Have some jobs in
in_progress(claimed) status - Open Mission Control Jobs UI
- Try to filter jobs by queue name while viewing in_progress jobs
- Error occurs
Possible Cause
There might be another code path that directly queries queue_name on execution tables without the ready? check, or the solid_queue_status inquiry is not properly returning claimed? in some edge case.
Suggested Fix
Ensure all code paths that filter by queue_name use the JOIN approach (where(job: { queue_name: ... })) for execution tables that don't have the queue_name column (like claimed_executions and failed_executions).