Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
exequielrafaela opened this issue Mar 18, 2025 · 2 comments · Fixed by #303
Closed

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

exequielrafaela opened this issue Mar 18, 2025 · 2 comments · Fixed by #303
Assignees
Labels
bug Something isn't working patch

Comments

@exequielrafaela
Copy link
Member

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

@exequielrafaela exequielrafaela added bug Something isn't working patch labels Mar 18, 2025
@exequielrafaela exequielrafaela changed the title Bug | Parsing Error in locals.tf File** Fix | Parsing Error in locals.tf File** Mar 18, 2025
@rodriguez-matias
Copy link

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

@rodriguez-matias
Copy link

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
Labels
bug Something isn't working patch
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants