Troubleshooting Stack Dependencies Missing Output Issues

Last updated: January 16, 2025

When working with stack dependencies in Spacelift, you may encounter issues with missing inputs or outputs. This article will guide you through troubleshooting these problems and ensuring your stack dependencies work correctly.

Missing Inputs Error

If you encounter an error message similar to:

job assignment failed: the following inputs are missing: Storage.TF_VAR_AWS_S3_BUCKET_ARN => TF_VAR_AWS_S3_BUCKET_ARN

This could be due to several reasons:

  • The source stack's run that created these outputs was unsuccessful

  • The output variable is not correctly defined or referenced

  • The state / outputs were imported without an apply phase

  • The outputs were created before we enabled the output uploading to our backend on 21 August 2023

Troubleshooting Steps

  1. Verify successful runs: Ensure that the source stack (the one producing the output) has had a successful run recently.

  2. Check output definitions: Verify that the output variable is correctly defined in the source stack and properly referenced in the dependent stack.

  3. Imported state files: If you imported a state file with pre-existing outputs, make sure to run an apply phase. Spacelift uploads outputs during the Apply phase.

Workaround

To upload the outputs to be available for use, you will need a successful apply stage which can be achieved by modifying the name of an existing output or adding a by adding a dummy output to the stack and removing it afterwards:

output "dummy" {
  value = "dummy"
}

Best Practices

  • Always ensure that stacks with shared outputs have had successful runs with apply phases.

  • When importing state files, remember an apply phase is needed to properly upload outputs, even if they are visible in the UI.

  • Double-check that output and input variable names match exactly between dependent stacks.

If you continue to experience issues after following these steps, please contact Spacelift support for further assistance.