jason-johnson / azure-pipelines-tasks-terraform

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

TerraformCLI tasks seem to finish but they stall after actually finishing #287

Closed YoshicoppensE61 closed 1 year ago

YoshicoppensE61 commented 1 year ago

Describe the bug So unfortunately the occurence of the error is quite random, but it sometimes happens. So sometimes a terraform init or terraform plan or terraform apply step seems to finish, and we can see it is finished as it for example will say 'Terraform has been successfully initialized!', but the Azure task is not continuing to the next step. It just seems to stall. Sometimes it recovers within the 60 minute timeout that is set on my pipelines (I have seen this occur randomly after 10 minutes, 20 minutes etc.), but sometimes it does not and the task just times out after 60 minutes.

I found some issues online who were mentioning a similar issue also on agents, but that was focused on powershell, which I think is not used here (https://github.com/microsoft/navcontainerhelper/issues/2469).

To Reproduce Unfortunately it is very random, I was hoping if someone has experienced the same or has an idea what to do about it.

Expected behavior The task should just continue after it is actually finished.

Screenshots

image

Pipeline Logs No logs unfortunately, it stalls without message.

Agent Configuration

Additional context Add any other context about the problem here.

jason-johnson commented 1 year ago

I can't reproduce this for terraform CLI but I see this happen on Azure Devops Pipelines in general. Are you certain this is a problem with this extension specifically?

jason-johnson commented 1 year ago

@YoshicoppensE61 Are you able to confirm that this only occurs with this CLI task? I believe this has to do with the agents or possibly terraform itself but is unlikely to be related to this extension.

YoshicoppensE61 commented 1 year ago

@YoshicoppensE61 Are you able to confirm that this only occurs with this CLI task? I believe this has to do with the agents or possibly terraform itself but is unlikely to be related to this extension.

Hey Jason, yeah I do think it has something to do with the agents, but was hoping you had an idea on the cause of it. I do no seem to have it though when I just use terraform code myself using bash scripting.

In the meantime, I have switched to both using manual terraform code and to using a different kind of agent, so these issues are not relevant anymore for me. Thank you for replying!

jason-johnson commented 1 year ago

Did you try using terraform cli with this new type of agent to see if it is still affected?

YoshicoppensE61 commented 1 year ago

I first switched to terraform scripting in bash and later on switched the agent itself (due to other reasons), so unfortunately have not tested it.

jason-johnson commented 1 year ago

Ok, if you get time I would appreciate any evidence proving or disproving this is actually coming from the task.

YoshicoppensE61 commented 1 year ago

Ok, if you get time I would appreciate any evidence proving or disproving this is actually coming from the task.

I got many clients and tasks, so probably will not be able to come around it, you can close it.

jason-johnson commented 1 year ago

Unable to verify this is a problem with the task. Closing. Can be reopened if new evidence surfaces to point to this task.