Skip to content
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

With upgrade to v3, terrafrom init in github actions fails with wrapper enabled #373

Closed
pribanerjee opened this issue Oct 31, 2023 · 5 comments

Comments

@pribanerjee
Copy link

We just upgraded to hashicorp/setup-terraform@v3 for our GitHub actions and it started failing in terraform init step with below error

/actions-runner/_temp/e6023f8c-517d-4123-8609-5827ed8f73a7/terraform:4342
      this._parser?.end()
                   ^


SyntaxError: Unexpected token '.'
    at wrapSafe (internal/modules/cjs/loader.js:915:16)
    at Module._compile (internal/modules/cjs/loader.js:963:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:10[27](https://github.com/OttoPaymentHub/bigfin_api-gateway/actions/runs/6704783026/job/18217882380#step:9:28):10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
    at internal/main/run_main_module.js:17:47
Error: Process completed with exit code 1.

Terraform Configuration Files:

      - name: Setup Terraform
        uses: hashicorp/setup-terraform@v3
        with:
          terraform_version: '1.6.0'
          terraform_wrapper: true

It only works when we disable the terraform_wrapper, which is not expected as we would like to work with exit codes.

Please look into the issue.

@austinvalle
Copy link
Member

austinvalle commented Oct 31, 2023

Hey there @pribanerjee 👋🏻 ,

Can you confirm what version of NodeJS is running on your action runner? v3 was updated to run with node20 and the error presented looks like the NodeJS version running doesn't support optional chaining (introduced in Node 14).

@pribanerjee
Copy link
Author

Hey there @pribanerjee 👋🏻 ,

Can you confirm what version of NodeJS is running on your action runner? v3 was updated to run with node20 and the error presented looks like the NodeJS version running doesn't support optional chaining (introduced in Node 14).

Hey @austinvalle , we are using Node16 in our runner.So unless we upgrade to node20, we need to use with wrapper disabled?

@pribanerjee
Copy link
Author

Also currently node16 is default version of the actions runners

@austinvalle
Copy link
Member

The v3 release was in preparation for node16 being deprecated next year, so v3.0.0 and above will all be aimed at supporting Node20. It looks like the action runners were also preparing for that deprecation, but then reverted it after.

If you need support for versions prior to node20 you could continue using v2 as most changes between v2 and v3 are version bumps.

Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants