IBM Support

Variables section in HCP Terraform workspace returns "Not Found"

Troubleshooting


Problem

 

Introduction

Sometimes users can see "Not Found" error when navigating to the Variables section of their HCP Terraform workspace:


Screenshot 2024-04-01 at 10.50.31.png

 

Cause

This issue could be seen in a HCP Terarform workspace provisioned by No-Code module

The issue occurs due to one or a combination of the following factors:

  • Deletion of the No-Code module's latest version from the HCP Terraform UI

  • Deletion of the VCS repo based on which is created the No-Code module

Note that there is a dependency between the VCS repo, the No-Code module, and the HCP Terraform workspace, provisioned from that No-Code module. Any breaking change in the VCS repo or the No-Code module will have a direct effect on the HCP Terraform workspace.

Solution 1: 

This solution will be applicable if you do NOT have anything important in the state file and you don't mind starting again.
If this is the case - delete the HCP Terraform workspace and provision a new one with the same No-Code module.

Solution 2:

This solution will be applicable if you want to use the existing state file in a brand new workspace.

Below are the steps that can help you accomplish this task:

  • Go to the affected workspace >> "States" >> select latest State file >> click on "Download" button
  • Delete the workspace
  • Delete the No-code module
  • Restore the tag in the VCS repo (applicable if the VCS was deleted, too)
  • Publish the No-Code module again
  • Provision a workspace using the no-code module and make sure you click on manual apply (in this way you can discard the first run and push the old state file)

    creation.png
  • Create an empty directory on your local computer
  • Configure authentication in HCP Terraform as described here.
  • Add "main.tf" file with the following content:

     

    terraform {
    cloud {
    organization = "georgiman-tfc4b"

    workspaces {
    name = "random-pet-nocode-1"
    }
    }
    }
  • Place the downloaded state earlier into the same directory together with "main.tf"
  • Make sure the state name is "terraform.tfstate"
     

    georgiman@georgiman-C02Z82YVLVDQ cli $ ls -l
    -rw-r--r-- 1 georgiman staff 123 Apr 1 14:05 main.tf
    -rw-r--r--@ 1 georgiman staff 667 Apr 1 14:10 terraform.tfstate
    georgiman@georgiman-C02Z82YVLVDQ cli $
  • Execute "terraform init"
     

    georgiman@georgiman-C02Z82YVLVDQ cli-test (main) $ terraform init

    Initializing Terraform Cloud...

    Do you wish to proceed?

    As part of migrating to Terraform Cloud, Terraform can optionally copy your

    current workspace state to the configured Terraform Cloud workspace. Answer "yes" to copy the latest state snapshot to the configured

    Terraform Cloud workspace.

    Answer "no" to ignore the existing state and just activate the configured

    Terraform Cloud workspace with its existing state, if any.

    Should Terraform migrate your existing state?

    Enter a value:
  • Type "yes", and the state file should be pushed to the new workspace.
  • Go to the "States" menu in your workspace and make sure the State is there.
  • Go to "Runs" and trigger a new run from the UI.
  • The plan should return "No changes"

    finish.png

 

Additional Information

If you have any questions, please reach out to HCP Terraform support by submitting a ticket via our support portal.

Document Location

Worldwide

[{"Type":"MASTER","Line of Business":{"code":"LOB77","label":"Automation Platform"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSGH5YK","label":"IBM Terraform Self-Managed"},"ARM Category":[{"code":"","label":""}],"ARM Case Number":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Version(s)"}]

Historical Number

27979028216339

Document Information

Modified date:
30 March 2026

UID

ibm17265243