{"record":{"id":"6d8cb5ec3e56d5fe","repo":"Significant-Gravitas/AutoGPT","slug":"graph-current-graph-id-is-not-accessible-anymo","errorCode":null,"errorMessage":"Graph #{current.graph_id} is not accessible (anymore)","messagePattern":"Graph #(.+?) is not accessible \\(anymore\\)","errorType":"exception","errorClass":"NotFoundError","httpStatus":404,"severity":"error","filePath":"autogpt_platform/backend/backend/api/features/library/triggers.py","lineNumber":136,"sourceCode":"    graph has a webhook trigger node, the webhook is re-registered with the new\n    config and the previously-attached webhook is pruned if it becomes dangling.\n    Name/description/active-status changes don't touch the webhook.\n\n    Raises:\n        NotFoundError: if the preset (or, when reconfiguring, its graph) is gone.\n        InvalidInputError: if the webhook backend rejects the new trigger config.\n    \"\"\"\n    current = await db.get_preset(user_id, preset_id)\n    if not current:\n        raise NotFoundError(f\"Preset #{preset_id} not found\")\n\n    trigger_inputs_updated, new_webhook = False, None\n    if inputs is not None and credentials is not None:\n        graph = await get_graph(\n            current.graph_id, current.graph_version, user_id=user_id\n        )\n        if not graph:\n            raise NotFoundError(\n                f\"Graph #{current.graph_id} is not accessible (anymore)\"\n            )\n        if trigger_node := graph.webhook_input_node:\n            trigger_config_with_credentials = {\n                **inputs,\n                **(\n                    make_node_credentials_input_map(graph, credentials).get(\n                        trigger_node.id\n                    )\n                    or {}\n                ),\n            }\n            new_webhook, feedback = await setup_webhook_for_block(\n                user_id=user_id,\n                trigger_block=trigger_node.block,\n                trigger_config=trigger_config_with_credentials,\n                for_preset_id=preset_id,\n                # Resource-follows-parent: webhook lives in the graph's org/team.","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/Significant-Gravitas/AutoGPT/blob/9c8bb5550f446ba5d3046b78896578742495b3cf/autogpt_platform/backend/backend/api/features/library/triggers.py#L118-L154","documentation":"NotFoundError raised by update_preset_with_webhook_reconfiguration when both inputs and credentials are supplied (triggering webhook re-registration) but the preset's parent graph can no longer be fetched via get_graph. The preset row exists, but its graph was deleted or became inaccessible, so reconfiguring the trigger is impossible. Note this path only triggers when inputs AND credentials are both non-None.","triggerScenarios":"PATCH with inputs+credentials on a preset whose graph was deleted; graph moved to another org/visibility; pinned graph_version pruned. Name/description/isActive-only updates never hit this error.","commonSituations":"Orphaned presets surviving graph deletion; graph ownership transferred; version cleanup job removed the referenced version.","solutions":["Check the parent graph: GET /graphs/{graph_id}?version={graph_version} — if gone, the preset is effectively orphaned.","Delete and recreate the preset against an existing graph version instead of reconfiguring the orphan.","If only reconfiguring metadata, omit inputs/credentials to bypass the graph lookup entirely.","Fix upstream data hygiene: ensure graph deletion also removes or flags its presets."],"exampleFix":"# before\nawait update_preset_with_webhook_reconfiguration(user_id=uid, preset_id=pid, inputs=inp, credentials=creds, name=new_name)\n# after\nif inp is None or creds is None:  # metadata-only update, no graph needed\n    await update_preset_with_webhook_reconfiguration(user_id=uid, preset_id=pid, name=new_name)\nelse:\n    graph = await get_graph(preset.graph_id, preset.graph_version, user_id=uid)\n    if not graph:\n        raise OrphanedPreset(pid)\n    await update_preset_with_webhook_reconfiguration(user_id=uid, preset_id=pid, inputs=inp, credentials=creds, name=new_name)","handlingStrategy":"validation","validationCode":"if inputs is not None and credentials is not None:\n    graph = await get_graph(preset.graph_id, preset.graph_version, user_id=uid)\n    if not graph:\n        raise OrphanedPreset(preset_id)","typeGuard":null,"tryCatchPattern":"try:\n    await update_preset_with_webhook_reconfiguration(...)\nexcept NotFoundError as e:\n    if 'not accessible' in str(e):\n        raise OrphanedPreset('recreate the preset against an existing graph') from e\n    raise","preventionTips":["For metadata-only updates, omit inputs and credentials to skip the graph dependency.","Ensure graph deletion cleans up or flags dependent presets."],"tags":["not-found-error","presets","graphs","webhooks"],"backgroundTag":null,"analyzedSha":"9c8bb5550f446ba5d3046b78896578742495b3cf","analyzedAt":"2026-08-14T17:17:21.957Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}