{"record":{"id":"e6313a73e4b30906","repo":"Significant-Gravitas/AutoGPT","slug":"agentpreset-preset-id-vanished-while-updating","errorCode":null,"errorMessage":"AgentPreset #{preset_id} vanished while updating","messagePattern":"AgentPreset #(.+?) vanished while updating","errorType":"exception","errorClass":"RuntimeError","httpStatus":500,"severity":"error","filePath":"autogpt_platform/backend/backend/api/features/library/db.py","lineNumber":2213,"sourceCode":"        raise NotFoundError(f\"Preset #{preset_id} not found\")\n\n    # Refuse to attach a webhook the caller doesn't own\n    if webhook_id:\n        webhook = await integrations_db.get_webhook(webhook_id)\n        if webhook.user_id != user_id:\n            raise NotFoundError(f\"Webhook #{webhook_id} not found\")\n\n    updated = await prisma.models.AgentPreset.prisma().update(\n        where={\"id\": preset_id},\n        data=(\n            {\"Webhook\": {\"connect\": {\"id\": webhook_id}}}\n            if webhook_id\n            else {\"Webhook\": {\"disconnect\": True}}\n        ),\n        include=AGENT_PRESET_INCLUDE,\n    )\n    if not updated:\n        raise RuntimeError(f\"AgentPreset #{preset_id} vanished while updating\")\n    return library_model.LibraryAgentPreset.from_db(updated)\n\n\nasync def migrate_webhook_presets_to_new_version(\n    user_id: str,\n    new_graph: graph_db.GraphModel,\n) -> library_model.WebhookPresetMigrationResult:\n    \"\"\"\n    Migrates webhook-attached presets for a graph to a newly activated version.\n\n    When a new agent version is activated (i.e. becomes the live version),\n    presets with webhooks that were pinned to an older version are updated\n    to point to the new active version, so that existing webhook URLs\n    continue to trigger the latest agent version.\n\n    A preset is only migrated when the new version's trigger is the *same block*\n    as the trigger of the version the preset is currently pinned to. The block\n    id determines the provider, webhook type and resource/event formats the","sourceCodeStart":2195,"sourceCodeEnd":2231,"githubUrl":"https://github.com/Significant-Gravitas/AutoGPT/blob/9c8bb5550f446ba5d3046b78896578742495b3cf/autogpt_platform/backend/backend/api/features/library/db.py#L2195-L2231","documentation":"Error \"AgentPreset #{preset_id} vanished while updating\" thrown in Significant-Gravitas/AutoGPT.","triggerScenarios":"Thrown at autogpt_platform/backend/backend/api/features/library/db.py:2213 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the update; the preset was deleted concurrently.","Recreate the preset if it no longer exists."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9c8bb5550f446ba5d3046b78896578742495b3cf","analyzedAt":"2026-08-14T17:17:21.957Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}