microsoft / coe-starter-kit

Other
748 stars 220 forks source link

[ALM Accelerator - BUG]: Error on Commit - Update Deployment Settings #4053

Closed bronsonacoutts closed 1 year ago

bronsonacoutts commented 1 year ago

Describe the issue

Folks,

I have (what seems to be spontaneously) developed an error with the commit pipeline for some of my existing solutions (that have previously worked).

Some of the solutions that have previously run this pipeline several times successfully are now all failing at the same point. While other solutions from the same DEV environment continue to run BAU.

image

Starting: Saving Export Pipeline Parameters

Task : PowerShell Description : Run a PowerShell script on Linux, macOS, or Windows Version : 2.210.0 Author : Microsoft Corporation Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/powershell

Generating script. ========================== Starting Command Output =========================== "C:\Program Files\PowerShell\7\pwsh.exe" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command ". 'D:\a_temp\93087eee-abcc-418d-8a9a-cf9a10a281c6.ps1'" Write-Export-Pipeline-Parameters : A positional parameter cannot be found that accepts argument 'https://<>.crm6.dynamics.com/'. At D:\a_temp\93087eee-abcc-418d-8a9a-cf9a10a281c6.ps1:5 char:1

Expected Behavior

The pipeline successfully commits to Git.

What component are you experiencing the issue with?

ALM Accelerator Pipelines

What solution version are you using?

1.0.20221004.2 & CenterofExcellenceALMAccelerator-October2022-HF1

Steps To Reproduce

No response

Anything else?

image
mikefactorial commented 1 year ago

@bronsonacoutts apologies that this was never responded to. Will look into what's happening here, but may come back with questions.

bronsonacoutts commented 1 year ago

Know what? Thats quite alright, not really sure how you manage to respond to all of the posts you get on here period, let alone investigate them and provide solutions!

I have more info on this now.... After some resyncing and a variety of other things - I haven't seen specific error for a while now.

Instead, about the same time that this one stopped, I am now getting a fail on about 50% of my solutions when exporting to git .

It always fails at "updating deployment settings" here's a sample:

2022-11-17T07:23:19.3255802Z ##[section]Starting: Update Deployment Settings 2022-11-17T07:23:19.3415016Z ============================================================================== 2022-11-17T07:23:19.3415544Z Task : PowerShell 2022-11-17T07:23:19.3415997Z Description : Run a PowerShell script on Linux, macOS, or Windows 2022-11-17T07:23:19.3416408Z Version : 2.212.0 2022-11-17T07:23:19.3417450Z Author : Microsoft Corporation 2022-11-17T07:23:19.3418000Z Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/powershell 2022-11-17T07:23:19.3418597Z ============================================================================== 2022-11-17T07:23:20.4448497Z Generating script. 2022-11-17T07:23:20.4938674Z ========================== Starting Command Output =========================== 2022-11-17T07:23:20.5220654Z ##[command]"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command ". 'D:\a_temp\4729fa0c-12f4-4303-a225-d84980022553.ps1'" 2022-11-17T07:23:20.9429206Z { 2022-11-17T07:23:20.9429801Z "value": [ 2022-11-17T07:23:20.9430166Z { 2022-11-17T07:23:20.9430658Z "BuildName": "deploy-validation-PowerBICommentary", 2022-11-17T07:23:20.9431262Z "BuildTemplate": null, 2022-11-17T07:23:20.9431782Z "DeploymentEnvironmentName": "Validation", 2022-11-17T07:23:20.9432370Z "DeploymentEnvironmentUrl": "https://<>qa.crm6.dynamics.com/", 2022-11-17T07:23:20.9433014Z "EnvironmentUrl": "https://<>coe.crm6.dynamics.com/", 2022-11-17T07:23:20.9433490Z "ServiceConnectionName": null, 2022-11-17T07:23:20.9433811Z "StepType": 809060001, 2022-11-17T07:23:20.9434102Z "UserSettings": [ 2022-11-17T07:23:20.9434226Z 2022-11-17T07:23:20.9434447Z ] 2022-11-17T07:23:20.9434690Z }, 2022-11-17T07:23:20.9434914Z { 2022-11-17T07:23:20.9435214Z "BuildName": "deploy-test-PowerBICommentary", 2022-11-17T07:23:20.9435550Z "BuildTemplate": null, 2022-11-17T07:23:20.9437295Z "DeploymentEnvironmentName": "Test", 2022-11-17T07:23:20.9437729Z "DeploymentEnvironmentUrl": "https://<>uat.crm6.dynamics.com/", 2022-11-17T07:23:20.9438172Z "EnvironmentUrl": "https://<>coe.crm6.dynamics.com/", 2022-11-17T07:23:20.9438530Z "ServiceConnectionName": null, 2022-11-17T07:23:20.9439137Z "StepType": 809060001, 2022-11-17T07:23:20.9439598Z "UserSettings": [ 2022-11-17T07:23:20.9439805Z 2022-11-17T07:23:20.9440017Z ] 2022-11-17T07:23:20.9440250Z }, 2022-11-17T07:23:20.9440474Z { 2022-11-17T07:23:20.9440787Z "BuildName": "deploy-prod-PowerBICommentary", 2022-11-17T07:23:20.9441208Z "BuildTemplate": "/Pipelines/build-deploy-prod-SampleSolution.yml", 2022-11-17T07:23:20.9441606Z "DeploymentEnvironmentName": "Prod", 2022-11-17T07:23:20.9442005Z "DeploymentEnvironmentUrl": "https://<>.crm6.dynamics.com/", 2022-11-17T07:23:20.9442437Z "EnvironmentUrl": "https://<>coe.crm6.dynamics.com/", 2022-11-17T07:23:20.9442812Z "ServiceConnectionName": null, 2022-11-17T07:23:20.9443131Z "StepType": 809060001, 2022-11-17T07:23:20.9443420Z "UserSettings": [ 2022-11-17T07:23:20.9443548Z 2022-11-17T07:23:20.9443901Z ] 2022-11-17T07:23:20.9444236Z } 2022-11-17T07:23:20.9444460Z ], 2022-11-17T07:23:20.9444676Z "Count": 3 2022-11-17T07:23:20.9446521Z } 2022-11-17T07:23:20.9448238Z Update Deployment Settings 2022-11-17T07:23:21.0062301Z 2022-11-17T07:23:21.0065058Z 2022-11-17T07:23:21.0069855Z Directory: D:\a\1\s\Business Services and Corporate\PowerBICommentary 2022-11-17T07:23:21.0070242Z 2022-11-17T07:23:21.0070774Z 2022-11-17T07:23:21.0100829Z Mode LastWriteTime Length Name
2022-11-17T07:23:21.0110713Z ---- ------------- ------ ----
2022-11-17T07:23:21.0133075Z d----- 11/17/2022 7:23 AM config
2022-11-17T07:23:21.0378031Z Retrieved 3 deployment environments 2022-11-17T07:23:21.0396316Z https://dev.azure.com/<>/<>/_apis/git/repositories/Business Services and Corporate/refs?filter=heads/PowerBICommentary&api-version=6.0 2022-11-17T07:23:21.1265691Z Retrieved 0 branch 2022-11-17T07:23:21.1286158Z https://dev.azure.com/<>/<>/_apis/build/definitions?name=deploy-*-PowerBICommentary&includeAllProperties=true&api-version=6.0 2022-11-17T07:23:21.1644804Z Retrieved 0 builds 2022-11-17T07:23:21.1765784Z Retrieved 3 deployment configurations 2022-11-17T07:23:21.1950610Z environments: validation=https://<>qa.crm6.dynamics.com/,validation-buildname=deploy-validation-PowerBICommentary,test=https://<>uat.crm6.dynamics.com/,test-buildname=deploy-test-PowerBICommentary,prod=https://<>.crm6.dynamics.com/,prod-buildname=deploy-prod-PowerBICommentary,prod-buildtemplate=/Pipelines/build-deploy-prod-SampleSolution.yml,environments=Validation|Test|Prod 2022-11-17T07:23:21.8996502Z info: Branch start 2022-11-17T07:23:21.9013843Z info: Setup branch 2022-11-17T07:23:21.9019228Z info: Using supplied access token 2022-11-17T07:23:21.9023658Z info: Pipeline Project: <<My%20Project>> 2022-11-17T07:23:22.1062868Z info: Getting Project 2022-11-17T07:23:22.2056135Z info: Getting Pipeline Project 2022-11-17T07:23:22.2478495Z info: Found project <> <> 2022-11-17T07:23:22.2483685Z info: Found pipeline project undefined <<My%20Project>> 2022-11-17T07:23:22.2494884Z info: An error occurred while creating the branch: TypeError: Cannot read properties of null (reading 'id') 2022-11-17T07:23:22.2499741Z error: Cannot read properties of null (reading 'id') 2022-11-17T07:23:22.2902714Z {"level":"info","message":"Branch start","timestamp":"2022-11-17 07:23:21 AM +0000"} 2022-11-17T07:23:22.2904753Z {"level":"info","message":"Setup branch","timestamp":"2022-11-17 07:23:21 AM +0000"} 2022-11-17T07:23:22.2905905Z {"level":"info","message":"Using supplied access token","timestamp":"2022-11-17 07:23:21 AM +0000"} 2022-11-17T07:23:22.2906742Z {"level":"info","message":"Pipeline Project: <<My%20Project>>","timestamp":"2022-11-17 07:23:21 AM +0000"} 2022-11-17T07:23:22.2907542Z {"level":"info","message":"Getting Project","timestamp":"2022-11-17 07:23:22 AM +0000"} 2022-11-17T07:23:22.2908338Z {"level":"info","message":"Getting Pipeline Project","timestamp":"2022-11-17 07:23:22 AM +0000"} 2022-11-17T07:23:22.2909164Z {"level":"info","message":"Found project <> <>","timestamp":"2022-11-17 07:23:22 AM +0000"} 2022-11-17T07:23:22.2923203Z Importing PowerShell Module: D:\a\1_coe\ALM_ACC\da\2.8.14\Microsoft.Xrm.Data.PowerShell - 2.8.14 2022-11-17T07:23:23.7158534Z https://dev.azure.com/<>/<>/_apis/build/definitions?name=deploy-validation-PowerBICommentary&includeAllProperties=true&api-version=6.0 2022-11-17T07:23:23.7569188Z Retrieved 0 builds 2022-11-17T07:23:23.7638903Z Creating D:\a\1\s\Business Services and Corporate\PowerBICommentary\config -Name Validation -ItemType directory 2022-11-17T07:23:23.7652596Z 2022-11-17T07:23:23.7654519Z 2022-11-17T07:23:23.7658628Z Directory: D:\a\1\s\Business Services and Corporate\PowerBICommentary\config 2022-11-17T07:23:23.7660812Z 2022-11-17T07:23:23.7660936Z 2022-11-17T07:23:23.7686694Z Mode LastWriteTime Length Name
2022-11-17T07:23:23.7695409Z ---- ------------- ------ ----
2022-11-17T07:23:23.7719805Z d----- 11/17/2022 7:23 AM Validation
2022-11-17T07:23:23.7842317Z Creating deployment settings 2022-11-17T07:23:23.8030131Z Creating custom deployment settings 2022-11-17T07:23:23.8191117Z https://dev.azure.com/<>/<>/_apis/build/definitions?name=deploy-test-PowerBICommentary&includeAllProperties=true&api-version=6.0 2022-11-17T07:23:23.8488956Z Retrieved 0 builds 2022-11-17T07:23:23.8533251Z Creating D:\a\1\s\Business Services and Corporate\PowerBICommentary\config -Name Test -ItemType directory 2022-11-17T07:23:23.8567913Z d----- 11/17/2022 7:23 AM Test
2022-11-17T07:23:23.8586246Z Creating deployment settings 2022-11-17T07:23:23.8660413Z Creating custom deployment settings 2022-11-17T07:23:23.8701050Z https://dev.azure.com/<>/<>/_apis/build/definitions?name=deploy-prod-PowerBICommentary&includeAllProperties=true&api-version=6.0 2022-11-17T07:23:23.9008094Z Retrieved 0 builds 2022-11-17T07:23:23.9028237Z Creating D:\a\1\s\Business Services and Corporate\PowerBICommentary\config -Name Prod -ItemType directory 2022-11-17T07:23:23.9068480Z d----- 11/17/2022 7:23 AM Prod
2022-11-17T07:23:23.9090210Z Creating deployment settings 2022-11-17T07:23:23.9159864Z Creating custom deployment settings 2022-11-17T07:23:23.9277543Z 2022-11-17T07:23:23.9277924Z 2022-11-17T07:23:24.0161976Z ##[error]PowerShell exited with code '1'. 2022-11-17T07:23:24.0511750Z ##[section]Finishing: Update Deployment Setting

I have resynced pipelines (more than once) I have upgraded (more than once) I have checked all of the deployment profiles I have deleted deployment profiles and recreated them (more than once)

I thought at first that it was only affecting the solutions that I had changed the repo for alas; it seems to be occurring with any new solution that I create a profile for as well.

Similarly, I am getting a 404 when attempting to import a solution, like I say, I have resynced the repo, but perhaps I am doing something else wrong.

image
mikefactorial commented 1 year ago

@bronsonacoutts this appears to be related to another issue (https://github.com/microsoft/coe-starter-kit/issues/4077) specific to spaces in project names. There's a PR here that was merged 4 days ago with a 2 line change that will likely resolve your issue.

https://github.com/microsoft/coe-alm-accelerator-templates/pull/239

bronsonacoutts commented 1 year ago

@mikefactorial Thanks for that buddy! I just read this, it started working, so I guess your updates were successful!

Thanking you!

Still having issues with the import feature. I will do some more testing and check the other open issues to see if there is something related in the pipeline. Otherwise will raise a separate issue.

CoEStarterKitBot commented 1 year ago

@bronsonacoutts This has been fixed in the latest release. Please install the latest version of the toolkit following the instructions for installing updates. Note that if you do not remove the unmanaged layers as described there you will not receive updates from us.

bronsonacoutts commented 1 year ago

Awesome work! Thanks Mike. A real modern day Mother Theresa!

On Thu, 8 Dec 2022, 2:08 am CoE Bot, @.***> wrote:

@bronsonacoutts https://github.com/bronsonacoutts This has been fixed in the latest release. Please install the latest version of the toolkit https://aka.ms/CoEStarterKitDownload following the instructions for installing updates https://docs.microsoft.com/power-platform/guidance/coe/setup#installing-updates. Note that if you do not remove the unmanaged layers as described there you will not receive updates from us.

— Reply to this email directly, view it on GitHub https://github.com/microsoft/coe-starter-kit/issues/4053#issuecomment-1341197766, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANHETZPFWUR2QWBHEV2T3YLWMCY65ANCNFSM6AAAAAARPVXQRE . You are receiving this because you were mentioned.Message ID: @.***>