Skip to content

Bug: Amazon Q PR review fails with "technical issues retrieving file content from repository" #44

@ankitk-y

Description

@ankitk-y

Describe the bug

Amazon Q PR reviews behave inconsistently within the same repository. When /q review or /q summarize is triggered (either manually or through an automated GitHub workflow), the bot starts processing the pull request but sometimes fails to retrieve the repository file contents.

In these cases, Amazon Q returns errors such as "I encountered technical issues retrieving the file content from the repository" or "The repository tree and file contents could not be retrieved from the head branch." The bot is still able to read PR metadata (such as file names and number of changes) but cannot access the actual file contents for analysis.

However, in other pull requests within the same repository, Amazon Q is able to retrieve the files and complete the review successfully. This results in inconsistent behavior where some PRs are reviewed normally while others fail during the file retrieval step.

Expected Behavior

  • Amazon Q should consistently retrieve repository files from the PR and perform a normal review when /q review or /q summarize is triggered.
  • The review should complete regardless of the file being modified (e.g., Jenkinsfile or README), provided the repository permissions are correct.
  • Automated triggers from the GitHub workflow should behave the same as manually running /q review on the PR.

Current Behavior

  • Amazon Q is triggered successfully when /q review or /q summarize is executed (either manually or via the GitHub workflow).
  • In some PRs, Amazon Q fails to retrieve repository file contents and returns errors such as:
    • "I encountered technical issues retrieving the file content from the repository"
    • "The repository tree and file contents could not be retrieved from the head branch"
  • Amazon Q is still able to read PR metadata (such as file names and change counts) but cannot access the actual file contents for analysis.
  • This behavior is inconsistent and occurs within the same repository,
Image

some PRs are reviewed successfully while others fail with the file retrieval error.

Image

Note: Both screenshots are from the same repository

Reproduction Steps

  • Open a pull request that modifies files in the repository (e.g., tools/jenkins/Jenkinsfile).
  • Trigger Amazon Q by running /q review or /q summarize (either manually or via the GitHub workflow that runs automatically on PR creation).
  • Amazon Q begins processing the PR.
  • In some cases, the review fails and Amazon Q returns errors such as:
  • "I encountered technical issues retrieving the file content from the repository"
  • "The repository tree and file contents could not be retrieved from the head branch".

Possible Solution

No response

Additional Information/Context

  • Amazon Q Developer GitHub App is installed at the organization level with access to all repositories.
  • Repository permissions for the app are configured as: Contents (Read), Pull Requests (Read & Write), Metadata (Read).
  • We are using the GitHub App without connecting it to an AWS account (free version).
  • /q review is triggered automatically through a GitHub workflow whenever a pull request is opened.
  • The issue occurs inconsistently within the same repository, some PRs are reviewed successfully while others fail during the file retrieval step.
  • In failing cases, Amazon Q appears to read PR metadata but cannot retrieve the actual file contents from the repository.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions