jason-johnson / azure-pipelines-tasks-terraform

Azure Pipelines extension for Terraform
MIT License
134 stars 58 forks source link

"The current operating system is not capable of running this task" since version 1.2.3.1, was ok on 1.2.2.0 #458

Closed wgkesler closed 3 days ago

wgkesler commented 4 days ago

Since version 1.2.3.1 TerraformInstaller@1 and TerraformCLI@1 tasks are returning the following error:

[error]The current operating system is not capable of running this task. That typically means the task was written for Windows only. For example, written for Windows Desktop PowerShell.

image

We have self-hosted agents based on Ubuntu 22.04 on Azure and on AWS, but the problem exists on the AWS only. We tried to build new image based on Ubuntu 24.04, as well as we tried to use TerraformInstaller@2 task - the error is the same.

Interesting part is that everything was working properly before, and it was working properly on the version 1.2.2.0 after auto-update for one day, and it is failing since auto-update to version 1.2.3.1.

wgkesler commented 4 days ago

Problem solved, in our case the reason was that those agents working on AWS were using the older Azure DevOps Agent version (3.227.1). After upgrading to the newest version (3.248.0) the error was gone. image

wgkesler commented 4 days ago

After further invastigation, probably the following version requirement should be updated:

https://github.com/jason-johnson/azure-pipelines-tasks-terraform/blob/66693231ffafcf2638107cea1e998d41f27cf3fd/tasks/terraform-installer/task.json#L19

https://github.com/jason-johnson/azure-pipelines-tasks-terraform/blob/66693231ffafcf2638107cea1e998d41f27cf3fd/tasks/terraform-cli/task.json#L19

lsanchez-v commented 4 days ago

Since version 1.2.3.1 TerraformInstaller@1 and TerraformCLI@1 tasks are returning the following error:

[error]The current operating system is not capable of running this task. That typically means the task was written for Windows only. For example, written for Windows Desktop PowerShell.

image

We have self-hosted agents based on Ubuntu 22.04 on Azure and on AWS, but the problem exists on the AWS only. We tried to build new image based on Ubuntu 24.04, as well as we tried to use TerraformInstaller@2 task - the error is the same.

Interesting part is that everything was working properly before, and it was working properly on the version 1.2.2.0 after auto-update for one day, and it is failing since auto-update to version 1.2.3.1.

Same problem here, it was working with version 1.1.2, and now with version 1.2.3 is failing with the same error:

##[error]The current operating system is not capable of running this task. That typically means the task was written for Windows only. For example, written for Windows Desktop PowerShell.

wgkesler commented 4 days ago

@lsanchez-v try to update the agent version, it worked for me.

npassmore commented 4 days ago

Also seeing this issue since deployment of 1.2.3.1. Using DevOps agent "4.248.0" the issue is resolved, but on older versions i.e. 2.211.0 we see the error. We are looking to upgrade all our agents, but we have an outstanding bug with MS where we are seeing issues in our CI/CD process, but we may be forced to upgrade if a fix isn't found ..

2024-11-25T13:08:57.6716037Z ============================================================================== 2024-11-25T13:08:57.6716848Z Task : Terraform Installer 2024-11-25T13:08:57.6717457Z Description : Installs a specific version of terraform 2024-11-25T13:08:57.6717893Z Version : 1.2.3 2024-11-25T13:08:57.6718345Z Author : Charles Zipp 2024-11-25T13:08:57.6718961Z Help : 2024-11-25T13:08:57.6719296Z ============================================================================== 2024-11-25T13:08:57.6893284Z ##[error]The current operating system is not capable of running this task. That typically means the task was written for Windows only. For example, written for Windows Desktop PowerShell. 2024-11-25T13:08:57.6908120Z ##[section]Finishing: Install Terraform

jason-johnson commented 4 days ago

After further invastigation, probably the following version requirement should be updated:

https://github.com/jason-johnson/azure-pipelines-tasks-terraform/blob/66693231ffafcf2638107cea1e998d41f27cf3fd/tasks/terraform-installer/task.json#L19

https://github.com/jason-johnson/azure-pipelines-tasks-terraform/blob/66693231ffafcf2638107cea1e998d41f27cf3fd/tasks/terraform-cli/task.json#L19

Fantastic find, thanks for that! Do you know what version should be the new minimum?

lsanchez-v commented 4 days ago

@lsanchez-v try to update the agent version, it worked for me.

Fixed by upgrading the agent's version indeed, thank you @wgkesler

jason-johnson commented 3 days ago

After further invastigation, probably the following version requirement should be updated:

https://github.com/jason-johnson/azure-pipelines-tasks-terraform/blob/66693231ffafcf2638107cea1e998d41f27cf3fd/tasks/terraform-installer/task.json#L19

https://github.com/jason-johnson/azure-pipelines-tasks-terraform/blob/66693231ffafcf2638107cea1e998d41f27cf3fd/tasks/terraform-cli/task.json#L19

I've bumped both tasks to require agent versions 3.248.0. If anyone can demonstrate that they can run on an earlier version I will change it.

npassmore commented 3 days ago

@jason-johnson we had been using agents as old as 2.211.1, we are looking to upgrade these but have been having some issues which Microsoft have been working on... but not found a resolution for as yet ..