GuestConfiguration errors out if the generated MOF filename has periods in the filename before the '.mof'
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- powershell
- Domain
- tooling
Research direction
Reproduce the issue by passing a package name containing periods to New-GuestConfigurationPackage, then use Get-GuestConfigurationPackageComplianceStatus with the resulting package. Trace how the commands derive the MOF and metaconfig paths from the package filename; done means packages with periods resolve both files correctly and compliance status runs without missing-document errors.
Written by the indexing model from the issue text.
Description
Details of the scenario you tried and the problem that is occurring
The GuestConfiguration module errors out if the guest configuration package filename specified to New-GuestConfigurationPackage (by the Name parameter) includes periods in the package name. When the Guest Configuration package contains periods in the package name then the MOF file inside of the ZIP also includes periods in the filename, and when attempting to use the package with the Get-GuestConfigurationPackageComplianceStatus command , Guest Configuration mishandles this and tries to find the MOF using the wrong path.
This is particularly problematic because the guidance found here specifically suggests a package naming convention that will lead to users encountering this error condition: https://learn.microsoft.com/en-us/azure/governance/machine-configuration/how-to/create-policy-definition?source=recommendations#policy-lifecycle
Verbose logs showing the problem
Error: DSC document '/home/myaccount/.local/share/powershell/Modules/GuestConfiguration/4.5.0/gcworker/packages/UbuntuServer-20-04-LTS-CISv201-Section1-AuditAndSet-0.1.4/UbuntuServer-20-04-LTS-CISv201-Section1-AuditAndSet-0.1.mof' doesn't exist in assignment package.
Error: Metaconfig document '/home/myaccount/.local/share/powershell/Modules/GuestConfiguration/4.5.0/gcworker/packages/UbuntuServer-20-04-LTS-CISv201-Section1-AuditAndSet-0.1.4/UbuntuServer-20-04-LTS-CISv201-Section1-AuditAndSet-0.1.metaconfig.json' doesn't exist in assignment package.
Error: Failed to Run Consistency for 'UbuntuServer-20-04-LTS-CISv201-Section1-AuditAndSet-0.1.4' Error : Current configuration does not exist. Execute Start-DscConfiguration command with -Path parameter to specify a configuration file and create a current configuration first.
Write-Error: Job 29cd2220-d307-48a9-9123-267071dd52e6 : MIResult: 6 Error Message: Current configuration does not exist. Execute Start-DscConfiguration command with -Path parameter to specify a configuration file and create a current configuration
first. Message ID: OMI:MI_Result:6 Error Category: 0 Error Code: 1 Error Type:
Suggested solution to the issue
It looks like the GuestConfiguration code is making a bad assumption regarding periods being in the filename, and parsing based on that bad assumption. I assume the related code for parsing the path of the MOF needs revising.
The DSC configuration that is used to reproduce the issue (if applicable)
n/a - this issue is not configuration-dependent
The operating system the target node is running
Ubuntu Server 18.04 LTS
Version and build of PowerShell the target node is running
7.3.10 (7.4+ doesn't seem to work with GuestConfiguration, so we have intentionally avoided upgrading)
Version of the module that was used
4.5.0
- Dominant language
- PowerShell
- Stars
- 8
- Forks
- 13
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Azure/GuestConfiguration
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
Azure/GuestConfiguration#322 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
Azure/GuestConfiguration#320 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Azure/GuestConfiguration#319 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
Azure/GuestConfiguration#312 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
Azure/GuestConfiguration#308 · 1 comment ·
All issues in Azure/GuestConfiguration
Similar issues
-
namespace operations
Difficulty 1/5 Under an hour Newbie friendliness 72/100
EclipseFdn/open-vsx.org#13737 ·
Maintainers usually reply within 1 day
-
feedback simulation workshop
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
githubnext/gh-aw-workshop#4174 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
WingedGuardian/GENesis-AGI#2852 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
JuliusBrussee/caveman#1183 · 1 comment ·
Maintainers usually reply within 1 day
-
agent-review-finding chore
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
jordansmall/spindrift#4432 ·
Maintainers usually reply within 1 day