invoke-ai/InvokeAI · error · PermissionError

Queue user is not authorized to save videos

Error message

Queue user is not authorized to save videos

What it means

VideosInterface.save throws PermissionError in multiuser mode when the queue item's user is missing or deactivated. Just like images, video outputs cannot be persisted by accounts that no longer hold queue-time privileges.

Source

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

        self._util.signal_progress("Saving video")

        metadata_ = None
        if metadata:
            metadata_ = metadata.model_dump_json()
        elif isinstance(self._data.invocation, WithMetadata) and self._data.invocation.metadata:
            metadata_ = self._data.invocation.metadata.model_dump_json()

        board_id_ = None
        if board_id:
            board_id_ = board_id
        elif isinstance(self._data.invocation, WithBoard) and self._data.invocation.board:
            board_id_ = self._data.invocation.board.board_id

        if self._services.configuration.multiuser:
            user = self._services.users.get(self._data.queue_item.user_id)
            # See ImagesInterface.save: deactivated accounts must not save outputs.
            if user is None or not user.is_active:
                raise PermissionError("Queue user is not authorized to save videos")
            if board_id_ is not None:
                board = self._services.boards.get_dto(board_id_)
                if (
                    not user.is_admin
                    and board.user_id != self._data.queue_item.user_id
                    and board.board_visibility != BoardVisibility.Public
                ):
                    raise PermissionError("Queue user is not authorized to save videos to this board")

        workflow_ = None
        if self._data.queue_item.workflow:
            workflow_ = self._data.queue_item.workflow.model_dump_json()

        graph_ = None
        if self._data.queue_item.session.graph:
            graph_ = self._data.queue_item.session.graph.model_dump_json()

        return self._services.videos.create(

View on GitHub (pinned to 0b6a024f2f)

Solutions

  1. Reactivate the account before the video job finishes
  2. Cancel the user's queued items prior to deactivation
  3. Run the job under an active user account
  4. Catch PermissionError around videos.save and skip/defer saving

Example fix

# before
context.videos.save(path, w, h)  # raises if user deactivated
# after
try:
    context.videos.save(path, w, h)
except PermissionError:
    logger.warning("output discarded: queue user deactivated")
Defensive patterns

Strategy: try-catch

Validate before calling

cfg = services.configuration
user = services.users.get(queue_item.user_id)
if cfg.multiuser and (user is None or not user.is_active):
    raise SkipSave("cannot save video: queue user deactivated")

Type guard

def can_save_video(services, queue_item) -> bool:
    if not services.configuration.multiuser:
        return True
    user = services.users.get(queue_item.user_id)
    return user is not None and user.is_active

Try / catch

try:
    context.videos.save(path, width, height, board_id=board_id)
except PermissionError:
    logger.warning("video save rejected: user lacks privileges")

Prevention

When it happens

Trigger: An invocation calls videos.save(source_path, width, height, board_id...) while configuration.multiuser is true and users.get(queue_item.user_id) is None or is_active=False.

Common situations: Video generations are long; an admin deactivates the submitting user mid-render and the final save step fails; batch jobs spanning account cleanup.

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/58af05761dcedb53. Report an issue: GitHub.