invoke-ai/InvokeAI · error · PermissionError

Queue user is not authorized to access this image

Error message

Queue user is not authorized to access this image

What it means

ImagesInterface._assert_read_access throws PermissionError when the queue item's user cannot read the given image. In multiuser mode a deactivated or deleted user account retains no queue-time privileges, and non-owner/non-admin users may only read images they own or that sit on a Shared/Public board.

Source

Thrown at invokeai/app/services/shared/invocation_context.py:182

        """
        self._services.logger.error(message)


class ImagesInterface(InvocationContextInterface):
    def __init__(self, services: InvocationServices, data: InvocationContextData, util: "UtilInterface") -> None:
        super().__init__(services, data)
        self._util = util

    def _assert_read_access(self, image_name: str) -> None:
        if not self._services.configuration.multiuser:
            return
        user_id = self._data.queue_item.user_id
        user = self._services.users.get(user_id)
        # A deactivated or deleted account keeps no queue-time privileges: its
        # queued graphs must not read media even if the item slipped past the
        # processor's owner checks.
        if user is None or not user.is_active:
            raise PermissionError("Queue user is not authorized to access this image")
        if user.is_admin or self._services.image_records.get_user_id(image_name) == user_id:
            return
        board_id = self._services.board_image_records.get_board_for_image(image_name)
        if board_id is not None:
            board = self._services.boards.get_dto(board_id)
            if board.board_visibility in (BoardVisibility.Shared, BoardVisibility.Public):
                return
        raise PermissionError("Queue user is not authorized to access this image")

    def save(
        self,
        image: Image,
        board_id: Optional[str] = None,
        image_category: ImageCategory = ImageCategory.GENERAL,
        metadata: Optional[MetadataField] = None,
    ) -> ImageDTO:
        """Saves an image, returning its DTO.

View on GitHub (pinned to 0b6a024f2f)

Solutions

  1. Ensure the queue-time user account exists and is active (reactivate it or reassign queue items)
  2. Have the image placed on a Shared or Public board so the queue user can read it
  3. Run the workflow as an admin user or the image owner
  4. Catch PermissionError in the invocation and substitute a fallback image or fail gracefully

Example fix

# before: reading another user's private image
pil = context.images.get_pil(other_users_image_name)
# after: guard access first
user = services.users.get(context.queue_item.user_id)
if user and user.is_active and services.image_records.get_user_id(name) == user.id:
    pil = context.images.get_pil(name)
Defensive patterns

Strategy: try-catch

Validate before calling

user = services.users.get(context._data.queue_item.user_id)
owner = services.image_records.get_user_id(image_name)
board_id = services.board_image_records.get_board_for_image(image_name)
assert user and user.is_active, "queue user deactivated"
assert user.is_admin or owner == user.id or (board_id and services.boards.get_dto(board_id).board_visibility in (BoardVisibility.Shared, BoardVisibility.Public)), "no read access"

Type guard

def can_read_image(services, queue_item, image_name: str) -> bool:
    user = services.users.get(queue_item.user_id)
    if not user or not user.is_active:
        return False
    if user.is_admin or services.image_records.get_user_id(image_name) == user.id:
        return True
    board_id = services.board_image_records.get_board_for_image(image_name)
    return bool(board_id) and services.boards.get_dto(board_id).board_visibility in (BoardVisibility.Shared, BoardVisibility.Public)

Try / catch

try:
    pil = context.images.get_pil(image_name)
except PermissionError:
    pil = None  # fallback / fail node gracefully

Prevention

When it happens

Trigger: Invocation code calling images.get_pil/get_metadata/get_dto/get_path for an image while (a) the queue item's user_id resolves to a None or inactive user, or (b) the user is not admin, does not own the image, and the image is not on a Shared/Public board.

Common situations: An admin deactivates a user while their queue items are still processing; a workflow loads another user's image outputs; images left on private boards being read by shared workflows.

Understand the failure class

Background: Permission denied / not authorized / 403 Forbidden: access-control rejections when the caller lacks the required role, grant, or ownership — this error's family across 18 libraries.

Related errors


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