IBM Cloud Docs
How can you find the root cause of why Schematics apply is failing?

How can you find the root cause of why Schematics apply is failing?

You want to apply a Terraform template in IBM Cloud that runs scripts on a target resource. To run the script, you use the Terraform null_resource in your configuration file. However, when you run the Schematics apply action, the action fails and you receive an error message that can include internal, timeout, connection, or input errors.

When Schematics tries to run your script on the target resource, a script error occurs during the execution. Because Schematics cannot resolve errors that occur in user-provided scripts, the apply action is marked as failed.

To troubleshoot the error in the script, follow these steps:

  1. From the workspace Activity page, select the Schematics apply action that failed.
  2. Click Jobs to see the detailed log output.
  3. In the log file, find the last action that Schematics started before the error occurs. For example, in the following log output, Schematics tried to run a copy script in the instances_module module by using the Terraform null_resource.
    2021/05/24 05:03:41 Terraform apply | module.instances_module.module.compute_remote_copy_rpms.null_resource.remote_copy[0]: Still creating... [5m0s elapsed]
    2021/05/24 05:03:41 Terraform apply | 
    2021/05/24 05:03:42 Terraform apply | 
    2021/05/24 05:03:42 Terraform apply | 
    2021/05/24 05:03:42 Terraform apply | Error: timeout - last error: ssh: rejected: connect failed (Connection timed out)
    
  4. Find the script that is ran in the Terraform null_resource and analyze where the error might come from by using the error message from the Schematics log output.
  5. If you cannot resolve the error, contact the script owner to further troubleshoot the error.