Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled exception during ARM Outputs Task Error #27

Open
MdeRhoter opened this issue Jun 25, 2019 · 7 comments
Open

Unhandled exception during ARM Outputs Task Error #27

MdeRhoter opened this issue Jun 25, 2019 · 7 comments
Assignees

Comments

@MdeRhoter
Copy link

2019-06-25T15:36:10.2284028Z ##[section]Starting: ARM Outputs 2019-06-25T15:36:10.2394709Z ============================================================================== 2019-06-25T15:36:10.2394823Z Task : ARM Outputs 2019-06-25T15:36:10.2394897Z Description : This task reads the output values of an ARM deployment and sets them as Azure Pipelines variables. 2019-06-25T15:36:10.2394984Z Version : 5.0.21 2019-06-25T15:36:10.2395040Z Author : Kees Schollaart 2019-06-25T15:36:10.2395123Z Help : [More Information](https://github.com/keesschollaart81/vsts-arm-outputs) 2019-06-25T15:36:10.2395200Z ============================================================================== 2019-06-25T15:36:11.3541865Z 4586a46a-571f-452d-9628-6185c73faa2b exists true 2019-06-25T15:36:11.3542413Z Logging in using ApplicationTokenCredentials, authScheme is 'ServicePrincipal' 2019-06-25T15:36:12.4999561Z Unhandled exception during ARM Outputs Task Error: Deployment 'something-something-something-something-25062019-1534' of Resource Group 'something-something-rg' did not succeed (status 'Failed') 2019-06-25T15:36:12.5000788Z at ArmOutputs.eval (webpack://someLibName/./dist/arm-outputs.js?:33:23) 2019-06-25T15:36:12.5001209Z at next (native) 2019-06-25T15:36:12.5001708Z at fulfilled (webpack://someLibName/./dist/arm-outputs.js?:4:58) 2019-06-25T15:36:12.5067807Z ##[error]Error: Deployment 'something-something-something-something-25062019-1534' of Resource Group 'something-something-rg' did not succeed (status 'Failed') 2019-06-25T15:36:12.5077369Z at process._tickCallback (internal/process/next_tick.js:109:7) 2019-06-25T15:36:12.9824398Z ##[section]Finishing: ARM Outputs

This output first appeared today, it's running on a self-hosted agent (Win2016, all the latest updates, latest DevOps agent). How can I get this going again?

@paulomatiolimosaic
Copy link

I have the same error on my self-hosted agents Win2016. It is weird that worked for 3 other subscriptions/resource groups but failed for this subscription/rg.

2019-06-27T01:19:07.1354649Z ##[section]Starting: Extract ARM Output Values to Variables
2019-06-27T01:19:07.1477585Z ==============================================================================
2019-06-27T01:19:07.1477716Z Task : ARM Outputs
2019-06-27T01:19:07.1477808Z Description : This task reads the output values of an ARM deployment and sets them as Azure Pipelines variables.
2019-06-27T01:19:07.1477913Z Version : 5.0.21
2019-06-27T01:19:07.1477993Z Author : Kees Schollaart
2019-06-27T01:19:07.1478073Z Help : More Information
2019-06-27T01:19:07.1478183Z ==============================================================================
2019-06-27T01:19:08.0870334Z b4ebacbf-d97b-xxxx-xxxx-0170c1b0fc8a exists true
2019-06-27T01:19:08.0875519Z Logging in using ApplicationTokenCredentials, authScheme is 'ServicePrincipal'
2019-06-27T01:19:08.9331623Z Unhandled exception during ARM Outputs Task Error: Deployment could not be found for Resource Group 'azu-eus2-prd-rg-RetailForecastEngine'.
2019-06-27T01:19:08.9332872Z at ArmOutputs.eval (webpack://someLibName/./dist/arm-outputs.js?:30:23)
2019-06-27T01:19:08.9333317Z at next (native)
2019-06-27T01:19:08.9333744Z at fulfilled (webpack://someLibName/./dist/arm-outputs.js?:4:58)
2019-06-27T01:19:08.9334146Z at process._tickCallback (internal/process/next_tick.js:109:7)
2019-06-27T01:19:08.9463890Z ##[error]Error: Deployment could not be found for Resource Group 'xxx-xxx-xxx-rg-xxxxxxxxxxx'.
2019-06-27T01:19:09.7546376Z ##[section]Finishing: Extract ARM Output Values to Variables

@Astrophizz
Copy link

I see the same for Azure-hosted agents. Version 4 works fine but 5 fails saying it could not find a deployment.

@keesschollaart81
Copy link
Owner

It's hard to identity what exactly did go wrong here. In the first post the error was:
Deployment 'x-25062019-1534' of Resource Group 'x-rg' did not succeed (status 'Failed')
Which seems to imply that the latest deployment on that RG has a provisioningState not equal to Succeeded, in that case 'Failed'. This behaviour is intentional (at least the Azure ARM api gave this deployment-status as a result).

I was not able to reproduce this other than an expected fail during running deployments/failed deployments (and FailBehaviour set to fail). There were some major updates to the Azure SDK's, dependencies I've just updated. This new version will roll out later this week after some QA.

@melborp
Copy link

melborp commented Sep 10, 2019

I am hitting the same issues with v5. I was pondering if it can be race condition between deployment completion and outputs looking for it.
However that would mean that the setting "When last deployment is failed" = "Use last successful deployment" should work. All ARM deployments to RG are successful, but the error i get is:

2019-09-10T06:25:00.1203175Z Unhandled exception during ARM Outputs Task Error: Deployment could not be found for Resource Group 'dev-weu-somename-rg'.
2019-09-10T06:25:00.1203651Z at ArmOutputs.eval (webpack://someLibName/./dist/arm-outputs.js?:30:23)
2019-09-10T06:25:00.1203758Z at next (native)
2019-09-10T06:25:00.1203883Z at fulfilled (webpack://someLibName/./dist/arm-outputs.js?:4:58)
2019-09-10T06:25:00.1205723Z at process._tickCallback (internal/process/next_tick.js:109:7)

I cant see why v4 would work and v5 wouldnt. However v5 is also not using AzureRM (which is why i am really needing it, we just started switching from AzureRM to Az module.

@melborp
Copy link

melborp commented Sep 10, 2019

I can confirm it is something to do with the filter. When i removed the filter parameter it worked.
This however is not feasible, i have several deployments going into this resource group.

@melborp
Copy link

melborp commented Sep 10, 2019

I checked the micromatch (https://github.com/micromatch/micromatch) filtering functionality that is being used here. its different from the powershell one used by v4.

When you add a filter then you need to use '*' for wildcard. So the partial template name filter for me is something like 'my-super-template*' and then works nicely.

@keesschollaart81 @Astrophizz @MdeRhoter - could have been the same issue for you?

@Astrophizz
Copy link

The wildcard worked! Thanks @melborp

The documentation on the filter states:

Optional string to filter deployments by. This can be useful if you have concurrent deployments to the same resource group. Deployment names in Azure Pipelines are the name of the JSON file plus the date and time, so a file CreateKeyVault.json could have a deployment name of CreateKeyVault-20180025-151538-0688. In this case, if you want to filter to deployments of this file enter CreateKeyVault as the filter.

This uses micromatch under the hood (ignoring case) so us wildcards like *

The example of CreateKeyVault conflicts with the subsequent statement about micromatch. The example should be CreateKeyVault*.

Another noteworthy change is that "Outputs to process" is now case-sensitive where it wasn't before.

@keesschollaart81 keesschollaart81 self-assigned this Sep 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants