Azure / Azure/custom-script-extension-linux

File download fails: not enough debug information

Aperta
#121 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Go
Stelle
113
Fork
46
Merge medio
6g 3h
PR unite (30g)
3

Descrizione

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]
```

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Inizia dall’errore di download mostrato in /var/log/azure/custom-script/handler.log e dalla voce corrispondente di CommandExecution.log, quindi segui il percorso di download dei file in Go che produce l’errore 404. Lo snippet ARM fileUris fornisce l’input che causa il fallimento. Il lavoro è considerato completato quando l’URL del file richiesto è inclusa nei dettagli dell’errore e nei log pertinenti, e il comportamento di retry esistente è ancora rappresentato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
azure, go
Ambito
cloud, devops
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
38/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.