Significant-Gravitas/AutoGPT · error · DatabaseError

Failed to fetch creator details

Error message

Failed to fetch creator details

What it means

Catch-all DatabaseError from get_store_creator(username): wraps any failure while fetching the Creator row or converting it via CreatorDetails.from_db. CreatorNotFoundError is explicitly re-raised untouched, so this message means 'something other than not-found went wrong' — a real infrastructure or mapping failure. The original cause is in the logged 'Error getting store creator details' line.

Solutions

  1. Check the chained cause in logs ('Error getting store creator details: ...').
  2. If a from_db field mismatch: run the pending migration or make the model field optional, then 'poetry run prisma generate'.
  3. If transient connectivity: retry the request once; verify DB health if it repeats.
Defensive patterns

Strategy: try-catch

Try / catch

from backend.util.exceptions import DatabaseError
from backend.api.features.store import store_exceptions

try:
    creator = await store_db.get_store_creator(username)
except store_exceptions.CreatorNotFoundError:
    return RedirectResponse('/store/creators')  # expected miss
except DatabaseError:
    return Response('Creator lookup unavailable', status_code=503)  # infra failure

Prevention

When it happens

Trigger: DB down or connection dropped during find_unique; CreatorDetails.from_db hitting a field mismatch after a schema change (e.g. new non-optional column that is null in old rows); Prisma client out of date with the schema.

Common situations: Deploying backend code without regenerating the Prisma client; a migration adding a required column with NULL backfill; transient network blips to managed Postgres.

Related errors


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

Appendix: source

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

    logger.debug(f"Getting store creator details for {username}")

    try:
        # Query creator details from database
        creator = await prisma.models.Creator.prisma().find_unique(
            where={"username": username}
        )

        if not creator:
            logger.warning(f"Creator not found: {username}")
            raise store_exceptions.CreatorNotFoundError(f"Creator {username} not found")

        logger.debug(f"Found creator details for {username}")
        return store_model.CreatorDetails.from_db(creator)
    except store_exceptions.CreatorNotFoundError:
        raise
    except Exception as e:
        logger.error(f"Error getting store creator details: {e}")
        raise DatabaseError("Failed to fetch creator details") from e


async def _get_submission_stats(user_id: str) -> store_model.SubmissionStats:
    """Compute creator-wide submission aggregates in a single round-trip.

    Uses Postgres FILTER clauses so all five aggregates land in one query —
    cheaper than five separate counts/sums and immune to the pagination
    undercount that client-side aggregation suffers from.
    """
    # average_rating is weighted by review_count so a submission with 1,000
    # reviews counts proportionally more than one with a single review;
    # straight AVG would over-represent low-volume submissions.
    sql = """
        SELECT
            COUNT(*)::int                                          AS total,
            COUNT(*) FILTER (WHERE status = 'APPROVED')::int       AS approved,
            COUNT(*) FILTER (WHERE status = 'PENDING')::int        AS pending,
            COALESCE(SUM(run_count), 0)::bigint                    AS total_runs,

View on GitHub (pinned to 9c8bb5550f)