aws-samples / aws-samples/amplify-ai-examples

When calling the generateStory operation, the request fails with an AccessDeniedException.

Open
#31 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
55
Forks
65
PR merge metrics
No merged PRs in 30d

Description

Error response
```
{
"data": {
"generateStory": null
},
"errors": [
{
"path": ["generateStory"],
"data": null,
"errorType": "AccessDeniedException",
"errorInfo": null,
"locations": [
{
"line": 2,
"column": 3,
"sourceName": null
}
],
"message": "The model is disabled or this generation route is missing a necessary identity-based policy."
}
]
}
```

Steps to reproduce

Call generateStory via Amplify AI schema.

Observe the error response.

Expected behavior
The generateStory query should return generated content without failing due to access issues.

Actual behavior
The API responds with AccessDeniedException and the model does not generate a response.

Possible causes

The model is disabled in the Amplify project configuration.

The generation route lacks the correct IAM/identity-based policy.

Permissions not correctly attached to the user or execution role.

Environment

Framework: Next.js / React (if relevant)

Amplify version:

AI model: Claude 3 Haiku (or whichever is configured)

Additional context
This issue started appearing after setting up generateStory in the schema. Other operations may still be working.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.