mandiant / mandiant/commando-vm

Installation bug - ERROR: Cannot bind argument to parameter 'Path' because it is null.

Open
#313 1 comment 12 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PowerShell
Stars
7.8k
Forks
1.4k
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug and expected behavior**
Installation fails on first reboot *AFTER* debloat.vm runs. Specific error is:

```
C:\Windows\system32>Call PowerShell -NoProfile -ExecutionPolicy bypass -command "Import-Module 'C:\ProgramData\boxstarter\Boxstarter.Bootstrapper\boxstarter.bootstrapper.psd1';Invoke-Boxstarter -RebootOk -NoPassword:$False"
Boxstarter Version 3.0.3.0
(c) 2018 Chocolatey Software, Inc, 2012 - 2018 Matt Wrock. https://boxstarter.org

Boxstarter: Disabling Automatic Updates from Windows Update
++ Boxstarter starting Calling Chocolatey to install installer.vm. This may take several minutes to complete...
Chocolatey v2.2.2
Installing the following packages:
installer.vm
By installing, you accept licenses for the packages.
Progress: Downloading installer.vm 0.0.0.20231009... 100%

installer.vm v0.0.0.20231009 (forced)
installer.vm package files install completed. Performing other installation steps.
*** LOADING BOXSTARTER ***
Boxstarter: *** HELLO WORLD ***
Cannot find path 'C:\ProgramData\_VM\packages.xml' because it does not exist.
2023/10/13 19:06:34 [installer.vm] vm.common.psm1 [+] ERROR : [ERR] Cannot bind argument to parameter 'Path' because it is null.
At C:\ProgramData\chocolatey\lib\installer.vm\tools\chocolateyinstall.ps1:9 char:36
+ $configXml = [xml](Get-Content $configPath)
+ ~~~~~~~~~~~
ERROR: Cannot bind argument to parameter 'Path' because it is null.
The install of installer.vm was NOT successful.
Error while running 'C:\ProgramData\chocolatey\lib\installer.vm\tools\chocolateyinstall.ps1'.
See log for details.

Chocolatey installed 0/1 packages. 1 packages failed.
See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

Failures
- installer.vm (exited -1) - Error while running 'C:\ProgramData\chocolatey\lib\installer.vm\tools\chocolateyinstall.ps1'.
See log for details.
++ Boxstarter finished Calling Chocolatey to install installer.vm. This may take several minutes to complete... 00:00:15.0862313
True
Boxstarter: Restore Automatic Updates from Windows Update
Boxstarter: Enabling UAC
Type ENTER to exit:
```

**To Reproduce**
Steps to reproduce the behavior:
1. Install script using `.\install.ps1 -cli ` in an Administrator Powershell session.

**Screenshots**
![image](https://github.com/mandiant/commando-vm/assets/19333606/223594a4-3854-496b-b181-7a38b6d7818f)

**Version**
- OS: Windows 10 22H2 Build 19045.2965

**Additional context**
To repeat, this happens right after the first reboot, *AFTER* debloat.vm runs.
I believe this is due to this merge - https://github.com/mandiant/commando-vm/pull/306 which renamed `packages.xml` to `config.xml` which does exist in the `C:\ProgramData\_VM\`

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with install.ps1 and the Chocolatey entry point at C:\ProgramData\chocolatey\lib\installer.vm\tools\chocolateyinstall.ps1, then trace the first-reboot path after debloat.vm runs. Compare the expected packages.xml with the config.xml reported in C:\ProgramData\_VM\. Done means the installer completes after reboot without the null Path error.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
devops, operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.