Problem:
When integrating ServiceNow with Terraform Enterprise (TFE) using the Terraform ServiceNow Catalog Integration v2.4.0, users may encounter an issue where a workspace is created successfully, but TFE fails to retrieve code from Bitbucket or any other VCS.
Prerequisites (if applicable)
- Terraform ServiceNow Service Catalog Integration v2.4.0
Cause:
-
This problem typically arises when there is a mismatch between the Terraform binary version specified in ServiceNow and the version used by the TFE server to execute runs. The discrepancy leads to an error as Unexpected Token: T or Can not read property from id undefined.
Solutions:
-
Identify the Error: Navigate to All > Logs > System Logs in ServiceNow. Use the log filtering options to locate the specific error message associated with the failed catalog item. Apply additional filters, such as date and time, to narrow down the search.
Information HTTP Request Body:
{
"errors": [
{
"status": "422",
"title": "invalid attribute",
"detail": "Terraform version \"v1.7.4\" does not resolve to a version of
Terraform present in this Terraform Enterprise installation, or this organization
is not permitted to use it.",
"source": {
"pointer": "/data/attributes/terraform-version"
}
}
]
}
- Update Terraform Version: In ServiceNow, go to Terraform > VCS Repositories and ensure that the Terraform provider version matches the one specified in TFE. Avoid leaving the version field blank to prevent version conflicts.
Additional Information: