OSDeploy / OSD

OSD Shared Functions
MIT License
149 stars 61 forks source link

OSDCloud drops during stage of downloading drivers from MS Update Catalog while in WinPE #122

Closed gwblok closed 6 months ago

gwblok commented 6 months ago

Describe the bug When running OSDCloud, it MIGHT Fail to download drivers from Windows Update Catalog in WinPE

To Reproduce Steps to reproduce the behavior: Run OSDCloud and MAYBE it will happen. I've had mixed results on different hardware. Test machine that consistently failed: HP ProDesk 400 G1 - 18E9

Expected behavior It would download successfully

Screenshots image

Additional context https://twitter.com/gwblok/status/1766243562033922132

gwblok commented 6 months ago

I'm working on a Fix, just uploaded a Try/Catch to hopefully allow it to continue when this happens. @OSDeploy, I'd love for you to get your eyes on this sometime. @akosbakos also witnessed this (it's his screen capture)

gwblok commented 6 months ago

The error message happens right after Line 88 in the Save-MSUpCatDriver.ps1 file. I've added the Try / Catch for now. Unsure what the real fix would be. - Change has been pushed to GitHub - Marked with Issue 122

0x4448 commented 6 months ago

Pretty sure the error is here:

https://github.com/OSDeploy/OSD/blob/b1666edd896bd46cba1a6fea3db2052a1b5dd0f7/Public/Functions/MicrosoftCatalog/Save-MsUpCatDriver.ps1#L109

When all the if-statements between lines 93-107 fail to find anything, the variable is null. Changing the condition in line 109 to one of these might fix it:

$null -ne $WindowsUpdateDriver

$null -ne $WindowsUpdateDriver -and $WindowsUpdateDriver.Guid

The same change should probably be applied to to line 206.

https://github.com/OSDeploy/OSD/blob/b1666edd896bd46cba1a6fea3db2052a1b5dd0f7/Public/Functions/MicrosoftCatalog/Save-MsUpCatDriver.ps1#L206

AkosBakos commented 6 months ago

I am not even able to create/change the ISO file: image

AkosBakos commented 6 months ago

@0x4448 check the newest release, 24.3.10.1. It should work now

gwblok commented 6 months ago

David did some updates for 24.3.10.1 - Issue should be resolved now. I'll do some testing, but I'm closing for now.

AkosBakos commented 6 months ago

@gwblok what do you think?

=======================================================================

Write-SectionHeader "[PreOS] Prepare Firmware Tasks"

=======================================================================

Register-PSRepository -Default -Verbose Set-PSRepository -Name PSGallery -InstallationPolicy Trusted -Verbose Install-Module -Name MSCatalog -Force -Verbose -SkipPublisherCheck -AllowClobber -Repository PSGallery

gwblok commented 6 months ago

@AkosBakos, where would that go?

Looks like there are a couple of scripts in OSD module that install that module, so we'd have to make sure we got all of them.

I wonder if we should have a separate function for installing that module, then use that function in all of the different places it's called.

Part of me thinks we should make it auto install onto the Flash Drive when we're building the OSDCloud Flash Drive.

AkosBakos commented 6 months ago

Still the same issue in the WinPE phase: image

When I invoke the Start-OSDCloud for the second time, it goes throw. 😳

PS: my test device is a Lenovo 500W G3

gwblok commented 6 months ago

Considering Closed for now with recently update to OSD Module, please create a new issue if the problem comes up again.