Skip to content

Fix | Parsing Error in locals.tf File** #301

Closed

Description

@exequielrafaela

Bug Report: Parsing Error in locals.tf File

Describe the Bug

Users have encountered a parsing error in the locals.tf file when using Leverage CLI version 1.14.0. The error message lacks specificity, making it challenging to identify and resolve the issue.

Expected Behavior

The Leverage CLI should provide clear and detailed error messages, including the exact line and column numbers where the parsing error occurs, to facilitate efficient debugging.

Steps to Reproduce

  1. Use Leverage CLI version 1.14.0.
  2. Execute a command that parses the locals.tf file.
  3. Encounter a generic parsing error without specific details about the location of the issue.

Screenshots

N/A

Environment:

  • OS: Linux, OSX, WSL
  • Leverage CLI Version: 1.14.0
  • Terraform Version: [Specify version]

Additional Context

Users have reported that wrapping the problematic expression in parentheses resolves the issue temporarily. However, a permanent fix is needed to improve error reporting and handling in the Leverage CLI.

This issue has been discussed in the Binbash Slack channel, where users shared their experiences and temporary solutions.

Implementing more informative error messages will enhance the user experience by making it easier to identify and fix syntax errors in Terraform files.

Activity

  1. added
    bug
    on Mar 18, 2025
  2. changed the title [-]Bug | Parsing Error in `locals.tf` File**[/-] [+]Fix | Parsing Error in `locals.tf` File**[/+] on Mar 18, 2025
  3. rodriguez-matias commented on Mar 18, 2025

    @rodriguez-matias

    steps to reproduce error

    $ cd apps-devstg/us-east-1/k8s-eks-demoapps/network
    $ leverage -v tf init

    [12:38:47.332] ERROR    There is a parsing error with the                                                                                                      
                            /Users/.../le-tf-infra-aws-REF-ARCH/apps-devstg/us-east-1/k8s-eks-demoapps/network/locals.tf file.  
                            Please review it.  
    

    local environment

    macOS 15.1.1

    ╰─❯ python3 --version
    Python 3.13.2

    ╰─❯ leverage --version
    leverage, version 1.14.0

    build.env
    TERRAFORM_IMAGE_TAG=1.6.6-0.2.3

  4. rodriguez-matias commented on Mar 18, 2025

    @rodriguez-matias

    Workaround

    running same command with leverage version 1.13.0 works ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugpatch

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions