{"record":{"id":"7ab43a81bb448979","repo":"invoke-ai/InvokeAI","slug":"queue-user-is-not-authorized-to-access-this-video","errorCode":null,"errorMessage":"Queue user is not authorized to access this video","messagePattern":"Queue user is not authorized to access this video","errorType":"exception","errorClass":"PermissionError","httpStatus":null,"severity":"error","filePath":"invokeai/app/services/shared/invocation_context.py","lineNumber":355,"sourceCode":"    Mirrors :class:`ImagesInterface` but consumes a path to an already-encoded\n    MP4 (or other supported container) rather than an in-memory PIL image —\n    video encoding is the caller's responsibility (e.g. the\n    ``wan_latents_to_video`` node uses ``imageio[ffmpeg]``).\n    \"\"\"\n\n    def __init__(self, services: InvocationServices, data: InvocationContextData, util: \"UtilInterface\") -> None:\n        super().__init__(services, data)\n        self._util = util\n\n    def _assert_read_access(self, video_name: str) -> None:\n        if not self._services.configuration.multiuser:\n            return\n        user_id = self._data.queue_item.user_id\n        user = self._services.users.get(user_id)\n        # See ImagesInterface._assert_read_access: deactivated accounts keep no\n        # queue-time privileges.\n        if user is None or not user.is_active:\n            raise PermissionError(\"Queue user is not authorized to access this video\")\n        if user.is_admin or self._services.video_records.get_user_id(video_name) == user_id:\n            return\n        board_id = self._services.board_video_records.get_board_for_video(video_name)\n        if board_id is not None:\n            board = self._services.boards.get_dto(board_id)\n            if board.board_visibility in (BoardVisibility.Shared, BoardVisibility.Public):\n                return\n        raise PermissionError(\"Queue user is not authorized to access this video\")\n\n    def save(\n        self,\n        source_path: Path,\n        width: int,\n        height: int,\n        duration: float,\n        fps: Optional[float] = None,\n        board_id: Optional[str] = None,\n        image_category: ImageCategory = ImageCategory.GENERAL,","sourceCodeStart":337,"sourceCodeEnd":373,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/app/services/shared/invocation_context.py#L337-L373","documentation":"VideosInterface._assert_read_access throws PermissionError when the queue item's user account is None or deactivated. Mirroring the images interface, deactivated accounts keep no queue-time privileges, so their queued graphs cannot read any video.","triggerScenarios":"Invocations calling videos.get_pil/get_metadata/get_dto/get_path while users.get(queue_item.user_id) returns None or is_active=False in multiuser mode.","commonSituations":"Video-generation queue items still executing after the submitting user was deactivated or deleted; reprocessing stale queue items from removed accounts.","solutions":["Reactivate the user account tied to the queue item","Cancel and requeue the item under an active user","Purge stale queue items when deactivating accounts","Catch PermissionError and fail the invocation gracefully"],"exampleFix":"# before\nframe = context.videos.get_pil(video_name)\n# after\nuser = services.users.get(context.queue_item.user_id)\nif user is None or not user.is_active:\n    raise CancelledException\nframe = context.videos.get_pil(video_name)","handlingStrategy":"try-catch","validationCode":"user = services.users.get(queue_item.user_id)\nif user is None or not user.is_active:\n    raise CancelledException(\"queue user deactivated\")","typeGuard":"def queue_user_active(services, queue_item) -> bool:\n    user = services.users.get(queue_item.user_id)\n    return user is not None and user.is_active","tryCatchPattern":"try:\n    meta = context.videos.get_metadata(video_name)\nexcept PermissionError:\n    meta = None  # skip / fail gracefully","preventionTips":["Cancel queue items when deactivating users","Check account status before processing stale queue items","Assume zero privileges for missing/deactivated users in custom nodes"],"tags":["permissions","multiuser","invokeai","video-access"],"backgroundTag":"permission-denied","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}