Azure/ALZ-Bicep

GitHub Actions Workflow fails - "Cannot retrieve the dynamic parameters for the cmdlet. Cannot find path because it does not exist"

Closed this issue · 3 comments

I'm trying to deploy using the classic version of Accelerator.
I have followed the instructions mentioned here:
https://github.com/Azure/ALZ-Bicep/wiki/Accelerator

In this example, the repository name is "animated-octo-chainsaw".

  1. I have cloned an uninitialized repository to a local directory c:\Repos\animated-octo-chainsaw
  2. I have run the Deploy-Accelerator -o c:\Repos\animated-octo-chainsaw -i "bicep" -b "alz_github" -bicepLegacyMode $true which created the starter and upstream-release directories.
  3. answered Y to a question if I want to initialize the "starter" directory as git repo.

All Workflows are failing when using "classic" version of Deployment-Accelerator with the path being broken:

Deploy-ALZPolicyAssignments.ps1: /home/runner/work/_temp/47e45f64-838e-4a35-b6d4-536bbf315dad.ps1:2 Line | 2 | .\pipeline-scripts\Deploy-ALZPolicyAssignments.ps1 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | Cannot retrieve the dynamic parameters for the cmdlet. Cannot find path | '/home/runner/work/animated-octo-chainsaw/animated-octo-chainsaw/upstream-releases/v0.19.3/infra-as-code/bicep/modules/policy/assignments/alzDefaults/alzDefaultPolicyAssignments.bicep' because it does not exist. Error: Error: The process '/usr/bin/pwsh' failed with exit code 1

Screenshot 2024-09-28 211302

As you can see for some unknown reason the runner is using wrong path where the repo name is added twice and the process fails.

Additional info:

Initializing repository step from Workflow log:
Temporarily overriding HOME='/home/runner/work/_temp/e161df7c-c5c3-43d3-8504-d2ffe9ce8621' before making global git config changes Adding repository directory to the temporary git global config as a safe directory /usr/bin/git config --global --add safe.directory /home/runner/work/animated-octo-chainsaw/animated-octo-chainsaw Deleting the contents of '/home/runner/work/animated-octo-chainsaw/animated-octo-chainsaw' Initializing the repository /usr/bin/git init /home/runner/work/animated-octo-chainsaw/animated-octo-chainsaw

Does this mean the classic version of Deployment Accelerator is broken ?

Check previous GitHub issues

  • I have searched the issues for this item and found no duplicate

Code of Conduct

  • I agree to follow this project's Code of Conduct

Hi @michael-novak-80, could you please share which version of the PowerShell module you're using? You can run Get-InstalledModule -Name ALZ

Hi @oZakari,

Version              Name                                Repository           Description
3.0.2                ALZ                                 PSGallery            Azure Landing Zones Powershell Module

Hi @michael-novak-80, could you please share which version of the PowerShell module you're using? You can run Get-InstalledModule -Name ALZ

Hey @michael-novak-80, when using this version of the ALZ PowerShell module, I noticed that there is a bug with where the ALZ-Bicep release directory gets put in the incorrect location.

Please take the v0.19.4 release directory that gets incorrectly created in the animated-octo-chainsaw\upstream-releases directory and move it into the starter\upstream-releases directory.

Screenshot for reference:
image

You can then delete empty animated-octo-chainsaw\upstream-releases directory.

If you have any other questions, feel free to respond here.

Also, as we've just deprecated and removed the Classic Accelerator from the ALZ-PowerShell-Module as of version 4.0.0, we won't be able to fix this particular bug.