invoke-ai/InvokeAI · error · HTTPException
Unexpected error while resuming queue: {e}
Error message
Unexpected error while resuming queue: {e} What it means
Thrown by the resume endpoint (PUT /{queue_id}/processor/resume, admin only): any exception from SessionProcessor.resume() is wrapped as a 500 with the exception message embedded. It means the queue processor could not be transitioned back to running for an unanticipated reason (the endpoint doesn't model processor-state conflicts as 4xx).
Source
Thrown at invokeai/app/api/routers/session_queue.py:275
return [sanitize_queue_item_for_user(item, current_user.user_id, current_user.is_admin) for item in summaries]
except Exception:
raise HTTPException(status_code=500, detail="Failed to get queue item summaries")
@session_queue_router.put(
"/{queue_id}/processor/resume",
operation_id="resume",
responses={200: {"model": SessionProcessorStatus}},
)
def resume(
current_user: AdminUserOrDefault,
queue_id: str = Path(description="The queue id to perform this operation on"),
) -> SessionProcessorStatus:
"""Resumes session processor. Admin only."""
try:
return ApiDependencies.invoker.services.session_processor.resume()
except Exception as e:
raise HTTPException(status_code=500, detail=f"Unexpected error while resuming queue: {e}")
@session_queue_router.put(
"/{queue_id}/processor/pause",
operation_id="pause",
responses={200: {"model": SessionProcessorStatus}},
)
def pause(
current_user: AdminUserOrDefault,
queue_id: str = Path(description="The queue id to perform this operation on"),
) -> SessionProcessorStatus:
"""Pauses session processor. Admin only."""
try:
return ApiDependencies.invoker.services.session_processor.pause()
except Exception as e:
raise HTTPException(status_code=500, detail=f"Unexpected error while pausing queue: {e}")
View on GitHub (pinned to 0b6a024f2f)
Solutions
- Read detail - it contains the underlying exception message
- Check GET /{queue_id}/processor/status; if already running, resume is unnecessary - skip it
- Retry after the app finishes startup (processor initialized)
- Serialize admin processor operations to avoid concurrent resume/pause races
Example fix
// before: blind resume
await fetch(`/api/v1/queue/default/processor/resume`, {method: 'PUT'});
// after: check state first
const s = await (await fetch('/api/v1/queue/default/processor/status')).json();
if (!s.is_started || s.status === 'paused') await fetch('/api/v1/queue/default/processor/resume', {method: 'PUT'}); Defensive patterns
Strategy: validation
Validate before calling
const s = await (await fetch('/api/v1/queue/default/processor/status')).json();
if (s.is_started && s.status !== 'paused') console.log('processor already running; resume unnecessary'); Type guard
function isProcessorRunning(s) { return s !== null && typeof s === 'object' && s.is_started === true && s.status === 'idle' || s.status === 'processing'; } Try / catch
try {
const res = await fetch('/api/v1/queue/default/processor/resume', {method:'PUT'});
if (res.status === 500) console.error('resume failed:', (await res.json()).detail);
} catch (e) { console.error('network error during resume:', e); } Prevention
- Check processor status before resume to make the call idempotent
- Wait for app startup to complete before issuing processor commands
- Ensure the caller has admin rights in multiuser mode
- Serialize processor operations across clients
When it happens
Trigger: Resuming when the session processor service is in an unexpected state, is not started, or an internal error occurs in the processor's resume path.
Common situations: Calling resume concurrently from multiple admin sessions; invoking before the queue processor thread/service has fully initialized after startup; stale UI holding an old processor state.
Related errors
- Unexpected error while pausing queue: {e}
- Unexpected error while enqueuing batch: {e}
- Unexpected error while listing all queue items: {e}
- Unexpected error while listing all queue item ids: {e}
- Failed to get queue items
AI-assisted analysis of invoke-ai/InvokeAI@0b6a024f2f (2026-08-29).
Data as JSON: /api/errors/774ff9abaad55b01.
Report an issue: GitHub.