Error while destroying octopus configration from terrafrom

Hey Octopus team,

We are managing our Octopus configuration using Terraform. Now while trying to destroy the configurations we are getting an API error as follows.

Error: octopus deploy api returned an error on endpoint /api/Spaces-342/projects/Projects-385/deploymentprocesses - [The Steps field is required.]

This was working well until last week. Shall we know why this started to happen suddenly? Is there any recent change on the API side?

Good afternoon @arun.raj,

Thank you for contacting Octopus Support and sorry you are running into an issue with your Terraform scripts.

Are you able to get us the terraform commands you are using to destroy the configurations please so we can try and replicate this issue. Can you also elaborate on roughly when this stopped working.

I can see we did update our TF plugin 15 days ago so I don’t think that would cause this but your Octopus cloud instance was upgraded last Monday and last Thursday so it could be that but I cannot see any changes that would affect the API call for a project deployment process or our TF provider so I would need to try and reproduce this to see if I get the same error.

If you could send your TF script over to our secure site I can take a look and edit the script to try use it on my instance (please redact any sensitive information such as API key from the script). I have created you a secure link here you can use to upload the file.

Let me know once it has been uploaded and I can take a look for you,
Kind Regards,
Clare

Hi @clare.martin,

Thanks for looking into this issue.

We are using terraform cloud and running all TF-related deployments using the TF Workspace. Now, trying to destroy and re-create all the Octopus resources using the destroy option available in the TF workspace. We did this several times before and today it started to have this error. I think we haven’t tried this destroy option after Wednesday. So the mentioned change can be a reason(I am seeing new changes in Octopus UI today compared to the last time). It is worth we check it.

FYI, from the logs, I can see the issue is happening while trying to delete the resource octopusdeploy_deployment_process. The same error is there for all projects where we are trying to delete the deployment process.

Regarding sharing the code, it is a huge repo with multiple files and a lot of modules. I doubt sharing a part would be useful for you. Still, I am sharing the module with you and uploading it to the link that you have shared.

If you need more information, please do let me know.

Thanks,
Arun S Raj

Hey @arun.raj,

Thank you so much for uploading those, I am due to leave for the day so will pass this onto the US team but in case they are not able to reproduce this today I have also sent it to our engineers to see if any API calls would have changed that would have affected this.

If we are unable to reproduce this tonight for you I am hoping we have some information to give you tomorrow morning and I can try reproduce this for you tomorrow.

We will be in touch when we have an update for you,
Kind Regards,
Clare

Hey @arun.raj,

A quick update for you on this one, one of the Australian Support team managed to take a look at this last night and he can reproduce this on 2023.3.1205-hotfix.1753 but his local docker instance running 2023.2.10947 deletes the deployment process just fine.

We are not yet sure if this is a bug with the Terraform plugin or the Octopus version but we are pretty confident it is the Octopus version.

Our engineers have not had a chance to take a look at this yet but now we have been able to reproduce it hopefully we can get a fix out relatively soon for you.

I will keep you updated as soon as our engineers have taken a look and given us some more information.

Reach out if you need anything in the mean time as we would be happy to help,
Kind Regards,
Clare

Hey @arun.raj,

The engineers managed to get a look at this last night and they think they know where the issue lies, they mentioned they tested this on 2023.3.931 before the PR they think introduced this and found that it was working.

They then tested this against 2023.3.977 after the PR and it produces the error you are seeing.

When deleting a deployment process from the UI, the network call provides an empty array for the Steps field. The Terraform provider doesn’t provide the Steps field as it omits this if the array is empty, this is why its asking you for the steps field.

The engineers have put this into the dispatch queue so they will take a look at this when they can.

I will keep you updated but I just wanted to let you know we are investigating a fix for this issue.

Kind Regards,
Clare

Good morning @arun.raj,

Just to let you know we have created a GitHub issue for this so if you subscribe to that you will see when the fix is out and you can upgrade to the release number once you have been notified by email.

If there is anything else you need in the meantime please reach out,

Kind Regards,
Clare

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.