Runs failing with "flag provided but not defined: -var-file"

Incident Report for scalr.io

Postmortem

RCA
A fix was released to ensure .tfvars files are properly loaded during the init phase with for-each feature, that was introduced in the OpenTofu 1.9.0 version.

Technical details:

  • To fix the issue we added processing of the .tfvars on init, validate,and fmt phases for runs with the flag -var-file.
  • But consuming the .tfvars file using the -var and -var-file options was introduced in OpenTofu 1.8.0, and exception handling was missed for any versions less than 1.8.0.
  • Because of this, all runs with .tfvars files in the VCS-driven workspaces with OpenTofu < 1.8.0 and all Terraform versions supported by Scalr were affected.
Posted May 07, 2025 - 13:24 UTC

Resolved

We're currently working on a fix for runs that are failing with:

│ Error: Failed to parse command-line flags

│ flag provided but not defined: -var-file
Posted May 05, 2025 - 15:30 UTC