Error: spawn terraform ENOENT during Azure Pipeline Terraform

ti7

When attempting to run terraform init as a task in an Azure Pipeline, it errors stating

spawn C:\hostedtoolcache\windows\terraform\0.12.7\x64\terraform.exe ENOENT

The installation appears fine, as basic functionality is verified during the install step (terraform version)

Relevant Pipeline Tasks

...
  - task: TerraformInstaller@0
    displayName: 'Install Terraform 0.12.7'
    inputs:
      terraformVersion: 0.12.7
  - task: TerraformTaskV1@0
    displayName: 'Terraform : init'
    inputs:
        command: 'init'
        workingDirectory: '$(System.DefaultWorkingDirectory)/Terraform/terraform'
...

Install Terraform 0.12.7

...
Verifying Terraform installation...
C:\hostedtoolcache\windows\terraform\0.12.7\x64\terraform.exe version
Terraform v0.12.7

Your version of Terraform is out of date! The latest version
is 0.12.19. You can update by downloading from www.terraform.io/downloads.html
Finishing: Install Terraform 0.12.7

Terraform : init

...
C:\hostedtoolcache\windows\terraform\0.12.7\x64\terraform.exe validate
##[error]Error: There was an error when attempting to execute the process 'C:\hostedtoolcache\windows\terraform\0.12.7\x64\terraform.exe'. This may indicate the process failed to start. Error: spawn C:\hostedtoolcache\windows\terraform\0.12.7\x64\terraform.exe ENOENT
Finishing: Terraform : validate

Many other users reported success fixing this by adding a checkout step, but the pipeline automatically does this (presumably previous versions did not), and manually adding it had no effect (actually took 2s longer due to different options).

ti7

Turns out the working directory path was incorrect, as the directory structure had been changed.

Changing all the named working directories from Terraform/terraform to just terraform corrected the issue.

Presumably both in this and cases where checkout was not performed, Terraform simply cannot locate main.tf, but the error is missing or lost.

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

Add azure SQL user with terraform

分類Dev

Terraform Azure VM SSH Key

分類Dev

Terraform Azure VMSSHキー

分類Dev

Hashicorp Terraform RemoteStateとAzure

分類Dev

docker container does not start - spawn Java enoent error

分類Dev

Grunt-brunch server Fatal error: spawn ENOENT

分類Dev

Polymer grunt: Fatal error: spawn dev_appserver.py ENOENT

分類Dev

odd errors on terraform / azure "Missing required argument"

分類Dev

Exporting AWS Data Pipeline as CloudFormation template to use it in Terraform

分類Dev

MalformedPolicyDocument error when creating policy via terraform

分類Dev

terraform error: unsupported argument in module in tf plan

分類Dev

No available provider "azure" plugins are compatible with this Terraform version. Azurerm -1.28 Terraform -

分類Dev

Terraformプランの実行中にTerraform403 Forbidden Error

分類Dev

Terraform-Azure WindowsVM接続の問題

分類Dev

Terraform Azure how to get AKS service principle object id

分類Dev

What is the reserved argument in azure app service plan terraform config

分類Dev

How to configure an Azure app service to pull images from an ACR with terraform?

分類Dev

Output for Principal ID for multiple Azure App Services through Terraform

分類Dev

'child_process'.exec vs .spawn ENOENT

分類Dev

Environmental variables are null during Azure Pipeline Build test

分類Dev

terraform reporting error "cannot use element function with an empty list"

分類Dev

terraformからAzureDevops Pipelineに、azureバックエンドストアの状態ファイルを使用して出力を渡します

分類Dev

loop over the variable in terraform

分類Dev

Terraform - Conditional Data Source

分類Dev

Getting IAM username in terraform

分類Dev

Terraform ebs volume

分類Dev

Terraform: count in resource name

分類Dev

Relative paths in Terraform

分類Dev

Terraform does not destroy a module

Related 関連記事

  1. 1

    Add azure SQL user with terraform

  2. 2

    Terraform Azure VM SSH Key

  3. 3

    Terraform Azure VMSSHキー

  4. 4

    Hashicorp Terraform RemoteStateとAzure

  5. 5

    docker container does not start - spawn Java enoent error

  6. 6

    Grunt-brunch server Fatal error: spawn ENOENT

  7. 7

    Polymer grunt: Fatal error: spawn dev_appserver.py ENOENT

  8. 8

    odd errors on terraform / azure "Missing required argument"

  9. 9

    Exporting AWS Data Pipeline as CloudFormation template to use it in Terraform

  10. 10

    MalformedPolicyDocument error when creating policy via terraform

  11. 11

    terraform error: unsupported argument in module in tf plan

  12. 12

    No available provider "azure" plugins are compatible with this Terraform version. Azurerm -1.28 Terraform -

  13. 13

    Terraformプランの実行中にTerraform403 Forbidden Error

  14. 14

    Terraform-Azure WindowsVM接続の問題

  15. 15

    Terraform Azure how to get AKS service principle object id

  16. 16

    What is the reserved argument in azure app service plan terraform config

  17. 17

    How to configure an Azure app service to pull images from an ACR with terraform?

  18. 18

    Output for Principal ID for multiple Azure App Services through Terraform

  19. 19

    'child_process'.exec vs .spawn ENOENT

  20. 20

    Environmental variables are null during Azure Pipeline Build test

  21. 21

    terraform reporting error "cannot use element function with an empty list"

  22. 22

    terraformからAzureDevops Pipelineに、azureバックエンドストアの状態ファイルを使用して出力を渡します

  23. 23

    loop over the variable in terraform

  24. 24

    Terraform - Conditional Data Source

  25. 25

    Getting IAM username in terraform

  26. 26

    Terraform ebs volume

  27. 27

    Terraform: count in resource name

  28. 28

    Relative paths in Terraform

  29. 29

    Terraform does not destroy a module

ホットタグ

アーカイブ