Skip to content

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

Description

@siviadreamtale

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions