jason-johnson / azure-pipelines-tasks-terraform

Azure Pipelines extension for Terraform
MIT License
124 stars 53 forks source link

Installer task fails behind company proxy #320

Closed KristofKuli closed 1 year ago

KristofKuli commented 1 year ago

Terraform Installer task throws timeout during pipeline execution. All the agents are behind company proxy. Could that be the issue? Regarding the source code, maybe fetch is not able to recognize the proxy settings? https://github.com/jason-johnson/azure-pipelines-tasks-terraform/blob/c1c99a58f820682edf3b4a095b613059722f46d9/tasks/terraform-installer/src/installer.ts#L17

piizei commented 1 year ago

Hi @KristofKuli Node-proxy should rely on env variables HTTP_PROXY or HTTPS_PROXY. Have you tried these?

KristofKuli commented 1 year ago

Hi Petteri,

HTTP_PROXY and HTTPS_PROXY are both set on the agents, furthermore I have also defined them directly in the Terraform task, but it still fails.

piizei commented 1 year ago

Would you know if the download works directly from example from https://releases.hashicorp.com/terraform/1.3.7/terraform_1.3.7_linux_arm.zip with wget/curl? Sometimes proxies also block binary download.

KristofKuli commented 1 year ago

Curl returned HTTP 200, so that works.

KristofKuli commented 1 year ago

Update: we checked on Azure Pipelines pool, which hosted by MS and the download work there. Furthermore, the customer also has his own VM scale set in Azure, where the proxy is not set and pipeline is successful.

KristofKuli commented 1 year ago

Is there any update on this? We are still believe the issue is that the fetch is not able to recognize the proxy settings. A similar task (Node Installer) works perfectly fine, so we don't think the issue is with the proxy.

jason-johnson commented 1 year ago

@KristofKuli There is a PR in flight right now that should resolve this issue

KristofKuli commented 1 year ago

Thank you for the fix! Could you please let me know when this will be available on the Marketplace to update?

KristofKuli commented 1 year ago

Any update on this? I have tested the task, but it is still failing with timeout.

jason-johnson commented 1 year ago

@KristofKuli The task has now been released, if you update to the newest version is it still failing?

jason-johnson commented 1 year ago

Reopening until fix is verified

jason-johnson commented 1 year ago

Possibly related to #19

KristofKuli commented 1 year ago

Specifying the exact version solved the issue. Thank you.