Azure / Azure/custom-script-extension-linux
custom-script upgrade deletes /var/lib/waagent/custom-script
- Dominant language
- Go
- Stars
- 113
- Forks
- 46
- Avg merge
- 6d 3h
- Merged PRs (30d)
- 3
Description
It seems that after 2.1.7 was released, if there is a lesser version in the VM beforehand (in our case 2.1.6), the agent would uninstall the lesser version at startup and delete /var/lib/waagent/custom-script, which includes the new script that needs to be run.
Details:
Our setup is that we create a VM that runs a script using the custom script extension. The VM is converted into an Azure Compute Gallery image version, which is used for VMSS deployment in multiple regions. The VMSS deployment has a different script that we run using the custom script extension. The image version already has custom script extension installed (2.1.6) and the VMSS deployment is deployed in a region with a higher version (2.1.7). When the VMSS is deployed, the VMSS script is not run because the 2.1.6 version is uninstalled and deletes /var/lib/waagent/custom-script which includes the VMSS script, before 2.1.7 can run the script.
/var/log/azure/custom-script/handler.log:
```
/var/lib/waagent/Microsoft.Azure.Extensions.CustomScript-2.1.6/bin/custom-script-extension install
time=2022-07-25T03:41:22Z version=v2.1.6/git@fc181d8-dirty operation=install seq=0 event=start
time=2022-07-25T03:41:22Z version=v2.1.6/git@fc181d8-dirty operation=install seq=0 status="not reported for operation (by design)"
time=2022-07-25T03:41:22Z version=v2.1.6/git@fc181d8-dirty operation=install seq=0 event="migrate to mrseq" error="Can't find out seqnum from /var/lib/waagent/Microsoft.Azure.Extensions.Cust
omScript-2.1.6/status, not enough files"
time=2022-07-25T03:41:22Z version=v2.1.6/git@fc181d8-dirty operation=install seq=0 event="created data dir" path=/var/lib/waagent/custom-script
time=2022-07-25T03:41:22Z version=v2.1.6/git@fc181d8-dirty operation=install seq=0 event=installed
time=2022-07-25T03:41:22Z version=v2.1.6/git@fc181d8-dirty operation=install seq=0 status="not reported for operation (by design)"
time=2022-07-25T03:41:22Z version=v2.1.6/git@fc181d8-dirty operation=install seq=0 event=end
Writing a placeholder status file indicating progress before forking: /var/lib/waagent/Microsoft.Azure.Extensions.CustomScript-2.1.6/status/0.status
+ nohup /var/lib/waagent/Microsoft.Azure.Extensions.CustomScript-2.1.6/bin/custom-script-extension enable
time=2022-07-25T03:41:24Z version=v2.1.6/git@fc181d8-dirty operation=enable seq=0 event=start
time=2022-07-25T03:41:24Z version=v2.1.6/git@fc181d8-dirty operation=enable seq=0 event=pre-check
time=2022-07-25T03:41:24Z version=v2.1.6/git@fc181d8-dirty operation=enable seq=0 event="comparing seqnum" path=mrseq
time=2022-07-25T03:41:24Z version=v2.1.6/git@fc181d8-dirty operation=enable seq=0 event="seqnum saved" path=mrseq
time=2022-07-25T03:41:24Z version=v2.1.6/git@fc181d8-dirty operation=enable seq=0 event="reading configuration"
time=2022-07-25T03:41:24Z version=v2.1.6/git@fc181d8-dirty operation=enable seq=0 event="read configuration"
time=2022-07-25T03:41:24Z version=v2.1.6/git@fc181d8-dirty operation=enable seq=0 event="validating json schema"
time=2022-07-25T03:41:24Z version=v2.1.6/git@fc181d8-dirty operation=enable seq=0 event="json schema valid"
time=2022-07-25T03:41:24Z version=v2.1.6/git@fc181d8-dirty operation=enable seq=0 event="parsing configuration json"
time=2022-07-25T03:41:24Z version=v2.1.6/git@fc181d8-dirty operation=enable seq=0 event="parsed configuration json"
time=2022-07-25T03:41:24Z version=v2.1.6/git@fc181d8-dirty operation=enable seq=0 event="validating configuration logically"
time=2022-07-25T03:41:24Z version=v2.1.6/git@fc181d8-dirty operation=enable seq=0 event="validated configuration"
time=2022-07-25T03:41:24Z version=v2.1.6/git@fc181d8-dirty operation=enable seq=0 event="creating output directory" path=/var/lib/waagent/custom-script/download/0
time=2022-07-25T03:41:24Z version=v2.1.6/git@fc181d8-dirty operation=enable seq=0 event="created output directory"
time=2022-07-25T03:41:24Z version=v2.1.6/git@fc181d8-dirty operation=enable seq=0 files=0
time=2022-07-25T03:41:24Z version=v2.1.6/git@fc181d8-dirty operation=enable seq=0 event="executing command" output=/var/lib/waagent/custom-script/download/0
time=2022-07-25T03:41:24Z version=v2.1.6/git@fc181d8-dirty operation=enable seq=0 event="executing protected script" output=/var/lib/waagent/custom-script/download/0
time=2022-07-25T03:45:24Z version=v2.1.6/git@fc181d8-dirty operation=enable seq=0 event="executed command" output=/var/lib/waagent/custom-script/download/0
time=2022-07-25T03:45:24Z version=v2.1.6/git@fc181d8-dirty operation=enable seq=0 event=enabled
time=2022-07-25T03:45:24Z version=v2.1.6/git@fc181d8-dirty operation=enable seq=0 event=end
+ /var/lib/waagent/Microsoft.Azure.Extensions.CustomScript-2.1.6/bin/custom-script-extension disable
time=2022-07-25T11:31:39Z version=v2.1.6/git@fc181d8-dirty operation=disable seq=12 event=start
time=2022-07-25T11:31:39Z version=v2.1.6/git@fc181d8-dirty operation=disable seq=12 event=noop
time=2022-07-25T11:31:39Z version=v2.1.6/git@fc181d8-dirty operation=disable seq=12 event=end
+ /var/lib/waagent/Microsoft.Azure.Extensions.CustomScript-2.1.7/bin/custom-script-extension update
time=2022-07-25T11:31:41Z version=v2.1.6/git@ad1546c-dirty operation=update seq=12 event=start
time=2022-07-25T11:31:41Z version=v2.1.6/git@ad1546c-dirty operation=update seq=12 event=noop
time=2022-07-25T11:31:41Z version=v2.1.6/git@ad1546c-dirty operation=update seq=12 event=end
+ /var/lib/waagent/Microsoft.Azure.Extensions.CustomScript-2.1.6/bin/custom-script-extension uninstall
time=2022-07-25T11:31:43Z version=v2.1.6/git@fc181d8-dirty operation=uninstall seq=12 event=start
time=2022-07-25T11:31:43Z version=v2.1.6/git@fc181d8-dirty operation=uninstall seq=12 status="not reported for operation (by design)"
time=2022-07-25T11:31:43Z version=v2.1.6/git@fc181d8-dirty operation=uninstall seq=12 path=/var/lib/waagent/custom-script event="removing data dir" path=/var/lib/waagent/custom-script
time=2022-07-25T11:31:43Z version=v2.1.6/git@fc181d8-dirty operation=uninstall seq=12 path=/var/lib/waagent/custom-script event="removed data dir"
time=2022-07-25T11:31:43Z version=v2.1.6/git@fc181d8-dirty operation=uninstall seq=12 path=/var/lib/waagent/custom-script event=uninstalled
time=2022-07-25T11:31:43Z version=v2.1.6/git@fc181d8-dirty operation=uninstall seq=12 status="not reported for operation (by design)"
time=2022-07-25T11:31:43Z version=v2.1.6/git@fc181d8-dirty operation=uninstall seq=12 event=end
+ /var/lib/waagent/Microsoft.Azure.Extensions.CustomScript-2.1.7/bin/custom-script-extension install
time=2022-07-25T11:31:45Z version=v2.1.6/git@ad1546c-dirty operation=install seq=12 event=start
time=2022-07-25T11:31:45Z version=v2.1.6/git@ad1546c-dirty operation=install seq=12 status="not reported for operation (by design)"
time=2022-07-25T11:31:45Z version=v2.1.6/git@ad1546c-dirty operation=install seq=12 event="migrate to mrseq" message="migrated mrseq to 12"
time=2022-07-25T11:31:45Z version=v2.1.6/git@ad1546c-dirty operation=install seq=12 event="created data dir" path=/var/lib/waagent/custom-script
time=2022-07-25T11:31:45Z version=v2.1.6/git@ad1546c-dirty operation=install seq=12 event=installed
time=2022-07-25T11:31:45Z version=v2.1.6/git@ad1546c-dirty operation=install seq=12 status="not reported for operation (by design)"
time=2022-07-25T11:31:45Z version=v2.1.6/git@ad1546c-dirty operation=install seq=12 event=end
Not writing a placeholder status file, already exists: /var/lib/waagent/Microsoft.Azure.Extensions.CustomScript-2.1.7/status/12.status
+ nohup /var/lib/waagent/Microsoft.Azure.Extensions.CustomScript-2.1.7/bin/custom-script-extension enable
time=2022-07-25T11:31:47Z version=v2.1.6/git@ad1546c-dirty operation=enable seq=12 event=start
time=2022-07-25T11:31:47Z version=v2.1.6/git@ad1546c-dirty operation=enable seq=12 event=pre-check
time=2022-07-25T11:31:47Z version=v2.1.6/git@ad1546c-dirty operation=enable seq=12 event="comparing seqnum" path=mrseq
time=2022-07-25T11:31:47Z version=v2.1.6/git@ad1546c-dirty operation=enable seq=12 event=exit message="the script configuration has already been processed, will not run again"
```
Is this intended? What would be the fix for this?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.