invoke-ai/InvokeAI · error · HTTPException

Failed to star images

Error message

Failed to star images

What it means

HTTP 500 raised by POST /images/star when starring the listed image_names throws an unexpected exception. Individual image failures are captured in failed_images within the result, so this error indicates the whole request crashed in the service layer.

Source

Thrown at invokeai/app/api/routers/images.py:703

                # Deleted by a concurrent session — a skip, not a storage failure. See
                # delete_images_from_list. Reachable here through the get_dto read-back inside
                # ImageService.update: the UPDATE itself matches no row and raises nothing, so
                # a name that vanished mid-batch surfaces only on the read that follows.
                continue
            except Exception:
                # A genuine storage failure, not an auth/404 skip: it used to be swallowed
                # by `pass`, so the client counted the image as starred and the star
                # silently vanished on reload.
                failed_images.add(image_name)
        return StarredImagesResult(
            starred_images=list(starred_images),
            failed_images=list(failed_images),
            affected_boards=list(affected_boards),
        )
    except HTTPException:
        raise
    except Exception:
        raise HTTPException(status_code=500, detail="Failed to star images")


@images_router.post("/unstar", operation_id="unstar_images_in_list", response_model=UnstarredImagesResult)
def unstar_images_in_list(
    current_user: CurrentUserOrDefault,
    image_names: list[ImageName] = Body(
        description="The list of names of images to unstar", embed=True, max_length=MAX_IMAGE_BATCH_SIZE
    ),
) -> UnstarredImagesResult:
    try:
        assert_image_move_maintenance_inactive()
    except HTTPException:
        for image_name in image_names:
            _assert_image_owner(image_name, current_user)
        raise

    try:
        # See star_images_in_list: skip foreign names instead of re-raising mid-batch, and

View on GitHub (pinned to 0b6a024f2f)

Solutions

  1. Check server logs for the underlying error
  2. Re-fetch the image list and star only images that still exist
  3. Retry with a smaller batch to isolate the offending image
  4. Verify database integrity/writability
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.starImagesInList(validNames);
} catch (e) {
  if (e instanceof ApiError && e.status === 500) {
    // halve the batch and retry to isolate the failing image
  }
}

Prevention

When it happens

Trigger: POST /api/v1/images/star with image_names the service cannot update — corrupted records, DB failure, or nonexistent images in a way that aborts rather than being recorded as failed.

Common situations: Batch contains names of images deleted moments before; sqlite lock contention during heavy queue use; stale client state from another session that removed the images.

Related errors


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