Update Catalog scraping throws "You cannot call a method on a null-valued expression" and costs ~10 minutes per device
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 50/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Tranquilo
- Stack tecnológico
- powershell
- Área
- devops
Línea de trabajo
Start with the MsUpCatResponse constructor in Classes/MsUpCatResponse.Class.ps1, where ctl00_catalogBody_updateMatches is read without a null check, then the empty-page guard in Private/MSCatalog/Invoke-CatalogRequest.ps1 around lines 28-31. Run Save-MsUpCatDriver or Get-MsUpCat against a search that returns no results table. Done means the lookup returns an empty result without the null-method warning, the request has a timeout, and any warning includes the URI and exception type.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Module version: OSD 26.7.6.1 (PSGallery, published 2026-07-06)
Affects: Invoke-OSDCloud -> Save-MsUpCatDriver -> Get-MsUpCat -> Invoke-CatalogRequest -> [MsUpCatResponse]
Related: #289 ("Unable to get driver for hardware component") appears to be the same code path, undiagnosed.
Symptom
During the "Microsoft Update Catalog Drivers" phase of an OSDCloud deployment, every device produces
six identical, context-free warnings and then a "No Results" line, taking almost exactly 10 minutes
per device:
[12:27:07 PM] Microsoft Update Catalog Drivers
Drivers for PNPClass DiskDrive will be downloaded from Microsoft Update Catalog to C:\Drivers\MsUpCatDrivers
Drivers for PNPClass Net will be downloaded from Microsoft Update Catalog to C:\Drivers\MsUpCatDrivers
WARNING: You cannot call a method on a null-valued expression.
WARNING: You cannot call a method on a null-valued expression.
WARNING: You cannot call a method on a null-valued expression.
WARNING: You cannot call a method on a null-valued expression.
WARNING: You cannot call a method on a null-valued expression.
WARNING: You cannot call a method on a null-valued expression.
[12:37:09 PM] [Save-MsUpCatDriver] No Results: Intel(R) Wi-Fi 6E AX211 160MHz VEN_8086&DEV_7E40
WARNING: You cannot call a method on a null-valued expression.
... x6 ...
[12:47:09 PM] [Save-MsUpCatDriver] No Results: Intel(R) Ethernet Connection (18) I219-LM VEN_8086&DEV_550A
Six warnings per device corresponds exactly to the six fallback searches in Save-MsUpCatDriver
(22H2, 21H2, Vibranium, 1903, 1809, bare). The warning names no function, no URL and no
hardware ID, which makes this very hard to attribute.
Upstream trigger: the catalog no longer returns the element being parsed
Reproduced directly against catalog.update.microsoft.com from a normal Windows 11 host, outside
WinPE, with Invoke-WebRequest -UseBasicParsing:
| Query | HTTP | Response time | ctl00_catalogBody_updateMatches |
ctl00_catalogBody_noResultText |
|---|---|---|---|---|
22H2+Net+PCI\VEN_8086&DEV_550A |
200 | 100.6s | ABSENT | ABSENT |
KB5034123 (a KB that definitely exists) |
200 | 100.5s | ABSENT | ABSENT |
PCI\VEN_8086&DEV_550A |
200 | 154.5s | ABSENT | ABSENT |
A known-good KB search returns no results table either, so this is not a "no matches for this
hardware ID" condition. The only ctl00_catalogBody_* element ids remaining on the page are:
ctl00_catalogBody_ResultsHeaderTable
ctl00_catalogBody_searchString
ctl00_catalogBody_textDetailsPopupBlocked
__EVENTARGUMENT, __EVENTVALIDATION and __VIEWSTATE are still present. Page <title> is still
Microsoft Update Catalog, there is no error page and no 8DDD* error code. Responses consistently
take 100 to 155 seconds.
So the search results table id that the module depends on is gone site-wide, and the "no results"
element used to detect an empty search is gone as well.
Why the module turns that into a 10-minute hang and a cryptic message
Three separate issues compound it.
1. Classes/MsUpCatResponse.Class.ps1 has no null guards (lines 10-15).
MsUpCatResponse($HtmlDoc) {
$Table = $HtmlDoc.GetElementbyId("ctl00_catalogBody_updateMatches")
$this.Rows = $Table.SelectNodes("tr") | Where-Object { $_.Id -ne "headerRow" } # <-- throws when $Table is $null
$this.EventArgument = $HtmlDoc.GetElementbyId("__EVENTARGUMENT").Attributes["value"].Value
$this.EventValidation = $HtmlDoc.GetElementbyId("__EVENTVALIDATION").Attributes["value"].Value
$this.ViewState = $HtmlDoc.GetElementbyId("__VIEWSTATE").Attributes["value"].Value
$this.ViewStateGenerator = $HtmlDoc.GetElementbyId("__VIEWSTATEGENERATOR").Attributes["value"].Value
$NextPageNode = $HtmlDoc.GetElementbyId("ctl00_catalogBody_nextPageLink")
$this.NextPage = if ($null -ne $NextPageNode) { $NextPageNode.InnerText.Trim() } else { $null }
}
NextPage is the only member that is null-checked. This is unchanged on master as of this report.
2. Private/MSCatalog/Invoke-CatalogRequest.ps1 cannot detect this page state, and discards all error context.
The guard at lines 28-31 only recognises two failure shapes:
$NoResults = $HtmlDoc.GetElementbyId("ctl00_catalogBody_noResultText")
$ErrorText = $HtmlDoc.GetElementbyId("errorPageDisplayedError")
if ($null -eq $NoResults -and $null -eq $ErrorText) {
return [MsUpCatResponse]::new($HtmlDoc) # <-- taken, because neither element exists any more
}
Both are absent now, so the page is treated as a valid result set and the constructor throws. The
handler at lines 46-48 then erases every useful detail:
catch {
Write-Warning "$_"
}
There is also no -TimeoutSec on the Invoke-WebRequest at line 25, so each attempt waits out the
catalog's full 100s+ response.
3. Save-MsUpCatDriver retries six times per device with no failure memory.
Public/Functions/MicrosoftCatalog.ps1 lines 705-721 issue six sequential Get-MsUpCat calls per
device. There is no circuit breaker, so a site-wide outage is re-probed for every hardware ID in the
machine. At ~100s per request that is ~10 minutes per device. Public/OSDCloud.ps1 lines 1776-1786
runs this for DiskDrive, Net and SCSIAdapter, so a typical laptop pays this several times over.
Additionally, $Rows = $Rows.Where({...}) at MicrosoftCatalog.ps1 lines 252 and 369 operates on
$Rows = $Res.Rows (line 233) without checking whether $Res is $null.
Suggested fixes
- Null-guard the
MsUpCatResponseconstructor. Ifctl00_catalogBody_updateMatchesis absent,
leaveRowsempty rather than throwing. Same for the__VIEWSTATEfamily. - In
Invoke-CatalogRequest, treat "no results table" as an empty result rather than a valid
response, add a-TimeoutSec, and include the URI and exception type in the warning instead of
bare"$_". - Add a per-run circuit breaker so that once the catalog is determined to be unreachable or
unparseable, the remaining lookups short-circuit instead of re-probing per device.
Workaround (verified)
Replacing Invoke-CatalogRequest in the module's own scope with a version that adds a 20s timeout,
detects the missing results table, and latches a "broken" flag reduced the cost from ~10 minutes per
device to 20 seconds once for the entire deployment, with zero warnings. Measured: first call 20.1s,
second call 0s, five subsequent calls 0.03s total.
Environment
- OSD 26.7.6.1
- Deployment host: WinPE (Windows PowerShell 5.1)
- Reproduced independently on Windows 11 with PowerShell 7.6.4, so this is not WinPE specific
Get-MsUpCatalso affected directly, not only viaSave-MsUpCatDriver
- Lenguaje dominante
- PowerShell
- Estrellas
- 251
- Forks
- 102
- Merge medio
- 2 min
- PR fusionados (30 d)
- 4
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de OSDeploy/OSD
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 68/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 63/100
Todos los issues de OSDeploy/OSD
Issues similares
-
Remove the `pull_request_target` workflow before GitHub blocks itPosiblemente ocupada @jat255 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 2 días
-
known-red S3: friction & debt
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
MedakaLang/medaka#4969 ·
Los mantenedores suelen responder en 1 día
-
cutover-blocker documentation v2-migration
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
disnog/netranger-db#11 · 1 comentario ·
-
needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
gke-labs/kube-agents#5150 ·
Los mantenedores suelen responder en 1 día
-
enhancement needs:sonnet ready-for-agent
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día