microsoft / startstopv2-deployments

MIT License
54 stars 29 forks source link

AutoStop fails with a 409 Conflict warning and BadRequest error in CreateAutoStopAlertExecutor #94

Open dinvlad opened 1 year ago

dinvlad commented 1 year ago

I've deployed this solution yesterday, however the AutoStop functionality isn't working (the VM doesn't stop). All function report successful execution, except for CreateAutoStopAlertExecutor, which logs the following:

2023-05-24T21:53:26Z   [Information]   Request [caacb797-301d-4045-894c-a3e5b6f58616] POST https://<REDACTED>.table.core.windows.net/Tables?$format=REDACTED
x-ms-version:REDACTED
DataServiceVersion:REDACTED
Accept:application/json; odata=minimalmetadata
x-ms-client-request-id:caacb797-301d-4045-894c-a3e5b6f58616
x-ms-return-client-request-id:true
User-Agent:azsdk-net-Data.Tables/12.6.1,(.NET 6.0.16; Microsoft Windows 10.0.14393)
x-ms-date:REDACTED
Authorization:REDACTED
Content-Type:application/json; odata=nometadata
client assembly: Azure.Data.Tables
2023-05-24T21:53:26Z   [Warning]   Error response [caacb797-301d-4045-894c-a3e5b6f58616] 409 Conflict (00.0s)
Cache-Control:no-cache
Transfer-Encoding:chunked
Server:Windows-Azure-Table/1.0,Microsoft-HTTPAPI/2.0
x-ms-request-id:1d2ef93d-6002-0037-188a-8e7a5b000000
x-ms-client-request-id:caacb797-301d-4045-894c-a3e5b6f58616
x-ms-version:REDACTED
X-Content-Type-Options:REDACTED
Date:Wed, 24 May 2023 21:53:24 GMT
Content-Type:application/json; odata=minimalmetadata; streaming=true; charset=utf-8
2023-05-24T21:53:26Z   [Information]   Executing 'CreateAutoStopAlertExecutor' (Reason='New queue message detected on 'create-alert-request'.', Id=71249287-9dff-4df8-9e4d-55d9c7744813)
2023-05-24T21:53:26Z   [Information]   Trigger Details: MessageId: 536094c3-3aa1-461c-a3cd-7b4df73bf2d5, DequeueCount: 3, InsertedOn: 2023-05-24T21:49:59.000+00:00
2023-05-24T21:53:26Z   [Information]   AutoStop: Attempted the create alert action on vm /subscriptions/<REDACTED>/resourceGroups/<REDACTED>/providers/Microsoft.Compute/virtualMachines/<REDACTED>:
2023-05-24T21:53:26Z   [Error]   Alert creation failed for /subscriptions/<REDACTED>/resourceGroups/<REDACTED>/providers/Microsoft.Compute/virtualMachines/<REDACTED>, exception message: Operation returned an invalid status code 'BadRequest'
2023-05-24T21:53:26Z   [Error]   Executed 'CreateAutoStopAlertExecutor' (Failed, Id=71249287-9dff-4df8-9e4d-55d9c7744813, Duration=423ms)

I am also unable to re-deploy the solution, as per #93. Related issue: #69

Do you have any advice on how to proceed?

balas77 commented 1 year ago

can you check if you have provided the function app managed identity as contributor at the subscription level?