HCP Terraform ServiceNow Service Catalog Integration troubleshooting tips.
This page offers troubleshooting tips for common issues with the ServiceNow Service Catalog Integration for HCP Terraform. It also provides instructions on how to find and read logs to diagnose and resolve issues.
Find logs
Logs are crucial for diagnosing issues. You can find logs in ServiceNow in the following places:
Workflow logs
To find workflow logs, click on the RITM number on a failed ticket to open the request item. Scroll down to Related Links > Workflow Context and open the Workflow Log tab.
Flow logs
To find flow logs, click on the RITM number on a failed ticket to open the request item. Scroll down to Related Links > Flow Context > Open Context Record and open the Flow engine log entries tab.
Application logs
To find application logs, navigate to All > System Log > Application Logs. Set the Application filter to "Terraform". Search for logs around the time your issue occurred. Some records include HTTP status codes and detailed error messages.
Outbound requests
ServiceNow logs all outgoing API calls, including calls to HCP Terraform. To view the log of outbound requests, navigate to All > System Logs > Outbound HTTP Requests.
To customize the table view, add columns like "URL," "URL Path," and "Application scope."
Logs from the Catalog app are marked with the x_325709_terraform
scope.
Enable email notifications
To enable email notifications and receive updates on your requested item tickets:
- Log in to your ServiceNow instance as an administrator.
- Click System Properties > Email Properties.
- In the Outbound Email Configuration panel, select Yes next to the check-box with the email that ServiceNow should send notifications to.
To ensure you have relevant notifications configured in your instance:
- Navigate to System Notification > Email > Notifications.
- Search for "Request Opened" and "Request Item Commented" and ensure they are activated.
Reaching out to ServiceNow customer support if you run into any issues with the global configurations.out to ServiceNow customer support if you run into any issues with the global configurations.
Common problems
This section details frequently encountered issues and how they can be resolved.
Failure to create a workspace
If you order the "create a workspace" catalog item and nothing happens in ServiceNow and HCP Terraform does not create a workspace then there are several possible reasons why:
Ensure your HCP Terraform token, hostname, and organization name is correct.
- Make sure to use a Team API Token. This can be found in HCP Terraform under "API Tokens".
- Ensure the team API token has the correct permissions.
- Double-check your organization name by copying and pasting it from HCP Terraform or Terraform Enterprise.
- Double-check your host name.
- Make sure you created your team API token in the same organization you are using
- Test your configuration. First click Update to process any changes then **Test Config to make sure the connection is working.
Verify your VCS configuration.
- The Identifier field should not have any spaces. The ServiceNow Service Catelog Integration requires that you format repository names in the
username/repo_name
format. - The Name can be anything, but it is better to avoid special characters as per naming convention.
- Double-check the OAuth token ID in your HCP Terraform/Terraform Enterprise settings. To retrieve your OAuth token ID, navigate to your HCP Terraform organization's settings page, then click Provider in the left navigation bar under Version Control.
Failure to successfully order any catalog item
After placing an order for any catalog item, navigate to the comments section in the newly created RITM ticket. The latest comment will contain a response from HCP Terraform.
Frequency of comments and outputs
When you place an order in the Terraform Catalog, ServiceNow submits and processes the order, then attaches additional comments to the order to indicate whether HCP Terraform successfully created the workspace.
By default, ServiceNow polls HCP Terraform every 5 minutes for the latest status of the Terraform run. ServiceNow does not show any comments until the next ping.
To configure ServiceNow to poll HCP Terraform more frequently:
- Navigate to All > Flow designer.
- Set the Application filter to Terraform.
- Under the Name column click Worker Poll Run State.
- Click on the trigger and adjust the interva to your desired schedule.
- Click Done > Save > Activate to save your changes.
Using no-code modules feature
If ServiceNow fails to deploy a no-code module catalog item, verify the following:
- Ensure that your HCP Terraform organization has an HCP Plus tier subscription.
- Ensure the name you enter for your no-code module in the catalog user form matches the no-code module in HCP Terraform.
Updating no-code workspaces
If the “update no-code workspace” catalog item returns the output message “No update has been made to the workspace”, then you have not upgraded your no-code module in HCP Terraform.
Application Scope
If you are making customizations and you encounter unexpected issues, make sure to change the scope from Global to Terraform and recreate your customized items in the Terraform scope. For additional instructions on customizations, refer to the example customizations documentation.
MID server
If you are using a MID server in your configuration, check the connectivity by using the Test Config button on the configurations page. Additionally, when ServiceNow provisions a MID server, navigate to MID Servers > Servers to check if the status is “up” and “validated”.
Configuration
While the app allows multiple config entries, only one should be present as this can interfere with the functionality of the app.