Skip to main content

Contrast AI SmartFix troubleshooting

Issue

Symptom

Actions

Invalid credentials

Contrast displays a 401 or 403 message

  • Verify that the values for contrast_host, contrast_org_id,contrast_app_id, contrast_authorization_key, and contrast_api_key are correct and stored properly in GitHub Secrets or variables.

  • Ensure the service user associated with contrast_authorization_key has the necessary permissions.

  • Confirm the contrast_app_id matches the application ID in the repository.

LLM errors

Errors related to LLM API calls such as, API key invalid, Model not found, or rate limiting

  • Verify you are using the correct agent_model string for the chosen provider and model (see the LiteLLM documentation).

  • Check that the API key for the LLM provider is valid and correctly stored in GitHub Secrets. Check that you have sufficient quota or credits with the LLM provider.

  • Check the network connectivity from GitHub Action runners to the LLM API endpoint.

Pull request (PR) creation failures

The GitHub Action runs but no PR is created or errors occur during PR creation

  • Verify the github_token is specified correctly.

  • Check that no branch protection rules prevent PR creation by actions or for the smartfix/* branches.

  • Verify the base_branch command exists and is specified correctly.

No Fixes or PRs generated

The GihHub Action completes successfully but no PRs or fixes are created.

  • Confirm CRITICAL or HIGH severity vulnerabilities exist in a REPORTED state in Contrast for the contrast_app_id..

  • Check the logs to see if the initial build (run before attempting a fix) is failing.

  • Check whether the the number of existing open SmartFix PRs meets the max_open_prs limit. When the number of PRs exceeds this limit, no additional PRs are created.

  • Review action logs for specific errors during vulnerability processing.

Incorrect fixes

The SmartFix fix isn't correct.

Carefully review the PR that SmartFix creates. If a fix is incorrect or incomplete, reject it.