{"record":{"id":"4b6c96ac89883b8e","repo":"Significant-Gravitas/AutoGPT","slug":"failed-to-update-store-listing-version","errorCode":null,"errorMessage":"Failed to update store listing version","messagePattern":"Failed to update store listing version","errorType":"exception","errorClass":"DatabaseError","httpStatus":500,"severity":"error","filePath":"autogpt_platform/backend/backend/api/features/store/db.py","lineNumber":1126,"sourceCode":"        # Update the existing version\n        updated_version = await prisma.models.StoreListingVersion.prisma().update(\n            where={\"id\": store_listing_version_id},\n            data=prisma.types.StoreListingVersionUpdateInput(\n                name=name,\n                videoUrl=video_url,\n                agentOutputDemoUrl=agent_output_demo_url,\n                imageUrls=image_urls,\n                description=description,\n                categories=categories,\n                subHeading=sub_heading,\n                changesSummary=changes_summary,\n                recommendedScheduleCron=recommended_schedule_cron,\n                instructions=instructions,\n            ),\n            include={\"StoreListing\": True},\n        )\n        if not updated_version:\n            raise DatabaseError(\"Failed to update store listing version\")\n\n        logger.debug(\n            f\"Updated existing listing version {store_listing_version_id} \"\n            f\"for graph {current_version.agentGraphId}\"\n        )\n\n        return store_model.StoreSubmission.from_listing_version(updated_version)\n\n    except (\n        store_exceptions.SubmissionNotFoundError,\n        store_exceptions.UnauthorizedError,\n        NotFoundError,\n        store_exceptions.ListingExistsError,\n        store_exceptions.InvalidOperationError,\n    ):\n        raise\n    except prisma.errors.PrismaError as e:\n        logger.error(f\"Database error editing store submission: {e}\")","sourceCodeStart":1108,"sourceCodeEnd":1144,"githubUrl":"https://github.com/Significant-Gravitas/AutoGPT/blob/9c8bb5550f446ba5d3046b78896578742495b3cf/autogpt_platform/backend/backend/api/features/store/db.py#L1108-L1144","documentation":"DatabaseError raised in edit_store_submission when the StoreListingVersion update() call returns None. Inside a transaction this typically reflects the same class of issues as error 410: the transaction aborted or the update could not be confirmed. It fires after ownership and version-existence checks passed, so it is an infrastructure/write-path failure rather than a client-input one.","triggerScenarios":"PUT/edit submission while another edit to the same listing version commits first and invalidates this transaction; DB connection lost mid-transaction; a trigger or constraint on StoreListingVersion aborting the update silently.","commonSituations":"Two editors (or two tabs) editing the same submission; auto-save racing an explicit save; long-running transactions timing out under load.","solutions":["Check logs for the surrounding PrismaError to see why the update did not commit.","Serialize edits in the UI (lock the form while saving; reload the version before editing).","If a DB trigger/constraint is involved, inspect it in the migration history."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"const fresh = await api.getSubmission(store_listing_version_id);\nif (fresh.submission_status !== form.baseline_status) {\n  // someone changed it underneath us — reload the edit form\n  reloadForm(fresh);\n  return;\n}\nawait api.editSubmission(store_listing_version_id, form);","typeGuard":null,"tryCatchPattern":"from backend.util.exceptions import DatabaseError\n\ntry:\n    await store_db.edit_store_submission(...)\nexcept DatabaseError as e:\n    if 'Failed to update store listing version' in str(e):\n        fresh = await refetch_version(store_listing_version_id)\n        if fresh: return await store_db.edit_store_submission(...)  # one rebased retry\n        raise","preventionTips":["Allow only one in-flight save per submission form.","Reload the version before editing if the dialog was open a long time.","Log the chained cause to distinguish transaction aborts from row disappearance."],"tags":["database","transaction","submission","store"],"backgroundTag":null,"analyzedSha":"9c8bb5550f446ba5d3046b78896578742495b3cf","analyzedAt":"2026-08-14T17:17:21.957Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}