---
name: schematics-apply_nullresource
title: Why is Schematics apply failing?
description: 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.
last-updated: 2025-01-17
---

> ## Documentation Index
> The table of contents for this documentation set is at https://cloud.ibm.com/docs/schematics?format=markdown
> The index for all IBM Cloud docs is at: https://cloud.ibm.com/docs/llms.txt
> Use these files to discover more information as needed.

# Why is Schematics apply failing?
{: #nullresource-errors}

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.
{: tsSymptoms}

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`.
{: tsCauses}

To troubleshoot the error in the script, follow these steps:
{: tsResolve}

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`.

    ```text
      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)
      
    ```
    {: screen}

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.