{"record":{"id":"99c8c726a491ee20","repo":"invoke-ai/InvokeAI","slug":"failed-to-unstar-images","errorCode":null,"errorMessage":"Failed to unstar images","messagePattern":"Failed to unstar images","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"invokeai/app/api/routers/images.py","lineNumber":749,"sourceCode":"                )\n                unstarred_images.add(image_name)\n                affected_boards.add(updated_image_dto.board_id or \"none\")\n            except HTTPException:\n                continue\n            except ImageRecordNotFoundException:\n                # See star_images_in_list.\n                continue\n            except Exception:\n                failed_images.add(image_name)\n        return UnstarredImagesResult(\n            unstarred_images=list(unstarred_images),\n            failed_images=list(failed_images),\n            affected_boards=list(affected_boards),\n        )\n    except HTTPException:\n        raise\n    except Exception:\n        raise HTTPException(status_code=500, detail=\"Failed to unstar images\")\n\n\nclass ImagesDownloaded(BaseModel):\n    response: Optional[str] = Field(\n        default=None, description=\"The message to display to the user when images begin downloading\"\n    )\n    bulk_download_item_name: Optional[str] = Field(\n        default=None, description=\"The name of the bulk download item for which events will be emitted\"\n    )\n\n\n@images_router.post(\n    \"/download\", operation_id=\"download_images_from_list\", response_model=ImagesDownloaded, status_code=202\n)\ndef download_images_from_list(\n    current_user: CurrentUserOrDefault,\n    background_tasks: BackgroundTasks,\n    image_names: Optional[list[ImageName]] = Body(","sourceCodeStart":731,"sourceCodeEnd":767,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/app/api/routers/images.py#L731-L767","documentation":"HTTP 500 raised by POST /images/unstar when unstarring the listed image_names throws an unexpected exception. Symmetric with the star endpoint: per-image problems land in failed_images; this detail means an unhandled service error occurred.","triggerScenarios":"POST /api/v1/images/unstar with image_names whose records cannot be read or updated by the images service (DB error, storage failure, corrupt records).","commonSituations":"Concurrent modification of the same images by queue workers; sqlite 'database is locked' during bulk updates; stale image names after external DB manipulation.","solutions":["Check server logs for the root exception","Refresh the image list and retry only existing image names","Retry with a smaller batch to find the failing image","Restart InvokeAI if the DB lock persists"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const existing = new Set((await api.getImageDtos(imageNames)).map(i => i.image_name));\nconst validNames = imageNames.filter(n => existing.has(n));","typeGuard":null,"tryCatchPattern":"try {\n  const res = await api.unstarImagesInList(validNames);\n} catch (e) {\n  if (e instanceof ApiError && e.status === 500) {\n    // retry with smaller batches; consult server logs\n  }\n}","preventionTips":["Re-fetch image lists before bulk mutations","Handle failed_images from prior star/unstar responses","Retry transient DB-lock failures after a short backoff","Restart app if 'database is locked' errors persist"],"tags":["http-500","api","invokeai"],"backgroundTag":"bulk-star-failed","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}