Azure / Azure/custom-script-extension-linux

File download fails: not enough debug information

Open
#121 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
113
Forks
46
Avg merge
6d 3h
Merged PRs (30d)
3

Description

Hello,

Custom Script Custom Extension is used to download file in the ARM. Deployment fails with error message:
`
processing file downloads failed: failed to download file[0]: failed to download file: unexpected status code: got=404 expected=200
`
Unfortunately, error message does not say URL of the file. There is no useful info in `/var/log/azure/custom-script/handler.log` either:
```
time=2017-11-20T11:28:31Z version=v2.0.6/git@1008306-clean operation=enable seq=0 event="creating output directory" path=/var/lib/waagent/custom-script/download/0
time=2017-11-20T11:28:31Z version=v2.0.6/git@1008306-clean operation=enable seq=0 event="created output directory"
time=2017-11-20T11:28:31Z version=v2.0.6/git@1008306-clean operation=enable seq=0 files=1
time=2017-11-20T11:28:31Z version=v2.0.6/git@1008306-clean operation=enable seq=0 file=0 event="download start"
time=2017-11-20T11:28:31Z version=v2.0.6/git@1008306-clean operation=enable seq=0 file=0 retry=0 error="unexpected status code: got=404 expected=200"
time=2017-11-20T11:28:31Z version=v2.0.6/git@1008306-clean operation=enable seq=0 file=0 retry=0 sleep=3s
time=2017-11-20T11:28:34Z version=v2.0.6/git@1008306-clean operation=enable seq=0 file=0 retry=1 error="unexpected status code: got=404 expected=200"
time=2017-11-20T11:28:34Z version=v2.0.6/git@1008306-clean operation=enable seq=0 file=0 retry=1 sleep=6s
time=2017-11-20T11:28:40Z version=v2.0.6/git@1008306-clean operation=enable seq=0 file=0 retry=2 error="unexpected status code: got=404 expected=200"
time=2017-11-20T11:28:40Z version=v2.0.6/git@1008306-clean operation=enable seq=0 file=0 retry=2 sleep=12s
time=2017-11-20T11:28:52Z version=v2.0.6/git@1008306-clean operation=enable seq=0 file=0 retry=3 error="unexpected status code: got=404 expected=200"
time=2017-11-20T11:28:52Z version=v2.0.6/git@1008306-clean operation=enable seq=0 file=0 retry=3 sleep=24s
time=2017-11-20T11:29:16Z version=v2.0.6/git@1008306-clean operation=enable seq=0 file=0 retry=4 error="unexpected status code: got=404 expected=200"
time=2017-11-20T11:29:16Z version=v2.0.6/git@1008306-clean operation=enable seq=0 file=0 retry=4 sleep=48s
time=2017-11-20T11:30:04Z version=v2.0.6/git@1008306-clean operation=enable seq=0 file=0 retry=5 error="unexpected status code: got=404 expected=200"
time=2017-11-20T11:30:04Z version=v2.0.6/git@1008306-clean operation=enable seq=0 file=0 retry=5 sleep=1m36s
time=2017-11-20T11:31:40Z version=v2.0.6/git@1008306-clean operation=enable seq=0 file=0 retry=6 error="unexpected status code: got=404 expected=200"
```
Created folder `var/lib/waagent/custom-script/download/0` has only empty file of the file to be downloaded:
```
ubuntu@influxGrafanaVm:~$ sudo ls -al /var/lib/waagent/custom-script/download/0
total 8
drwx------ 2 root root 4096 Nov 20 11:28 .
drwx------ 3 root root 4096 Nov 20 11:28 ..
-r-x------ 1 root root 0 Nov 20 11:28 setup-influx-grafana.sh
```
Snippet from the ARM:
```
"setupScriptUrl": "[concat('https://', parameters('bootstrapStorageAccountName'), '.blob.core.windows.net/', variables('bootstrapContainerName'), '/', variables('setupScriptBlobPrefix'), '/', variables('setupScriptName'), parameters('bootstrapStorageAccountSas'))]",
....
{
"name": "[concat(variables('vmName'), '/setupInfluxGrafana')]",
"type": "Microsoft.Compute/virtualMachines/extensions",
"location": "[resourceGroup().location]",
"apiVersion": "2015-06-15",
"dependsOn": [
"[concat('Microsoft.Compute/virtualMachines/', variables('vmName'))]"
],
"tags": {
"displayName": "setupInfluxGrafana"
},
"properties": {
"publisher": "Microsoft.Azure.Extensions",
"type": "CustomScript",
"typeHandlerVersion": "2.0",
"autoUpgradeMinorVersion": true,
"settings": {
"fileUris": [
"[variables('setupScriptUrl')]"
],
"commandToExecute": "[concat('./', variables('setupScriptName'), ' ', parameters('bootstrapStorageAccountName'), ' ', parameters('bootstrapStorageAccountKey'), ' ', variables('bootstrapContainerName'), ' ', variables('influxConfigBlobsPrefix'))]"
}
}
},
```
Other log files also have no file URL, e.g.
```
ubuntu@influxGrafanaVm:~$ cat /var/log/azure/Microsoft.Azure.Extensions.CustomScript/2.0.6/CommandExecution.log
2017/11/20 11:28:15.068871 INFO [Microsoft.Azure.Extensions.CustomScript-2.0.6] Target handler state: enabled
2017/11/20 11:28:15.069493 INFO [Microsoft.Azure.Extensions.CustomScript-2.0.6] [Enable] current handler state is: notinstalled
2017/11/20 11:28:30.258349 INFO [Microsoft.Azure.Extensions.CustomScript-2.0.6] Initialize extension directory
2017/11/20 11:28:30.260989 INFO [Microsoft.Azure.Extensions.CustomScript-2.0.6] Update settings file: 0.settings
2017/11/20 11:28:30.262648 INFO [Microsoft.Azure.Extensions.CustomScript-2.0.6] Install extension [bin/custom-script-shim install]
2017/11/20 11:28:31.272170 INFO [Microsoft.Azure.Extensions.CustomScript-2.0.6] Enable extension [bin/custom-script-shim enable]
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.