invoke-ai/InvokeAI · error · HTTPException

You do not have permission to retry queue item {item_id}

Error message

You do not have permission to retry queue item {item_id}

What it means

A 403 raised when a non-admin user attempts to retry a queue item whose root queue item was created by a different user. Ownership is enforced on the root of the workflow-call chain, so even items you can see may be un-retryable if the originating item belongs to another user.

Source

Thrown at invokeai/app/api/routers/session_queue.py:403

) -> RetryItemsResult:
    """Retries the given queue items. Users can only retry their own items unless they are an admin."""
    try:
        # Check queue membership for all items and ownership for non-admins.
        valid_item_ids: list[int] = []
        for item_id in item_ids:
            try:
                queue_item = ApiDependencies.invoker.services.session_queue.get_queue_item(item_id)
                if queue_item.queue_id != queue_id:
                    raise HTTPException(
                        status_code=404, detail=f"Queue item with id {item_id} not found in queue {queue_id}"
                    )
                root_queue_item = _get_workflow_call_root_queue_item(queue_item)
                if root_queue_item.queue_id != queue_id:
                    raise HTTPException(
                        status_code=404, detail=f"Queue item with id {item_id} not found in queue {queue_id}"
                    )
                if not current_user.is_admin and root_queue_item.user_id != current_user.user_id:
                    raise HTTPException(
                        status_code=403, detail=f"You do not have permission to retry queue item {item_id}"
                    )
                valid_item_ids.append(item_id)
            except SessionQueueItemNotFoundError:
                # Skip items that don't exist - they will be handled by retry_items_by_id
                continue

        return ApiDependencies.invoker.services.session_queue.retry_items_by_id(
            queue_id=queue_id, item_ids=valid_item_ids
        )
    except HTTPException:
        raise
    except Exception as e:
        raise HTTPException(status_code=500, detail=f"Unexpected error while retrying queue items: {e}")


@session_queue_router.put(
    "/{queue_id}/clear",

View on GitHub (pinned to 0b6a024f2f)

Solutions

  1. Have the owning user (or an admin) perform the retry.
  2. Log in with the account that originally enqueued the item.
  3. Ensure your auth token maps to the expected user (check current_user via the API) — stale tokens often attribute calls to the wrong account.
  4. Filter requested item ids to those you own before calling the endpoint.

Example fix

// before
requests.put(url, json={"item_ids": item_ids})
// after: only retry items whose root owner is the current user
mine = [i for i in item_ids if get_root_owner(i) == current_user_id]
requests.put(url, json={"item_ids": mine})
Defensive patterns

Strategy: validation

Validate before calling

// only request items owned by the current user (non-admin)
const owned = itemIds.filter(id => rootOwner(id) === currentUserId);
if (owned.length === 0) throw new Error('no retryable items owned by current user');

Type guard

function canRetry(item, user) {
  return user.is_admin || item?.root?.user_id === user.user_id;
}

Try / catch

try {
  const r = await retry(owned);
  if (r.status === 403) console.error('retry forbidden: item owned by another user');
} catch (e) {
  if (e.status === 403) {
    // request the owner or an admin to retry, or switch accounts
  }
}

Prevention

When it happens

Trigger: PUT retry_items_by_id as a non-admin where root_queue_item.user_id != current_user.user_id for any requested id.

Common situations: Shared InvokeAI instance with multiple users; scripts running under one account retrying items queued by another; token/auth misconfiguration causing requests to be attributed to the wrong user.

Related errors


AI-assisted analysis of invoke-ai/InvokeAI@0b6a024f2f (2026-08-29). Data as JSON: /api/errors/fe7c8232df0a4264. Report an issue: GitHub.