Terraform
Troubleshoot ServiceNow Service Catalog Integrations
This topic describes how to troubleshoot issues with the ServiceNow Service Catalog Integration for HCP Terraform and provides instructions on how to find and read logs to diagnose and resolve issues.
Find logs
The following logs are available.
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, you can add URL
, URL Path
, Application scope
and other columsn.
ServiceNow marks logs from the catalog app 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
andRequest Item Commented
and ensure they are activated.
Contact ServiceNow customer support for issues realted to global configurations.
Common problems
This section describes issues you may encounter and how to solve them.
Failure to create a workspace
If you order the create a workspace
catalog item, nothing happens in ServiceNow, and HCP Terraform does not create a workspace, then there are several possible reasons why:
Your HCP Terraform token, hostname, and organization name may not be 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.