{"record":{"id":"2a9d502eb5a4daf5","repo":"Significant-Gravitas/AutoGPT","slug":"preset-inputs-and-credentials-must-be-provided-tog","errorCode":null,"errorMessage":"Preset inputs and credentials must be provided together","messagePattern":"Preset inputs and credentials must be provided together","errorType":"validation","errorClass":"ValueError","httpStatus":400,"severity":"error","filePath":"autogpt_platform/backend/backend/api/features/library/db.py","lineNumber":2155,"sourceCode":"        NotFoundError: If attempting to update a non-existent preset.\n    \"\"\"\n    current = await get_preset(user_id, preset_id)  # assert ownership\n    if not current:\n        raise NotFoundError(f\"Preset #{preset_id} not found for user #{user_id}\")\n    logger.debug(\n        f\"Updating preset #{preset_id} ({repr(current.name)}) for user #{user_id}\",\n    )\n    async with transaction() as tx:\n        update_data: prisma.types.AgentPresetUpdateInput = {}\n        if name:\n            update_data[\"name\"] = name\n        if description:\n            update_data[\"description\"] = description\n        if is_active is not None:\n            update_data[\"isActive\"] = is_active\n        if inputs or credentials:\n            if not (inputs and credentials):\n                raise ValueError(\n                    \"Preset inputs and credentials must be provided together\"\n                )\n            update_data[\"InputPresets\"] = {\n                \"create\": [\n                    prisma.types.AgentNodeExecutionInputOutputCreateWithoutRelationsInput(  # noqa\n                        name=name, data=SafeJson(data)\n                    )\n                    for name, data in {\n                        **inputs,\n                        **{\n                            key: creds_meta.model_dump(exclude_none=True)\n                            for key, creds_meta in credentials.items()\n                        },\n                    }.items()\n                ],\n            }\n            # Existing InputPresets must be deleted, in a separate query\n            await prisma.models.AgentNodeExecutionInputOutput.prisma(tx).delete_many(","sourceCodeStart":2137,"sourceCodeEnd":2173,"githubUrl":"https://github.com/Significant-Gravitas/AutoGPT/blob/9c8bb5550f446ba5d3046b78896578742495b3cf/autogpt_platform/backend/backend/api/features/library/db.py#L2137-L2173","documentation":"Error \"Preset inputs and credentials must be provided together\" thrown in Significant-Gravitas/AutoGPT.","triggerScenarios":"Thrown at autogpt_platform/backend/backend/api/features/library/db.py:2155 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide both inputs and credentials, or neither, in the preset request.","Fix the client to send a complete preset payload."],"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-15T17:31:12.345Z"}