Chapter 10. Troubleshooting
This section contains information to help you diagnose and resolve issues with using Red Hat Ansible Lightspeed with IBM watsonx Code Assistant.
10.1. Troubleshooting Red Hat Ansible Lightspeed configuration errors
10.1.1. Cannot access the Ansible Lightspeed administrator portal
The Ansible Lightspeed administrator portal can be accessed by the Red Hat organization administrator only.
If you are the Red Hat organization administrator, before you access the Ansible Lightspeed administrator portal, ensure that:
- You have a valid Ansible Automation Platform subscription.
10.1.2. Cannot save the API key
When you enter the IBM watsonx Code Assistant API key, authentication fails and shows the following error message:
IBM Cloud API key is invalid
Red Hat Ansible Lightspeed verifies the API key by generating an associated access token. To resolve the error, ensure that you have not accidentally included any extra spaces when obtaining the API key from IBM watsonx Code Assistant. If you still cannot upload the API key, contact IBM Support.
10.1.3. Cannot configure the model ID due to authentication failure
When you enter the model ID in the Red Hat Ansible Lightspeed administrator portal, the authentication fails.
To resolve the error, ensure that:
- You have configured a valid API key before you upload the model ID.
- You have not accidentally included any extra spaces when entering the model ID.
10.1.4. Cannot configure the model ID due to inference failure
While validating the model ID, Red Hat Ansible Lightspeed performs a test inference. If Red Hat Ansible Lightspeed detects an error, the validation fails and an Inference failed
message is displayed.
To resolve the error, ensure that:
- You have a valid API key and model ID.
- You have not accidentally included any extra spaces when obtaining the API key and model ID from IBM watsonx Code Assistant.
10.2. Troubleshooting Ansible Visual Studio Code extension errors
10.2.1. Cannot view the generated code recommendations using the Ansible VS Code extension
The following scenarios are possible:
You receive a
403 error
message.To resolve this error, ensure that:
- Your organization administrator has configured Red Hat Ansible Lightspeed for your organization.
- You are part of an organization that has a trial or paid subscription to both Ansible Automation Platform and IBM watsonx Code Assistant.
You have not configured the required Ansible VS code extension settings.
-
To resolve this error, ensure that you have enabled the Lightspeed:Enabled and
settings. For more information, see Configure the Ansible VS Code extension.
-
To resolve this error, ensure that you have enabled the Lightspeed:Enabled and
You receive a
Failure on completion requests
error when you make inference requests in VS Code.If you are part of an organization that has a trial or paid subscription to both Ansible Automation Platform and IBM watsonx Code Assistant, but your organization administrator has not configured an IBM watsonx Code Assistant model for your organization, you will encounter a
Failure on completion requests
error when you make inference requests in VS Code.Your VS Code Workspace settings override user settings.
If your Workspace settings are configured, they can override our user settings even if you have configured the Ansible VS Code extension correctly. The Workspace settings can disable your VS Code extension settings, and therefore you cannot access the Ansible Lightspeed service.
To resolve this error, ensure that there are no Workspace settings configured in VS Code. For more information, see Workspace settings in the VS Code documentation.
You entered a multitask prompt, but code recommendations were not generated.
To resolve this error, log out of VS Code and log in again using your Red Hat account.
You clicked a different location or switched to a different window; therefore, the populated code recommendations disappeared.
The Red Hat Ansible Lightspeed service could take multiple seconds per task to populate the code recommendations. If you are using a multitask prompt, the Red Hat Ansible Lightspeed service takes a bit longer to populate the results. Do not move your cursor or press any key while the code recommendation is being generated. If you change the cursor location or press any key, the Ansible VS Code extension cancels the request and the Red Hat Ansible Lightspeed service does not process your request. In this scenario, you must get the cursor back to its original position and repopulate the results.
10.2.2. Cannot request code recommendations by using the Ansible VS Code extension
The following error message is displayed:Your trial to the generative AI model has expired. Refer to your IBM Cloud Account to re-enable access to the IBM watsonx Code Assistant.
To resolve this error, refer to your IBM Cloud account and select an upgrade option.
10.3. Troubleshooting Ansible code bot errors
10.3.1. Cannot access Ansible code bot
After you install Ansible code bot and attempt to log in, you receive the following error message:
Your organization does not have a valid Red Hat Ansible Lightspeed subscription
After you install Ansible code bot, you are redirected to a page that shows an active subscription status, as shown in the following image:
Figure 10.1. Ansible code bot login screen with an active subscription
![Ansible code bot login screen with an active subscription](https://access.redhat.com/webassets/avalon/d/Red_Hat_Ansible_Lightspeed_with_IBM_watsonx_Code_Assistant-2.x_latest-Red_Hat_Ansible_Lightspeed_with_IBM_watsonx_Code_Assistant_User_Guide-en-US/images/fda088caedb124480b7fc92dbd751962/code_bot_login_screen.png)
If the login screen displays an inactive subscription status, Ansible code bot does not scan your Git repositories. The error occurs because your organization does not have a valid Ansible Automation Platform subscription. To resolve this error, ensure that you are part of an organization that has a valid Red Hat Ansible Automation Platform subscription.
10.3.2. Cannot scan your Git repository using Ansible code bot
If the Ansible code bot is not configured correctly, it does not scan your Git repositories or does not create pull requests.
To resolve Ansible code bot errors, ensure that:
- You have selected all the Git repositories that you want to scan.
-
You have a
.yml
configuration file namedansible-code-bot.yml
in your repository.github
folder. For example,.github/ansible-code-bot.yml
.
Run a manual scan on your git repositories by adding the ansible-code-bot-scan topic to your repository. For more information, see Manually scan your Git repositories.
If the Ansible code bot still cannot scan your Git repository, the following scenarios are possible:
- The Ansible code bot did not identify any ansible-lint violations in the Git repository.
- The Ansible code bot does not have permission to scan the Git repository.
- Your organization does not have a valid Red Hat Ansible Automation Platform subscription.
10.3.3. Cannot create pull requests
You might encounter an error where the Ansible code bot cannot create pull requests after scanning your Git repositories.
To resolve this error, ensure that:
- You have verified that there are are no duplicate pull requests. For more information, see How Ansible code bot handles duplicate pull requests.
- You have deleted the branches after closing the pull requests created by the Ansible code bot. For more information, see Deleting a branch used for a pull request.