Significant-Gravitas/AutoGPT · error · DatabaseError

Failed to update store listing version {store_listing_versio

Error message

Failed to update store listing version {store_listing_version_id}

What it means

DatabaseError raised inside review_store_submission() when prisma StoreListingVersion.update(...) returns None after the review decision. Prisma update returns None only when the where-unique record vanished between the initial fetch and the update (or the write failed to match), i.e. a lost-update race during admin review.

Source

Thrown at autogpt_platform/backend/backend/api/features/store/db.py:1565

            "submissionStatus": submission_status,
            "reviewedAt": datetime.now(tz=timezone.utc),
            "Reviewer": {"connect": {"id": reviewer_id}},
            "reviewComments": external_comments,
            "internalComments": internal_comments,
        }

        # Update the version
        reviewed_submission = await prisma.models.StoreListingVersion.prisma().update(
            where={"id": store_listing_version_id},
            data=update_data,
            include={
                "StoreListing": True,  # required for StoreSubmissionAdminView
                "Reviewer": True,  # used in _send_submission_review_notification
            },
        )

        if not reviewed_submission:
            raise DatabaseError(
                f"Failed to update store listing version {store_listing_version_id}"
            )

        try:
            await _send_submission_review_notification(
                creator_user_id,
                is_approved,
                external_comments,
                reviewed_submission,
            )
        except Exception as e:
            logger.error(f"Failed to send email notification for agent review: {e}")
            # Don't fail the review process if email sending fails

        return store_model.StoreSubmissionAdminView.from_listing_version(
            reviewed_submission
        )

View on GitHub (pinned to 9c8bb5550f)

Solutions

  1. Refresh the submission queue and re-check status before retrying the review — the record was likely already reviewed or deleted.
  2. Guard against duplicate submissions in the admin UI (disable the button while the request is in flight).
  3. If it persists for a known-live record, verify the ID format and that no cascade delete removed StoreListingVersion rows.
Defensive patterns

Strategy: try-catch

Validate before calling

tr = await prisma.models.StoreListingVersion.prisma().find_unique(
    where={"id": store_listing_version_id}
)
still_reviewable = tr is not None and tr.submissionStatus == "PENDING"

Try / catch

try:
    view = await store_db.review_store_submission(...)
except DatabaseError as e:
    if "Failed to update store listing version" in str(e):
        recheck = await fetch_submission(store_listing_version_id)
        if recheck is None or recheck.status != "PENDING":
            return already_handled_response()  # lost race, not a fault
        raise

Prevention

When it happens

Trigger: Admin A and admin B open the same submission; B approves (or the creator deletes the submission) before A's update commits, so A's update matches zero rows and returns None.

Common situations: Double-clicking the approve/reject button, multiple admin tabs, long review sessions where the submission is removed, or retry logic re-running after the record was deleted.

Related errors


AI-assisted analysis of Significant-Gravitas/AutoGPT@9c8bb5550f (2026-08-14). Data as JSON: /api/errors/f328670c704308a5. Report an issue: GitHub.