Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing because builder failed to delete resources #18

Closed
zemuldo opened this issue Mar 20, 2022 · 3 comments
Closed

Failing because builder failed to delete resources #18

zemuldo opened this issue Mar 20, 2022 · 3 comments
Labels
question Further information is requested

Comments

@zemuldo
Copy link

zemuldo commented Mar 20, 2022

Having build fail with

Submitting the template
Submitted template: 
 Succeeded
Starting run template...
Error: During the image build a failure has occurred. Please review the build log to identify which build/customization step failed. For more troubleshooting steps go to https://aka.ms/azvmimagebuilderts. Image build log location: https://xjsg7ig6s0p71zg9ntss9c8j.blob.core.windows.net/packerlogs/4249f343-cc1e-4b00-a1[96](https://github.com/org/repo/runs/5616388078?check_suite_focus=true#step:11:96)-015b25120d21/customization.log. OperationId: a2cbf965-1cb1-43de-9663-0f2767d27acd. Use this operationId to search packer logs.
$(imagebuilder-run-status) =  failed
Error: Error: Post template call failed for template imagebuilderTemplate_1647766604241 with error: ***"statusCode":200,"message":"During the image build a failure has occurred. Please review the build log to identify which build/customization step failed. For more troubleshooting steps go to https://aka.ms/azvmimagebuilderts. Image build log location: https://xjsg7ig6s0p71zg9ntss9c8j.blob.core.windows.net/packerlogs/4249f343-cc1e-4b00-a196-015b25120d21/customization.log. OperationId: a2cbf965-1cb1-43de-9663-0f2767d27acd. Use this operationId to search packer logs.","code":"PackerBuildFailed"***
Error: Action run failed.

Looking at the build logs

Error: network.VirtualNetworksClient#Delete: Failure sending request: StatusCode=0 -- Original Error: Code="InUseSubnetCannotBeDeleted" Message="Subnet pkrsnpo7ai8nvl9 is in use by /subscriptions/subscription-id/resourceGroups/IT_my-rg_imagebuilderTemplate_1647765614_6cd361c7-8c30-4597-be22-12b2634897d6/providers/Microsoft.Network/networkInterfaces/pkrnipo7ai8nvl9/ipConfigurations/ipconfig and cannot be deleted. In order to delete the subnet, delete all the resources within the subnet. See aka.ms/deletesubnet." Details=[]

ERR ==> azure-arm: The resource group was not created by Packer, not deleting ...
ERR ==> Builds finished but no artifacts were created.

The build leaves the resource group and the storage account in it every time. Seems like its unable to delete these resources for a reason I can figure out. I can post the whole logs here.

@zemuldo zemuldo added the need-to-triage Requires investigation label Mar 20, 2022
@BALAGA-GAYATRI BALAGA-GAYATRI added question Further information is requested and removed need-to-triage Requires investigation labels Mar 21, 2022
@BALAGA-GAYATRI
Copy link
Contributor

Hey @zemuldo
I would say the action's readme and end-to-end tutorial doc covers the scenarios and action usage pretty well. Please go through them to understand why it's failing. Also regarding the extra resource group and storage account thing you may look at this issue #13. Feel free to share your workflow and logs if you still face the problem after trying this.

@zemuldo
Copy link
Author

zemuldo commented Mar 21, 2022

The image actually gets created and are usable on VMs. Its the builder failing to delete the resources. Thanks anyways for the response. I will read through

@zemuldo
Copy link
Author

zemuldo commented Mar 24, 2022

Closing this. Ended up executing packer myself with setup packer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants