Skip to content

Commit b3c61a7

Browse files
authored
Merge pull request #190862 from sumit-kalra/pkrdelerr
Adding info about false positives around Packer resource deletion err…
2 parents bc587ac + 3a0ebc8 commit b3c61a7

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

articles/virtual-machines/linux/image-builder-troubleshoot.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,11 @@ The customization.log includes the following stages:
248248
249249
6. Clean up stage. Once the build has completed, Azure Image Builder resources are deleted.
250250
```text
251+
PACKER ERR ==> azure-arm: Deleting individual resources ...
252+
...
251253
PACKER ERR 2020/02/04 02:04:23 packer: 2020/02/04 02:04:23 Azure request method="DELETE" request="https://management.azure.com/subscriptions/<subId>/resourceGroups/IT_aibDevOpsImg_t_vvvvvvv_yyyyyy-de5f-4f7c-92f2-xxxxxxxx/providers/Microsoft.Network/networkInterfaces/pkrnijamvpo08eo?[REDACTED]" body=""
254+
...
255+
PACKER ERR ==> azure-arm: The resource group was not created by Packer, not deleting ...
252256
```
253257
## Tips for troubleshooting script/inline customization
254258
- Test the code before supplying it to Image Builder
@@ -574,6 +578,24 @@ The `buildTimeoutInMinutes` value in the template is set to between 1 and 5 minu
574578
#### Solution
575579
As described in [Create an Azure Image Builder template](./image-builder-json.md), the timeout must be set to 0 to use the default or above 5 minutes to override the default. Change the timeout in your template to 0 to use the default or to a minimum of 6 minutes.
576580

581+
### Resource deletion errors
582+
583+
#### Error
584+
Intermediate resources are cleaned up toward the end of the build and the customization log may show several resource deletion errors:
585+
586+
```text
587+
PACKER OUT ==> azure-arm: Error deleting resource. Will retry.
588+
...
589+
PACKER OUT ==> azure-arm: Error: network.PublicIPAddressesClient#Delete: Failure sending request: StatusCode=0 -- Original Error: Code="PublicIPAddressCannotBeDeleted" Message=...
590+
...
591+
PACKER ERR 2022/03/07 18:43:06 packer-plugin-azure plugin: 2022/03/07 18:43:06 Retryable error: network.SecurityGroupsClient#Delete: Failure sending request: StatusCode=0 -- Original Error: Code="InUseNetworkSecurityGroupCannotBeDeleted"...
592+
```
593+
594+
#### Cause
595+
These error log messages are mostly harmless because resource deletions are retried several times and they, in general, eventually succeed. This can be verified by continuing to follow the deletion logs until a success message is observed. Alternatively, the staging resource group can be inspected to confirm if the resource has been deleted or not.
596+
597+
_[This is especially important in case of build failures where these error messages may cause the observer to conclude them to be the reason for failure while the actual error is elsewhere.]_
598+
577599
## DevOps task
578600

579601
### Troubleshooting the task

0 commit comments

Comments
 (0)