invoke-ai/InvokeAI · error · HTTPException
Failed to unstar images
Error message
Failed to unstar images
What it means
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.
Source
Thrown at invokeai/app/api/routers/images.py:749
)
unstarred_images.add(image_name)
affected_boards.add(updated_image_dto.board_id or "none")
except HTTPException:
continue
except ImageRecordNotFoundException:
# See star_images_in_list.
continue
except Exception:
failed_images.add(image_name)
return UnstarredImagesResult(
unstarred_images=list(unstarred_images),
failed_images=list(failed_images),
affected_boards=list(affected_boards),
)
except HTTPException:
raise
except Exception:
raise HTTPException(status_code=500, detail="Failed to unstar images")
class ImagesDownloaded(BaseModel):
response: Optional[str] = Field(
default=None, description="The message to display to the user when images begin downloading"
)
bulk_download_item_name: Optional[str] = Field(
default=None, description="The name of the bulk download item for which events will be emitted"
)
@images_router.post(
"/download", operation_id="download_images_from_list", response_model=ImagesDownloaded, status_code=202
)
def download_images_from_list(
current_user: CurrentUserOrDefault,
background_tasks: BackgroundTasks,
image_names: Optional[list[ImageName]] = Body(View on GitHub (pinned to 0b6a024f2f)
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
Defensive patterns
Strategy: validation
Validate before calling
const existing = new Set((await api.getImageDtos(imageNames)).map(i => i.image_name)); const validNames = imageNames.filter(n => existing.has(n));
Try / catch
try {
const res = await api.unstarImagesInList(validNames);
} catch (e) {
if (e instanceof ApiError && e.status === 500) {
// retry with smaller batches; consult server logs
}
} Prevention
- 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
When it happens
Trigger: 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).
Common situations: Concurrent modification of the same images by queue workers; sqlite 'database is locked' during bulk updates; stale image names after external DB manipulation.
Related errors
- Failed to remove image from board
- Failed to get intermediates
- Failed to delete images
- Failed to star images
- Failed to get image DTOs
AI-assisted analysis of invoke-ai/InvokeAI@0b6a024f2f (2026-08-29).
Data as JSON: /api/errors/99c8c726a491ee20.
Report an issue: GitHub.