{"record":{"id":"1b4d0a8b152e2af6","repo":"Significant-Gravitas/AutoGPT","slug":"failed-to-fetch-store-creators","errorCode":null,"errorMessage":"Failed to fetch store creators","messagePattern":"Failed to fetch store creators","errorType":"exception","errorClass":"DatabaseError","httpStatus":500,"severity":"error","filePath":"autogpt_platform/backend/backend/api/features/store/db.py","lineNumber":583,"sourceCode":"\n        # Convert to response model\n        creator_models = [\n            store_model.CreatorDetails.from_db(creator) for creator in creators\n        ]\n\n        logger.debug(f\"Found {len(creator_models)} creators\")\n        return store_model.CreatorsResponse(\n            creators=creator_models,\n            pagination=store_model.Pagination(\n                current_page=page,\n                total_items=total,\n                total_pages=total_pages,\n                page_size=page_size,\n            ),\n        )\n    except Exception as e:\n        logger.error(f\"Error getting store creators: {e}\")\n        raise DatabaseError(\"Failed to fetch store creators\") from e\n\n\nasync def get_store_creator(\n    username: str,\n) -> store_model.CreatorDetails:\n    logger.debug(f\"Getting store creator details for {username}\")\n\n    try:\n        # Query creator details from database\n        creator = await prisma.models.Creator.prisma().find_unique(\n            where={\"username\": username}\n        )\n\n        if not creator:\n            logger.warning(f\"Creator not found: {username}\")\n            raise store_exceptions.CreatorNotFoundError(f\"Creator {username} not found\")\n\n        logger.debug(f\"Found creator details for {username}\")","sourceCodeStart":565,"sourceCodeEnd":601,"githubUrl":"https://github.com/Significant-Gravitas/AutoGPT/blob/9c8bb5550f446ba5d3046b78896578742495b3cf/autogpt_platform/backend/backend/api/features/store/db.py#L565-L601","documentation":"Catch-all DatabaseError from get_store_creators: any exception raised while building the where clause, counting Creator rows, or fetching them (except the validation DatabaseErrors which are re-raised from inside the same try) is logged and re-wrapped with this generic message. The original exception is chained via 'from e', so the server log line 'Error getting store creators: ...' holds the real cause.","triggerScenarios":"Postgres unreachable/timed out; Prisma client not generated (prisma generate missing); schema drift between the Prisma client and the actual database (unknown column CreatorWhereInput field); connection pool exhaustion under load.","commonSituations":"Fresh clone where 'poetry run prisma migrate dev' and 'prisma generate' were skipped; docker compose DB not started; a migration applied in one environment but not the other; DATABASE_URL pointing at the wrong database.","solutions":["Read the chained exception in logs: grep 'Error getting store creators' to see the underlying PrimaError.","If it is a client-generation issue run 'poetry run prisma generate'; for schema drift run 'poetry run prisma migrate dev'.","Verify the database is reachable: docker compose up -d and check DATABASE_URL.","Retry once on transient connection errors at the client layer; if persistent, inspect Postgres logs."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"from backend.util.exceptions import DatabaseError\n\nasync def safe_get_creators(**kw):\n    try:\n        return await store_db.get_store_creators(**kw)\n    except DatabaseError:\n        # one retry for transient connection issues, then surface to user\n        await asyncio.sleep(0.5)\n        return await store_db.get_store_creators(**kw)","preventionTips":["Run 'poetry run prisma generate' after every schema pull/clone.","Health-check Postgres in the service's startup probe so outages are visible before requests fail.","Keep the Prisma client version in lockstep with the schema migrations."],"tags":["database","prisma","store","connection"],"backgroundTag":null,"analyzedSha":"9c8bb5550f446ba5d3046b78896578742495b3cf","analyzedAt":"2026-08-14T17:17:21.957Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}